‹ Field GuideLetter 30 · The press that kept its receipt
Michi sees “two sheets on the way” flicker on the copy desk. Koko pulls the brake. The turn ends interrupted. Should the sparrow deliver a newspaper? Look in the tray before answering.
What goes around the loop
A coding-agent harness builds context, asks a model for the next step, collects a complete tool call, checks its arguments and permissions, executes the tool, and puts its observation back into context. In our newsroom the desk model is a small deterministic JavaScript function. For the order “two jade copies for Pond Desk” it emits a call to a simulated print tool. The local press returns receipt sheet_A and a count of two. Only a subsequent model pass can read that observation and write the completed bundle report. This is a small, runnable example of the action–observation cycle. All orders, timing and printed effects live inside the simulation. OpenAI’s illustrated agent loop · Anthropic’s Agent SDK loop · Yao et al., ReAct
A closing brace comes before a seal
At the copy desk, the first two text deltas make “Tonight in Miko Town.” A tool call then streams two argument fragments. Together they spell a complete JSON object with page A and two copies. Imagine a disconnect immediately after the closing brace. The parser can read the buffer, yet the tool block never closed. Keep the headline visible, mark the call interrupted and leave the printing tray empty. Try a sealed eight-copy request too. That request passes JSON parsing and fails this press’s four-copy limit.
Claude Agent SDK can expose partial stream events including tool-input JSON deltas. At the tool-block stop the input can be assembled and validated. Pi’s pinned loop selects calls from the completed assistant message. Both give the copy editor a reason to track draft arguments separately from a dispatchable tool call. The game uses normalized event labels. Claude streaming reference · Pi loop at e44181f
The fast brass tube carries the second order
Two calls use the same print tool. Page A is tc_7 and asks for two copies. Page B is tc_8 and asks for one. B’s receipt reaches the board at 55 ms and A’s at 90 ms. Connecting the first arrival to the first call would tell the model that A printed one copy. Read the call IDs on the envelopes. Our Pi fixture assembles A then B for the model even when the B animation runs first. Reverse the slow pipe and try the same wiring rule. The clock values are invented. Pi execution and result ordering · Anthropic’s tool result contract
One steering note and one follow-up
The gold first sheet is already in the rollers. Put “use a blue footer” in the steering basket and “archive the receipt” in the follow-up basket. The first print finishes gold. On the next model pass the draft turns blue. When the run would otherwise stop, the queued follow-up starts another pass to file the receipt. Swap the baskets to see the archive happen at the wrong time. This classroom puts one slip in each basket for the intended schedule. Real queue delivery modes may take one or several available messages.
The Pi source defines those two queue checks. Mario Zechner’s release announcement also shows an application accepting these message types during compaction. Claude’s streaming-input interface can receive a new user message during tool work and deliver it once those tools finish. Waiting for the earlier ResultMessage gives a separate response. Codex App Server can steer an active turn by its expectedTurnId. The incoming instruction joins that turn. One user-work turn at the App Server can contain many items. Pi’s pinned loop · Mario Zechner’s release post on X · His Pi design account · Claude running-agent input · Codex App Server reference
Find out whether the ink landed
Decline a job at the gate. Its matched error result explains the denial and the tray remains empty. Now grant permission, crank to beat three and pull the brake. When the local tool observes the stop, it returns an abort and leaves no receipt. Finally, crank to beat four before pulling. The local tool has committed sheet_A and returned its observation. The terminal turn records an interruption. The two sheets are still there to deliver. These are three explicit classroom schedules. In a deployed tool, check its terminal event and its durable effect record. Agent SDK permission flow · Codex App Server turn lifecycle
Rebuild the view from its envelopes
A server request has envelope number 402, is scoped to turn_3 and concerns press item_8. Answer 402 to resolve the outstanding approval. When the press finishes, item_8 records the tool result. A different item, item_9, streams the editor’s prose. Drop one preview fragment. Applying the completed message restores the entire row. The earlier preview is temporary. Appending the whole terminal text would duplicate its first words. Later the turn completes with status interrupted. An item’s completion and a turn’s terminal status answer different questions.
The switchboard uses a shortened event vocabulary and classroom payloads. For an actual client, implement the service’s own handshake, generated types and notification names. Codex App Server uses a JSON-RPC-based protocol with its own conventions. An RPC request expects its response ID. A notification carries no response ID. App Server source at 8c04e25 · JSON-RPC specification · OpenAI’s App Server engineering account · Dominik Kundel’s harness talk
Run the same harness in Node
From the public repository, run node examples/replay-newsroom.cjs --run n1-11120. The ticket requests two jade copies for Pond Desk with a normal finish. The messages array contains the user order, the assistant tool call, its tool result and the assistant’s final report. Change the last digit to 3. The interrupted run keeps the receipt and stops with three messages. In the browser, expand “Messages in model context” as you crank. The tool observation appears only after the press returns it. Runnable example · Model, dispatcher and reducer
Print the paper and send it across the rooftops
Set the destination to Pond Desk, choose late braking, and run the press. Read the matched receipt, then send the resulting bundle through the lit window. With calm wind, five spring notches give 11 + 5 × 8 = 51 paces, exactly the distance to Pond Desk. A miss brings the bundle back with the sparrow. An early brake leaves the delivery tray empty. The visiting ticket shares your order and the chosen schedule. Your friend operates a fresh press. Download the front page and the event ledger, then use the repository’s replay command to check the tool result, model context and every throw. Play Moonbeam Newsroom · Take the press editor course