Skip to content

Commit d708e02

Browse files
DumbrisclaudePaperclip-Paperclip
committed
docs(code-exec): reconcile cookbook prose with no-top-level-return rule
CodexReviewer round-2 request_changes on PR #753: the Recipe 3 example fix was good but the surrounding prose still overpromised. - Intro (line 3) no longer claims recipes are 'copy-pasteable'; they are templates to adapt (placeholder server/tool names; the // language and // input lines are annotations, not executed code). - Reworded 'let the failure return to the agent' -> 'surface to the agent' so the word 'return' never appears in prose implying a top-level return. The line-18 contract note and the 'Top-level return ❌' table row (added in the prior commit) already state the rule correctly; verified no other prose claims an explicit/top-level return becomes the result. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-Authored-By: Paperclip <noreply@paperclip.ing>
1 parent 7c22b58 commit d708e02

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

docs/code_execution/cookbook.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
# Code Execution — Orchestration Cookbook
22

3-
Copy‑pasteable **TypeScript** recipes for orchestrating multiple upstream MCP
4-
tools in a single `code_execution` call. Each recipe shows the pattern, the
5-
multi‑call sequence it replaces, and the token/latency it saves.
3+
**TypeScript** recipes for orchestrating multiple upstream MCP tools in a
4+
single `code_execution` call. Each recipe shows the pattern, the multi‑call
5+
sequence it replaces, and the token/latency it saves. Treat them as
6+
**templates to adapt**, not literal paste‑and‑run scripts: swap the placeholder
7+
server/tool names (`crm`, `orders`, `github`, `slack`, …) for your own. The
8+
leading `// language:` / `// input:` lines are annotations — the executed
9+
*code* is the body below them; `language` and `input` are separate
10+
`code_execution` tool parameters.
611

712
TypeScript code execution is **generally available** (GA) — it shipped in
813
preview in v0.45.0 and graduates to GA in v0.46.0 (MCP-38, roadmap #15). See the
@@ -231,7 +236,7 @@ last.ok
231236
**⚠️ No wall‑clock backoff.** The sandbox has no `setTimeout`, so retries are
232237
*immediate*. That is the right behaviour for transient races, but it will **not**
233238
help a server that needs seconds to recover. For true exponential backoff, let
234-
the failure return to the agent and retry across turns, or push the retry into
239+
the failure surface to the agent and retry across turns, or push the retry into
235240
the upstream tool. Do **not** busy‑wait — it burns the `timeout_ms` budget and
236241
the CPU for nothing.
237242

0 commit comments

Comments
 (0)