Repository navigation
fix(agents): report deferred sessions_yield as a normal outcome - #149983
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
When sessions_yield runs before earlier async tool results have reached the model, the tool defers and keeps the turn active. It returned that deferral as status "error", so the channel progress row read "Yield failed" although nothing failed and the run continued. Return status "deferred" with the same guidance instead. The result classifier no longer marks it as an error, the progress row stays neutral, and the next model response still receives the pending results before the model decides whether to yield again.
82a3d53 to
2ee02da
Compare
|
Codex review: needs changes before merge. Reviewed September 16, 2026, 6:48 AM ET / 10:48 UTC. ClawSweeper reviewWhat this changesThe PR reports deferred session yielding as a normal outcome and adds coverage for transcript error flags and progress-item status. Merge readiness⛔ Needs changes before merge - 1 item remains The fix remains useful: current main still classifies an expected deferral as an error. No introduced correctness or security defect was found. Priority: P2 Review scores
Verification
How this fits togetherThe session-yield tool lets an agent pause while waiting for child work. Its result feeds the model transcript and channel progress reporting; unobserved async results require the turn to continue instead. flowchart TD
A[Model requests yield] --> B{Earlier results unobserved?}
B -->|Yes| C[Return normal deferral]
C --> D[Deliver results to next model request]
B -->|No| E[Check yield claim]
E --> F[Yield or report genuine error]
C --> G[Transcript and progress status]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +79. Total +79 across 4 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep deferral as a non-error result at the yield tool, preserving result delivery, claim validation, and genuine failure reporting. Do we have a high-confidence way to reproduce the issue? Yes, from source: call sessions_yield before earlier async results reach a subsequent model request; main returns an error payload that the shared classifier marks as failed. No runtime reproduction was executed in this review. Is this the best way to solve the issue? Yes. Correcting the producing tool's payload is narrower and more consistent than special-casing deferral in transcript or progress consumers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4bba1462564a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Proof: live Telegram DM on the Test Server, before and after, with a background
|
…claw#149983) ## What Problem This Solves When the model calls `sessions_yield` in the same response as an earlier async tool call whose result it has not received yet, OpenClaw defers the yield and keeps the turn active, as docs/tools/subagents/tool-reference.md describes. The tool returned that deferral as `status: "error"`, so the result was stored with `isError: true` and channel progress showed **Yield failed** and pinned the row, although the run continued and the child work completed. ## Why This Change Was Made The deferral is an expected outcome. The tool now returns `status: "deferred"` with the same guidance for the model. The result classifier does not treat `deferred` as a failure, so the progress row stays neutral. The guard and the delivery of pending results to the next model request are unchanged. This state has one writer: the yield tool's result. ## User Impact No "Yield failed" row for a deferral. Real yield errors (no session context, no pending child completion, rejected claim) still show as failures. ## Evidence Live Telegram DM turn on the Test Server against the official OpenAI Responses endpoint with async tool calls enabled, prompt: start `sleep 25 && echo YIELD_PROOF_DONE` with `exec` and call `sessions_yield` in the same response. The model made two yield calls on both builds; the first is the async-result deferral, the second is a genuine "no pending child completion" error. Both builds delivered the exec output and replied `YIELD_PROOF_DONE`. | Progress draft rows | main `e076b388fc5` | this branch | | --- | --- | --- | | first yield (deferral) | `⏸️ Yield failed` (stored `isError: true`, status `error`) | `⏸️ Yield` (stored `isError: false`, status `deferred`) | | second yield (no pending child) | `⏸️ Yield failed` | `⏸️ Yield failed` | | final reply | `YIELD_PROOF_DONE` | `YIELD_PROOF_DONE` | Unit red on main with the tool at main and the new tests present: ``` node scripts/run-vitest.mjs run src/agents/tools/sessions-yield-tool.test.ts # 1 failed | 11 passed node scripts/run-vitest.mjs run packages/agent-core/src/agent-loop.async-yield.test.ts # 3 failed | 1 passed ``` Green on this branch: 12/12, 4/4, and the two handler cases. Changed-file lint, format, max-lines and assertion-safety ratchets, and the full typecheck preflight pass. ## Compatibility No config, schema, protocol, or SDK change. ## Consumers Readers of this result's status only check `"yielded"`; none read the old `error` field. ## Invalidation None; per-call value, no cached projection. ## Tests A tool test runs the deferral inside the execution context and asserts a non-error `deferred` result with no claim or yield. The async-yield loop test runs with the production result classifier and asserts the persisted deferred result is not an error. A tool-handler test checks that a `deferred` yield result becomes a completed progress item while an `error` result still becomes a failed one. Co-authored-by: Ayaan Zaidi <[email protected]>
…sync tools (#166876) ## What Problem This Solves Fixes: with GPT-6 Astra async tools, the model's real answer was lost when it called `sessions_yield` to wait for its own parallel tool results. Telegram received only a short follow-up "supplement", never the answer itself. On our setup (Telegram forum topic, `openai/gpt-6-astra`, built-in runtime), one response ran `memory_search`, `exec` and `read` in parallel. It then wrote commentary plus `sessions_yield` ("Await source rows exec + memory recall + planning ref read"), and then, still in the same response, a 2,967-character `final_answer` checklist. The model wrote that checklist before seeing any tool result. A second model call (no new user input) saw the results and wrote a 332-character note: "One additional booking to check…". Only the note was sent. ## User Impact When Astra waits for its own async tool results with `sessions_yield`, the response now really pauses. The model sees the results first and writes one complete answer. There are no new messages, notices or settings. ## Why This Change Was Made The model's wait tool was not allowed to wait. - #138046 (`a637374e435`) added Astra async tools and marks **every** function tool `async: true` (`openai-responses-client.ts`, `prepareRequest`), including `sessions_yield`. OpenAI's [async tool guide](https://developers.openai.com/api/docs/guides/async-tool-calling#add-a-wait-tool) says a wait tool must be an ordinary synchronous function: a sync call pauses the response, and the next request delivers the async results before the wait status. Because `sessions_yield` was async, Astra kept generating after the yield and answered without the results. - The `sessions_yield` deferral (`hasUnobservedAsyncToolResults`, from #146667 `2f663805b4c`, reworded as `deferred` in #149983 `e252366ffe2`) was **not** spurious. The results were already in the transcript, but async results only reach the model in the next request, so the model had not seen them. The gate correctly keeps the yield from ending the turn. Its old text ("Finish this response to receive them") could never help, because the model only reads it in that next request. The fix, at the owners: - `Tool.async?: false` (llm-core) lets a tool opt out of async calls. The Responses transport keeps such tools synchronous and still marks every other function tool async. The two session tool projections that pick fields (`projectAgentToolDefinition`, `wrapToolDefinition`) carry the flag next to `executionMode`. The closed worker tool-surface schema (`WorkerToolSurfaceSchema`) accepts it, so worker-environment turns that carry `sessions_yield` still start. - `sessions_yield` sets `async: false`. Its deferral now says what is true for a synchronous yield: the earlier results arrive with this result. - `async: false` is documented as a supported tool property in `docs/plugins/tool-plugins.md`, next to `executionMode`, `hideFromChannelProgress` and `catalogMode`. Plugins can already reach it through `api.registerTool`. Other providers, Code Mode and Tool Search catalog calls are unchanged. Maintainer decision (API direction): `async: false` is accepted as a supported, additive tool property. Scope: it keeps a directly visible function tool synchronous on GPT-6 Astra async-tool requests. Other providers, Code Mode and Tool Search catalog calls are unchanged. We chose this over a private carrier because the field is already reachable through `api.registerTool`, and a second private path (a transport option listing synchronous tool names) would add more code across agent-core stream options and the worker native runtime. Kept from earlier decisions: the deferral gate and its non-error `deferred` status (#146667, #149983), and async execution for every other direct tool (#138046). Code Mode and non-Astra routes are untouched. Not changed: other ways the model might wait, such as `process` polling. Boundaries a `sessions_yield` definition crosses on its way to an Astra async-tool request: the local and sub-agent session projections (both carry the flag), the shared `prepareRequest` (used by SSE, WebSocket, steering continuation, and compaction or retry rebuilds), and the worker tool surface (schema fixed here; the worker side spreads the definition). The native worker runtime passes `context.tools` through unchanged. Gateway-placed worker inference copies only name, description and parameters, but that path never enables async tool execution, so no tool is async there. Ordinary local turns do not cross the worker surface; its only producer is `src/gateway/worker-environments/worker-turn-execution.ts:358`. ## Evidence **Regressions** - `packages/ai/src/transports/openai-responses-client.continuation.test.ts`: the real `createSessionsYieldTool` and a plain tool go through the real session projections (`toToolDefinitions` → `wrapToolDefinition`) into the real Responses transport for `gpt-6-astra` with async tools on. The test asserts `exec` is sent `async: true` and `sessions_yield` is not. With the transport fix reverted it **fails** (`sessions_yield` is sent with `"async": true`). On this branch it passes (47 tests). - `src/gateway/worker-environments/worker-gateway-tool-runtime.test.ts`: the gateway issues the real `sessions_yield` through `getSurface`, and the surface must validate and keep `async: false`. With the schema line reverted it **fails** with `Worker tool surface is invalid` (the round-1 review blocker: worker turns could not start). - Also green on the final code: `prepared-tool-surface`, `agent-tool-definition-adapter*`, `tool-definition-wrapper`, `worker.runtime`, `worker-gateway-tools`, `worker-turn-rpc`, `sessions-yield-tool` (11 files, 230 tests), `pnpm tsgo:core`, `pnpm tsgo:core:test`, oxfmt/oxlint on changed files, `docs:check-links`, `docs:check-mdx`, `git diff --check`. **Live: Telegram Test Server with real `gpt-6-astra`.** Each run used its own forum topic and an isolated gateway on built `dist` (state under `/tmp`). The config matches our setup: the official `https://api.openai.com/v1` endpoint (async tools on), built-in runtime, code mode off, tool search on, `streaming.progress` with tool progress and commentary, thinking `low`. After the round-1 fix the build was `08acaf0afac`, which has the same code as this head (only `docs/plugins/tool-plugins.md` changed since). Message ids are the userbot's. Incident shape (a). Same prompt both sides: a rough card list, then "start both checks together: cat card-export.csv with exec and open trip-notes.md with the read tool, and call sessions_yield to wait for them. Don't hold the checklist for the files: right after the sessions_yield call, write the dated checklist from my list; when the results arrive, add only what they change." The files hold two facts the list lacks: the hotel was personal, and one dinner was split four ways. | | `origin/main` `c73c99d9e03` | this PR (`08acaf0afac` build) | | --- | --- | --- | | `sessions_yield` call | `async: true`, `deferred` | synchronous, `deferred` ("arrive with this result") | | Response 1 after the yield | kept generating a 416-token "**Provisional Splitwise checklist**" `final_answer` before any result arrived | ends at the yield call (`toolUse`) | | Response 2 | "Two corrections from the files: …" | the full checklist plus "File-check changes: Hotel: exclude … Jalan Alor: four ways, ₹1,102.50 each …" | | Model requests | 2 | 2 | | Bot messages (userbot view) | 1: msg 39, "Two corrections from the files: …". **The checklist never arrived.** | 1: msg 90, "Splitwise checklist — 8 October 2026 / From your rough list … File-check changes … Final shared total: ₹88,944 …" | Both sides also posted a progress draft (`Working / Exec / Read…`), which was deleted when the answer landed. Sibling runs on the same build: | Case | Model path | Bot messages (userbot) | | --- | --- | --- | | (b) sub-agent: `sessions_spawn` → `sessions_yield` → completion | yield `deferred`, then `yielded`; the completion wake writes the answer | msg 43 once: "Dev skipped the Jalan Alor dinner. The ₹4,410 bill is split four ways: … ₹1,102.50 …"; draft deleted | | (c) background `exec` (`sleep 30; echo BG-…-done`) with completion wake | exec background; yield `deferred`, then `nothing_pending`; short waiting reply; the exit wake writes the output | msg 97 "Running in the background. I'll report its exact output when it finishes.", then msg 98 "BG-5C861F-done" once | | (e) plain single-tool turn ("read trip-notes.md, who skipped the dinner?") | `read` (async), then a synchronous yield `deferred`; one answer | msg 99 "Dev skipped the Jalan Alor dinner." once; draft deleted | | (d) `NO_REPLY` on a direct user request | model says `NO_REPLY`; the required-reply retry asks for a visible answer | msg 69 "Noted for this thread." **Same on `origin/main`** (`c73c99d9e03`): msg 95 "Noted for this thread." | On (d): every live `NO_REPLY` shape we tried reached a reply contract that requires visible text, and this PR changes none of that code. A direct user request in a group is a required-reply turn. After a yield, the requester's completion wake must produce a visible final ("A yield owes the conversation a visible final unless private findings let the requester choose silence", `subagent-announce.requester-settle-state.ts:170-172`). The three completion-wake runs showed the same retry (`empty response detected … visible-answer continuation`). Ambient room events never reached the model. The user-request case matches `origin/main` exactly. (f) worker-placed turn: our setup has no worker environments, so ordinary turns never cross the worker surface. The worker regression above covers it. LOC vs `origin/main`: production +19/−2 (7 files), tests +36, docs +18/−5. ## Bounded cost - Runtime: one `Set` built from the request's tool list, only on Astra async-tool requests. No new requests, timers, state, settings or messages. A yield that waits for async results no longer produces a blind answer, so the incident case saves one wasted answer of about 400 output tokens. - Live proof spend: about $8.56 of `gpt-6-astra` across 20 Telegram Test Server runs. That is $3.59 for exploration and the first before/after pair, and $4.97 for the final-head siblings and the `origin/main` `NO_REPLY` baseline. Figures are summed from transcript usage costs, including sub-agents. Every run-owned forum topic has been deleted. Co-authored-by: Ayaan Zaidi <[email protected]>
…sync tools (openclaw#166876) ## What Problem This Solves Fixes: with GPT-6 Astra async tools, the model's real answer was lost when it called `sessions_yield` to wait for its own parallel tool results. Telegram received only a short follow-up "supplement", never the answer itself. On our setup (Telegram forum topic, `openai/gpt-6-astra`, built-in runtime), one response ran `memory_search`, `exec` and `read` in parallel. It then wrote commentary plus `sessions_yield` ("Await source rows exec + memory recall + planning ref read"), and then, still in the same response, a 2,967-character `final_answer` checklist. The model wrote that checklist before seeing any tool result. A second model call (no new user input) saw the results and wrote a 332-character note: "One additional booking to check…". Only the note was sent. ## User Impact When Astra waits for its own async tool results with `sessions_yield`, the response now really pauses. The model sees the results first and writes one complete answer. There are no new messages, notices or settings. ## Why This Change Was Made The model's wait tool was not allowed to wait. - openclaw#138046 (`8995a7eeac9`) added Astra async tools and marks **every** function tool `async: true` (`openai-responses-client.ts`, `prepareRequest`), including `sessions_yield`. OpenAI's [async tool guide](https://developers.openai.com/api/docs/guides/async-tool-calling#add-a-wait-tool) says a wait tool must be an ordinary synchronous function: a sync call pauses the response, and the next request delivers the async results before the wait status. Because `sessions_yield` was async, Astra kept generating after the yield and answered without the results. - The `sessions_yield` deferral (`hasUnobservedAsyncToolResults`, from openclaw#146667 `6293548dcd5`, reworded as `deferred` in openclaw#149983 `5f070d3ee30`) was **not** spurious. The results were already in the transcript, but async results only reach the model in the next request, so the model had not seen them. The gate correctly keeps the yield from ending the turn. Its old text ("Finish this response to receive them") could never help, because the model only reads it in that next request. The fix, at the owners: - `Tool.async?: false` (llm-core) lets a tool opt out of async calls. The Responses transport keeps such tools synchronous and still marks every other function tool async. The two session tool projections that pick fields (`projectAgentToolDefinition`, `wrapToolDefinition`) carry the flag next to `executionMode`. The closed worker tool-surface schema (`WorkerToolSurfaceSchema`) accepts it, so worker-environment turns that carry `sessions_yield` still start. - `sessions_yield` sets `async: false`. Its deferral now says what is true for a synchronous yield: the earlier results arrive with this result. - `async: false` is documented as a supported tool property in `docs/plugins/tool-plugins.md`, next to `executionMode`, `hideFromChannelProgress` and `catalogMode`. Plugins can already reach it through `api.registerTool`. Other providers, Code Mode and Tool Search catalog calls are unchanged. Maintainer decision (API direction): `async: false` is accepted as a supported, additive tool property. Scope: it keeps a directly visible function tool synchronous on GPT-6 Astra async-tool requests. Other providers, Code Mode and Tool Search catalog calls are unchanged. We chose this over a private carrier because the field is already reachable through `api.registerTool`, and a second private path (a transport option listing synchronous tool names) would add more code across agent-core stream options and the worker native runtime. Kept from earlier decisions: the deferral gate and its non-error `deferred` status (openclaw#146667, openclaw#149983), and async execution for every other direct tool (openclaw#138046). Code Mode and non-Astra routes are untouched. Not changed: other ways the model might wait, such as `process` polling. Boundaries a `sessions_yield` definition crosses on its way to an Astra async-tool request: the local and sub-agent session projections (both carry the flag), the shared `prepareRequest` (used by SSE, WebSocket, steering continuation, and compaction or retry rebuilds), and the worker tool surface (schema fixed here; the worker side spreads the definition). The native worker runtime passes `context.tools` through unchanged. Gateway-placed worker inference copies only name, description and parameters, but that path never enables async tool execution, so no tool is async there. Ordinary local turns do not cross the worker surface; its only producer is `src/gateway/worker-environments/worker-turn-execution.ts:358`. ## Evidence **Regressions** - `packages/ai/src/transports/openai-responses-client.continuation.test.ts`: the real `createSessionsYieldTool` and a plain tool go through the real session projections (`toToolDefinitions` → `wrapToolDefinition`) into the real Responses transport for `gpt-6-astra` with async tools on. The test asserts `exec` is sent `async: true` and `sessions_yield` is not. With the transport fix reverted it **fails** (`sessions_yield` is sent with `"async": true`). On this branch it passes (47 tests). - `src/gateway/worker-environments/worker-gateway-tool-runtime.test.ts`: the gateway issues the real `sessions_yield` through `getSurface`, and the surface must validate and keep `async: false`. With the schema line reverted it **fails** with `Worker tool surface is invalid` (the round-1 review blocker: worker turns could not start). - Also green on the final code: `prepared-tool-surface`, `agent-tool-definition-adapter*`, `tool-definition-wrapper`, `worker.runtime`, `worker-gateway-tools`, `worker-turn-rpc`, `sessions-yield-tool` (11 files, 230 tests), `pnpm tsgo:core`, `pnpm tsgo:core:test`, oxfmt/oxlint on changed files, `docs:check-links`, `docs:check-mdx`, `git diff --check`. **Live: Telegram Test Server with real `gpt-6-astra`.** Each run used its own forum topic and an isolated gateway on built `dist` (state under `/tmp`). The config matches our setup: the official `https://api.openai.com/v1` endpoint (async tools on), built-in runtime, code mode off, tool search on, `streaming.progress` with tool progress and commentary, thinking `low`. After the round-1 fix the build was `08acaf0afac`, which has the same code as this head (only `docs/plugins/tool-plugins.md` changed since). Message ids are the userbot's. Incident shape (a). Same prompt both sides: a rough card list, then "start both checks together: cat card-export.csv with exec and open trip-notes.md with the read tool, and call sessions_yield to wait for them. Don't hold the checklist for the files: right after the sessions_yield call, write the dated checklist from my list; when the results arrive, add only what they change." The files hold two facts the list lacks: the hotel was personal, and one dinner was split four ways. | | `origin/main` `a2ab6c2cf57` | this PR (`08acaf0afac` build) | | --- | --- | --- | | `sessions_yield` call | `async: true`, `deferred` | synchronous, `deferred` ("arrive with this result") | | Response 1 after the yield | kept generating a 416-token "**Provisional Splitwise checklist**" `final_answer` before any result arrived | ends at the yield call (`toolUse`) | | Response 2 | "Two corrections from the files: …" | the full checklist plus "File-check changes: Hotel: exclude … Jalan Alor: four ways, ₹1,102.50 each …" | | Model requests | 2 | 2 | | Bot messages (userbot view) | 1: msg 39, "Two corrections from the files: …". **The checklist never arrived.** | 1: msg 90, "Splitwise checklist — 8 October 2026 / From your rough list … File-check changes … Final shared total: ₹88,944 …" | Both sides also posted a progress draft (`Working / Exec / Read…`), which was deleted when the answer landed. Sibling runs on the same build: | Case | Model path | Bot messages (userbot) | | --- | --- | --- | | (b) sub-agent: `sessions_spawn` → `sessions_yield` → completion | yield `deferred`, then `yielded`; the completion wake writes the answer | msg 43 once: "Dev skipped the Jalan Alor dinner. The ₹4,410 bill is split four ways: … ₹1,102.50 …"; draft deleted | | (c) background `exec` (`sleep 30; echo BG-…-done`) with completion wake | exec background; yield `deferred`, then `nothing_pending`; short waiting reply; the exit wake writes the output | msg 97 "Running in the background. I'll report its exact output when it finishes.", then msg 98 "BG-5C861F-done" once | | (e) plain single-tool turn ("read trip-notes.md, who skipped the dinner?") | `read` (async), then a synchronous yield `deferred`; one answer | msg 99 "Dev skipped the Jalan Alor dinner." once; draft deleted | | (d) `NO_REPLY` on a direct user request | model says `NO_REPLY`; the required-reply retry asks for a visible answer | msg 69 "Noted for this thread." **Same on `origin/main`** (`a2ab6c2cf57`): msg 95 "Noted for this thread." | On (d): every live `NO_REPLY` shape we tried reached a reply contract that requires visible text, and this PR changes none of that code. A direct user request in a group is a required-reply turn. After a yield, the requester's completion wake must produce a visible final ("A yield owes the conversation a visible final unless private findings let the requester choose silence", `subagent-announce.requester-settle-state.ts:170-172`). The three completion-wake runs showed the same retry (`empty response detected … visible-answer continuation`). Ambient room events never reached the model. The user-request case matches `origin/main` exactly. (f) worker-placed turn: our setup has no worker environments, so ordinary turns never cross the worker surface. The worker regression above covers it. LOC vs `origin/main`: production +19/−2 (7 files), tests +36, docs +18/−5. ## Bounded cost - Runtime: one `Set` built from the request's tool list, only on Astra async-tool requests. No new requests, timers, state, settings or messages. A yield that waits for async results no longer produces a blind answer, so the incident case saves one wasted answer of about 400 output tokens. - Live proof spend: about $8.56 of `gpt-6-astra` across 20 Telegram Test Server runs. That is $3.59 for exploration and the first before/after pair, and $4.97 for the final-head siblings and the `origin/main` `NO_REPLY` baseline. Figures are summed from transcript usage costs, including sub-agents. Every run-owned forum topic has been deleted. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
When the model calls
sessions_yieldin the same response as an earlier async tool call whose result it has not received yet, OpenClaw defers the yield and keeps the turn active, as docs/tools/subagents/tool-reference.md describes. The tool returned that deferral asstatus: "error", so the result was stored withisError: trueand channel progress showed Yield failed and pinned the row, although the run continued and the child work completed.Why This Change Was Made
The deferral is an expected outcome. The tool now returns
status: "deferred"with the same guidance for the model. The result classifier does not treatdeferredas a failure, so the progress row stays neutral. The guard and the delivery of pending results to the next model request are unchanged. This state has one writer: the yield tool's result.User Impact
No "Yield failed" row for a deferral. Real yield errors (no session context, no pending child completion, rejected claim) still show as failures.
Evidence
Live Telegram DM turn on the Test Server against the official OpenAI Responses endpoint with async tool calls enabled, prompt: start
sleep 25 && echo YIELD_PROOF_DONEwithexecand callsessions_yieldin the same response. The model made two yield calls on both builds; the first is the async-result deferral, the second is a genuine "no pending child completion" error. Both builds delivered the exec output and repliedYIELD_PROOF_DONE.c4f6e6b38bf⏸️ Yield failed(storedisError: true, statuserror)⏸️ Yield(storedisError: false, statusdeferred)⏸️ Yield failed⏸️ Yield failedYIELD_PROOF_DONEYIELD_PROOF_DONEUnit red on main with the tool at main and the new tests present:
Green on this branch: 12/12, 4/4, and the two handler cases. Changed-file lint, format, max-lines and assertion-safety ratchets, and the full typecheck preflight pass.
Compatibility
No config, schema, protocol, or SDK change.
Consumers
Readers of this result's status only check
"yielded"; none read the olderrorfield.Invalidation
None; per-call value, no cached projection.
Tests
A tool test runs the deferral inside the execution context and asserts a non-error
deferredresult with no claim or yield. The async-yield loop test runs with the production result classifier and asserts the persisted deferred result is not an error. A tool-handler test checks that adeferredyield result becomes a completed progress item while anerrorresult still becomes a failed one.