Skip to content

fix(voice-call): stop reporting host cancellation as tool failure - #134924

Merged
steipete merged 5 commits into
mainfrom
fix/voice-call-host-cancellation-20260831
Sep 1, 2026
Merged

steipete merged 5 commits into
mainfrom
fix/voice-call-host-cancellation-20260831

Conversation

@steipete

@steipete steipete commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Closes #134883 — realtime phone calls report independent host cancellation as failure.

Related: #133844 and native Talk PR #134003. Native Talk and Discord voice cancellation are separate work; neither is changed or closed here.

Additional instructions

This is a same-repository maintainer branch; maintainers can update it.

What Problem This Solves

Callers could receive a tool failure instead of cancellation when host agent work was cancelled while the phone session stayed open. Standalone forced-consult diagnostics also called that cancellation a failure. The general-tool invocation had a second gap: attaching .catch to its returned promise missed synchronous throws, leaving the provider without a terminal tool result.

Existing phone teardown coverage did not exercise independent host cancellation: phone-owned teardown correctly retires delivery before aborting pending work.

Why This Change Was Made

The forced join, native consult, and general-tool paths now use one Talk runtime rejection projector: the canonical abort classifier plus the existing cancelled payload. Forced-consult diagnostics use the same classification. The general invocation catches synchronous throws and rejected promises with an explicit local try/await/catch; forced/native scheduling and ownership are unchanged.

The projector belongs in the server runtime adapter, not the browser-shared message/policy module, because ordinary error formatting needs server-side redaction. The browser-shared module remains unchanged. A real local type predicate removes repeated object guards and casts; unreachable general-path consult handling is removed. The assertion-safety baseline shrinks from three entries to one for this handler.

Production LOC is +42/-42 (net zero); tests +227/-24 (net +203); docs +4/-0. No configuration, dependency, schema, provider wire contract, cancellation authority, suppression baseline, or compatibility machinery is added.

User Impact

Independent host cancellation produces the existing cancelled result without ending the phone call or emitting a false tool failure. Timeouts and ordinary failures remain errors; fulfilled results pass through unchanged. Synchronous general-tool failures now also settle once instead of silently omitting a result. Teardown-before-abort, supersession, native/forced deduplication, continuation, and once-only terminal settlement remain covered.

The Voice Call guide documents the distinction.

Evidence

  • Original handler/WebSocket reproduction: 9 cancellation cases failed before the repair, while 15 failure/timeout/fulfilled controls passed. Three standalone forced-consult diagnostic cases separately reproduced false failure logging.
  • New synchronous reproduction in that same real handler/loopback WebSocket fixture: 5 cases failed before invocation repair, with 8 asynchronous/fulfilled controls passing. Each failed because no terminal provider result was delivered.
  • Final focused retry: 201 tests passed across eight files, including all 29 forced/native/general outcome cases, provider-failure normalization, compaction exhaustion, and lifecycle/settlement coverage. One earlier attempt timed out in the unchanged real-runtime dynamic import; the identical command passed on retry with no assertion or timeout changes.
  • Fresh isolated Codex autoreview of the full branch candidate, including the cleanup and final test-only lint correction: scoped-clean at P0/P1, with source integrity verified. The reviewer did not run tests; execution proof is reported separately above.
  • Prior full build, Control UI build, and hosted build-artifacts jobs passed the server/browser boundary repair. This final invocation/type-predicate cleanup adds no import or package topology change.
  • The implicated baseline handler is byte-identical to stable v2026.8.1; introduction provenance remains unknown and is not attributed to the native Talk follow-up.

Provider-abort review disposition

The active-caller controls exercise real projectProviderError → handleAssistantFailover → voice projection: provider AbortError, TimeoutError, and ordinary connection failure remain error results. The compaction control proves exhausted provider aborts become CompactionError after three attempts, not host cancellation.

This follows the actual owners: provider adapters and the lazy provider registry project failures with their own request signal; assistant failure handling surfaces FailoverError. Active-caller compaction retries raw provider aborts and wraps exhaustion. Requiring the phone signal to abort would reinstate #134883 because that signal does not own independent host-run cancellation. The requested provider-failure controls are added; the suggested phone-signal gate is intentionally not applied. This is evidence for these reachable paths, not a claim about arbitrary third-party code. ClawSweeper accepted this evidence and withdrew the old P1. Its 10:09 UTC exact-head review reports no correctness/security findings; its remaining exact-head CI request is now satisfied.

Proof boundary

The WebSocket/handler proof uses synthetic carrier/provider edges; it is not a live phone or provider API test. Live calls, credential hydration, production-state copies, and service operations were expressly prohibited and were not performed. No external API contract changes. Combined integration with unfinished native Talk or Discord work is not claimed.

Current head: a017d117da898a6fa3387016c635ab2b21347cd7. The complete eight-file changed gate passed, including lint, all four type lanes, dead-export checks, and architecture/owner guards. The final phone rerun passed 93 tests; after the test-table lint correction, focused lint and all 29 outcome cases passed again. Fresh full-candidate autoreview is scoped-clean at P0/P1.

Exact-head hosted CI run 33495278268, attempt 2, passed, including openclaw/ci-gate. Attempt 1 failed the unrelated Active Memory fixture during Gateway startup with AUTH_TOKEN_MISMATCH, before recall/main requests. That shard had passed on the production-identical predecessor; one bounded same-head failed-jobs retry passed without code, timeout, authentication, or assertion changes. Named follow-up: investigate intermittent Active Memory fixture isolation/auth readiness if this recurs; its root cause is not established or claimed fixed here.

The previous head's run 33492809174 failed test-table spread lint, corrected by the test-only follow-up. The branch includes already-landed release-inventory fix #134824; older merge-snapshot runs are historical, not final-head proof. Native review artifacts validated and hosted-evidence preparation completed successfully for this exact head; no rebase or additional push was needed. Ready for the maintainer’s separate merge decision.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: voice-call Channel integration: voice-call size: S maintainer Maintainer-authored PR labels Sep 1, 2026
@steipete
steipete marked this pull request as ready for review September 1, 2026 06:29
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 1, 2026
@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 6:09 AM ET / 10:09 UTC.

ClawSweeper review

What this changes

The PR maps aborted host-tool work to the existing cancelled Voice Call result and returns a final result for synchronous general-tool exceptions.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No introduced correctness or security defect was found. This protected maintainer PR remains open for its exact-head checks and normal maintainer merge decision.

Priority: P2
Reviewed head: a017d117da898a6fa3387016c635ab2b21347cd7

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused patch has strong boundary coverage and no actionable review finding; exact-head CI remains the outstanding merge gate.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: Repository state identifies a member-maintained branch, exempting it from the external-contributor proof gate; its supplied loopback evidence still exercises the changed Voice Call handler boundary.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Repository state identifies a member-maintained branch, exempting it from the external-contributor proof gate; its supplied loopback evidence still exercises the changed Voice Call handler boundary.
Evidence reviewed 5 items Shared outcome projection: The new server-side helper maps canonical abort errors to the established cancelled provider payload and redacts all other errors.
Handler coverage: Forced, native, and general tool paths now invoke the same projector while retaining their existing active-owner cancellation checks.
Production caller: The Voice Call runtime registers the consult handler and passes its lifecycle abort signal into agent work, establishing the repaired owner boundary.
Findings None None.
Security None None.

How this fits together

Realtime Voice Call sends provider-requested tools to a host handler, then returns the outcome through the active phone-call bridge. The Talk runtime owns the shared cancellation/error projection used by that bridge.

flowchart LR
  A[Phone caller] --> B[Realtime voice bridge]
  B --> C[Host tool handler]
  C --> D[Talk outcome projection]
  D --> E[Provider tool result]
  E --> F[Active phone call]
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head hosted checks were still in progress in the supplied PR state, so the PR is not yet merge-ready.
  • Complete next step (P2) - This protected maintainer PR already owns the repair; only normal exact-head CI and merge handling remain.
Agent review details

Security

None.

PR surface

Source 0, Tests +203, Docs +4, Other 0. Total +207 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 3 42 42 0
Tests 3 227 24 +203
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 8 274 67 +207

Review metrics

Metric Value Why it matters
Production and test delta production net 0; tests net +203; docs +4 The repair reshapes existing runtime handling while adding focused outcome and failure-normalization coverage.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #134883
Summary: This PR is the candidate fix for the linked Voice Call host-cancellation bug.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep one server-side projector for host-tool rejection outcomes, then merge after exact-head checks are green.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep one server-side projector for host-tool rejection outcomes, then merge after exact-head checks are green.

Do we have a high-confidence way to reproduce the issue?

Yes: the supplied loopback WebSocket matrix reaches the real handler’s pre-fix rejection paths; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes: normalizing synchronous and asynchronous host-tool failures at the shared Talk projection boundary avoids duplicated cancellation classification while preserving ordinary errors.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 02a509a3277f.

Labels

Label justifications:

  • P2: This is a bounded Voice Call outcome-projection repair without evidence of data loss, authorization bypass, or outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Repository state identifies a member-maintained branch, exempting it from the external-contributor proof gate; its supplied loopback evidence still exercises the changed Voice Call handler boundary.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Wait for the attached exact-head checks to complete before merging.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-01T06:36:01.956Z sha 9e18ac1 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-01T06:46:33.526Z sha 9e18ac1 :: found issues before merge. :: [P1] Gate cancellation on the owning abort signal
  • reviewed 2026-09-01T06:57:00.489Z sha 9e18ac1 :: found issues before merge. :: [P1] Gate cancellation on the matching owner
  • reviewed 2026-09-01T09:38:46.965Z sha a39bf40 :: needs maintainer review before merge. :: none

@steipete
steipete marked this pull request as draft September 1, 2026 06:39
@steipete
steipete marked this pull request as ready for review September 1, 2026 06:40
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 1, 2026
@steipete

steipete commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Proof checkpoint for a017d117da898a6fa3387016c635ab2b21347cd7 (merge base 437ef6160e160b2985ac9ffc15f47f6422ad662f). Local and exact-head CI gates are green: the full eight-file changed gate passed, and CI run 33495278268, attempt 2 completed successfully, including openclaw/ci-gate. Native review artifacts validated and hosted-evidence preparation completed successfully without changing the head. Ready for the maintainer’s separate merge decision; no merge has been performed.

The full candidate now includes the already-landed release-inventory repair #134824 in its base. Old runs 33477834463 and 33478592206 failed the older merge snapshot's release inventory; the latter's Doctor gate passed. Those runs are historical evidence, not this head's CI.

Behavior and proof

The server-side Talk projector handles independent host cancellation across forced join, native consult, and general tools. The browser-shared module is unchanged. Explicit try/await/catch at the general invocation also catches synchronous throws without changing forced/native scheduling. A typed error predicate removes two casts; its assertion baseline shrinks from 3 to 1.

  • Original reproduction: 9 cancellation failures / 15 controls; standalone forced-consult diagnostics separately reproduced 3 false failure cases.
  • New synchronous reproduction in the same real handler/loopback WebSocket fixture: 5 absent terminal results before repair, with 8 asynchronous/fulfilled controls passing.
  • 201 tests passed across the eight focused files, including the 29-case host-outcome matrix and real provider normalizers. After the typing-only follow-through and frozen dependency repair, both phone files passed again: 93 tests.
  • The unchanged real-runtime import timed out on the first broad attempt; the identical command passed on retry without weaker assertions or longer limits. Missing local Slack SDK declaration files were restored by the pinned frozen install; no Slack source or lockfile changed.
  • Fresh isolated Codex autoreview of the full final candidate: no accepted/actionable P0/P1 findings; final source integrity verified. Production +42/-42 (net zero), tests +227/-24, docs +4/-0; baseline allowance reduced.

Latest ClawSweeper P1 and Rank-up moves

The latest ClawSweeper review at 10:09 UTC (updated 10:10:34) covers this exact head and reports no actionable correctness/security findings. The earlier provider-abort P1 was withdrawn after normalization evidence. Its Before merge/Rank-up request for exact-head green checks is now satisfied; the normal maintainer decision remains. I personally checked native main baseline de64e91; the relevant runtime owners are unchanged from the task merge base, covering the earlier review's current-main inspection gap. The provider-disconnect controls are implemented and pass. They exercise real provider error projection through assistant failover into the voice projector: provider AbortError, TimeoutError, and ordinary connection failure stay error results with the caller active. The new failover controls retain the raw failure message.

The cited compaction owner retries raw provider aborts while its caller stays active, then throws CompactionError on exhaustion. The exhaustion control proves three attempts and a non-abort terminal error. Provider adapters and their lazy registry likewise normalize transport errors before the host consult boundary.

The suggested phone-signal gate is intentionally not applied: the phone lifetime does not own independent host-run cancellation, so requiring it to abort reinstates #134883. The fixture explicitly keeps the phone open and its signal un-aborted. The cited provider paths do not establish the claimed raw-error bypass; arbitrary third-party code is not claimed covered. The latest review confirms this disposition.

No live phone/provider/Discord calls, credential hydration, production state copies, or service operations occurred. Carrier/provider edges are synthetic. Native Talk #134003 / #133844 and Discord work remain separate and untouched; only #134883 is linked for closure.

The prior head’s full CI run 33492809174 failed only check-lint because the test matrix spread rows inside flatMap. The test-only follow-up returns one or two rows explicitly. Guarded focused lint and all 29 matrix cases pass; production is unchanged. The final full changed gate passed (lint, four type lanes, dead exports, architecture/owner guards).

Final-head CI attempt 1 failed checks-node-compact-small-34 during unrelated Active Memory fixture Gateway authentication (AUTH_TOKEN_MISMATCH), before any recall/main request. The same shard passed on the production-identical predecessor and on one bounded same-head retry. Attempt 2 and openclaw/ci-gate are green. No auth behavior, timeout, assertions, or source was changed to obtain that pass. Named follow-up: investigate intermittent fixture isolation/auth readiness if it recurs; root cause remains unknown. The failure log and retry evidence are retained in the task's local readiness artifacts.

Catch invocation at the general host tool boundary so synchronous cancellation and ordinary failures settle through the same provider result projector as rejected promises. Keep the phone owner active and preserve native/forced scheduling.

Reuse the existing outcome fixture for five synchronous controls, narrow completion diagnostics without casts, and shrink the assertion baseline from three to one. Before repair, all five new cases lacked a terminal result; existing asynchronous controls passed.
@steipete
steipete force-pushed the fix/voice-call-host-cancellation-20260831 branch from 9e18ac1 to a39bf40 Compare September 1, 2026 09:32
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: M and removed size: S labels Sep 1, 2026
@steipete steipete self-assigned this Sep 1, 2026
@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 1, 2026
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Sep 1, 2026
Keep each outcome fixture intact and return the asynchronous row or the asynchronous/synchronous pair explicitly. This satisfies no-map-spread without changing the 29-case matrix or production behavior.
@steipete
steipete merged commit a1c5169 into main Sep 1, 2026
492 of 496 checks passed
@steipete
steipete deleted the fix/voice-call-host-cancellation-20260831 branch September 1, 2026 10:41
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 1, 2026
…35380)

* fix(discord): stop error replies after voice consult cancellation

Treat host-cancelled Discord realtime consults as terminal cancellation, preserve late-call dedupe, and wait for every native delivery before returning forced playback ownership. Timeouts and genuine errors retain their normal handling.

Closes #135340. Related phone cancellation helper: #134924.

* test(acp): run CLI lifecycle checks against prepared runtime

* test(cli): cover selective runtime build admission

* test(ci): account for ACP runtime preparation
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 2, 2026
…enclaw#134924)

* fix(voice-call): report host tool cancellation without failing the call

* fix(talk): keep host error projection in the server runtime

* test(voice-call): verify provider failures stay errors

* fix(voice-call): settle synchronous host tool failures

Catch invocation at the general host tool boundary so synchronous cancellation and ordinary failures settle through the same provider result projector as rejected promises. Keep the phone owner active and preserve native/forced scheduling.

Reuse the existing outcome fixture for five synchronous controls, narrow completion diagnostics without casts, and shrink the assertion baseline from three to one. Before repair, all five new cases lacked a terminal result; existing asynchronous controls passed.

* test(voice-call): build outcome rows without spread

Keep each outcome fixture intact and return the asynchronous row or the asynchronous/synchronous pair explicitly. This satisfies no-map-spread without changing the 29-case matrix or production behavior.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 2, 2026
…enclaw#135380)

* fix(discord): stop error replies after voice consult cancellation

Treat host-cancelled Discord realtime consults as terminal cancellation, preserve late-call dedupe, and wait for every native delivery before returning forced playback ownership. Timeouts and genuine errors retain their normal handling.

Closes openclaw#135340. Related phone cancellation helper: openclaw#134924.

* test(acp): run CLI lifecycle checks against prepared runtime

* test(cli): cover selective runtime build admission

* test(ci): account for ACP runtime preparation
RomneyDa pushed a commit that referenced this pull request Sep 18, 2026
…35380)

* fix(discord): stop error replies after voice consult cancellation

Treat host-cancelled Discord realtime consults as terminal cancellation, preserve late-call dedupe, and wait for every native delivery before returning forced playback ownership. Timeouts and genuine errors retain their normal handling.

Closes #135340. Related phone cancellation helper: #134924.

* test(acp): run CLI lifecycle checks against prepared runtime

* test(cli): cover selective runtime build admission

* test(ci): account for ACP runtime preparation
RomneyDa added a commit that referenced this pull request Sep 19, 2026
* feat(meta): add Muse Spark 1.3 models (#136553)

* feat(meta): add Muse Spark 1.3 models

* docs(meta): cite Muse Spark 1.3 recommendation

Co-authored-by: Tharun Tej Tammineni <[email protected]>

---------

Co-authored-by: Dallin Romney <[email protected]>
(cherry picked from commit 194b7f2)

* feat(anthropic): support Fable 5.1 from shared model metadata (#135638)

* feat(anthropic): support Fable 5.1 from shared model metadata

* test(anthropic): keep alias coverage within the file limit

* fix(media): decouple image limits from catalog augmentation

(cherry picked from commit 0a9b08c)

* feat(openai): support GPT Image 2.5 variants (#143068)

* feat(openai): support GPT Image 2.5 variants

* docs(openai): correct GPT Image 2.5 section link

(cherry picked from commit f93881f)

* feat(fal): support GPT Image 2.5 variants (#143069)

* feat(fal): support GPT Image 2.5 variants

* test(agents): restore Windows media fixture isolation

(cherry picked from commit a57c799)

* fix(bedrock): preserve images returned by tools (#149336)

## What Problem This Solves
Tool-returned images make the next request fail with `ValidationException` on affected Bedrock routes. Fixes #149332.

## Why This Change Was Made
The serializer generates image labels from each tool-call ID; input images need no labels. All consecutive tool results come first, followed by image groups in the same tool order. Request state has one writer. `stream.runtime.ts`: +28/−1 for this conversion.

Growth accepted under the owner's standing acceptance (2026-09-15).

## User Impact
Image-reading turns can finish without losing image bytes, tool associations, or error status.

## Evidence
Authenticated `chat.send` → registered `read` on a synthetic PNG: main sent a nested image and failed; candidate sent a sibling image and completed with the scripted “Red square; blue circle.” Our run used a recording HTTP transport.

The [contributor's real two-tool run](#149336 (comment)) confirms image interpretation and association.

## Compatibility
Concrete route identities select the conversion. Opaque aliases keep their layout. The general schema permits nested images for some routes; this repair addresses the affected route’s observed rejection. No config or public interface changes.

## Consumers
All clients use the existing Bedrock serializer.

## Invalidation
Conversion is request-local. Stored transcript rows and original image bytes remain unchanged.

## Tests
`node scripts/run-vitest.mjs run --config test/vitest/vitest.extension-providers.config.ts extensions/amazon-bedrock`: 289 tests across 12 files passed on a fresh merge with main. Types, lint, formatting, file-size and assertion limits, and unused-export checks passed.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 115522a)

* fix: preserve Ultra across model runtime boundaries (#135397)

* fix: preserve Ultra across model runtime boundaries

Keep native Codex Ultra as a runtime mode instead of clamping it against
physical Responses effort tiers. Share the selected collaboration effort
between turn fields and remove the redundant forwarding wrapper.

Carry the active parent thinking level through existing spawn context so
one-shot overrides reach native subagents without changing saved preferences.
Keep explicit child overrides and configured child defaults authoritative.

Scope Control UI thinking catalog fallback to the selected runtime, sharing
one prepared entry for picker options and the inherited default. Document
the native orchestration/budget boundary and active-turn inheritance.

* refactor: simplify Ultra reasoning fixtures

* fix: preserve active thinking across shared tool contexts

* docs: clarify Off thinking for side questions

(cherry picked from commit ee9e22b)

* fix(anthropic): Fable 5.1 sessions lose reasoning after model switches and runtime events (#136782)

* fix(anthropic): keep Fable 5.1 thinking valid across model switches and runtime context

Claude Fable 5.1 binds each thinking block to the producing model and to the
exact request prefix that preceded it. Three harness behaviors conflicted with
that contract on Anthropic-family routes:

- Moving a session onto Fable 5.1 (from Opus 5, Sonnet 5, Opus 4.8, Fable 5)
  dropped readable reasoning client-side; the replay contract now preserves it
  while leaving Fable 5.1 still drops.
- The per-turn runtime-context carrier was injected transiently after the
  active user turn, stripped on the next request, relocated inside tool loops,
  and removed by the context-engine assembly. It is now persisted right after
  its user turn and replayed in place; inline inbound metadata stays in place
  too, and consecutive user turns are no longer merged at load for the
  Messages API because the merged form lost the second turn's timestamp stamp.
- Direct API-key requests with adaptive thinking send the
  thinking-binding-controls beta with prefix_mismatch_behavior=drop_block, so
  a residual mismatch degrades to a server-side unbilled drop with a warning
  listing the dropped paths instead of a 400, a duplicate request, and a
  transcript-wide thinking wipe. OAuth, proxies, Bedrock, Vertex, and Foundry
  keep the existing strip-and-retry recovery.

Live-verified against api.anthropic.com: nine-request Fable/Opus/Fable session
with tool loops and carriers reports input_transformations: [] on every
request with four retained thinking blocks; a /think change on the direct API
yields a logged server-side drop and no retry.

* fix(anthropic): limit the preserved-thinking replay target to Fable 5.1

Mythos 5.1 is not registered in the bundled catalog and has no cross-model
replay proof, so unregistered Mythos targets keep the existing drop path.

(cherry picked from commit 30837ae)

* feat(openai): support GPT-6 Astra (#137550)

* feat(openai): support GPT-6 Astra

* fix(models): preserve declared pricing tiers during catalog refresh

(cherry picked from commit eb72093)

* fix(openai): require discovery before offering Astra for OAuth (#137561)

(cherry picked from commit 8b1add5)

* fix(diagnostics-prometheus): reject unauthorized metric scrapes (#140903)

* fix(diagnostics-prometheus): require operator.read for metric scrapes

The Prometheus scrape route registers under the trusted-operator runtime
scope surface, so the Gateway authenticates the caller and applies its
named-role scope ceiling before dispatch. The handler never consulted
those scopes, so an authenticated identity whose role grants no operator
scopes still received the full diagnostics document with 200, while the
same caller was correctly refused on equivalent read operations.

Check the runtime request scopes inside the handler and fail closed with
403 "missing scope: operator.read" unless the caller holds operator.read,
operator.write, or operator.admin, mirroring the Gateway read implication
set. The guard runs before rendering so HEAD probes cannot disclose the
document size either.

* test(diagnostics-prometheus): prove role-limited scrape denial

(cherry picked from commit 0c9330b)

* fix(discord): enforce sender media policy on guild asset uploads (#140334)

The Discord emoji-upload, sticker-upload, and event-create branches dropped
the sender-scoped media access options before dispatching the action, so the
guild runtime loaded the requested host-local path with only a byte limit. A
sender permitted to run those actions could therefore place bytes from a file
outside their allowed media roots into an outbound Discord emoji, sticker, or
event-cover request.

Forward the resolved action options from all three branches, carry
mediaAccess/mediaLocalRoots/mediaReadFile through the guild runtime, and load
upload sources through buildOutboundMediaLoadOptions like every other outbound
Discord media path. Adds regression coverage that a source outside the sender
roots is rejected before any request is issued, with an in-roots control.

(cherry picked from commit e5e7764)

* fix(discord): preserve realtime speaker and playback ownership (#137433)

* fix(discord): preserve realtime speaker and playback ownership

Bind provider connections to one Discord principal so delayed transcripts
and native consultations cannot inherit another speaker's authority.
Keep the shared agent route and serialize response-owned audio on one
room player, preserving continuations and recovery after playback gaps.

Admit host-requested responses before dispatch and map Google Live turn
completion to canonical terminal outcomes so queued speech can finish.

Closes #137349
Related: #136982, #123243
Follow-up: #137417

* test(discord): preserve room capture across speaker recovery

(cherry picked from commit 85d510c)

* fix(doctor): preserve enabled skills during automatic updates (#138730)

Use runtime-repair approval for optional skill disabling. Keep standalone explicit repair and required config migrations unchanged.

(cherry picked from commit acc9a65)

* fix: generated images disappear after failed tool calls (#131226)

## What Problem This Solves

WebChat drops generated media when a later tool failure is the turn's only reply payload.

## Root cause

The embedded-run terminal projection assigned successful tool media to the first non-reasoning payload. A later error warning could become that owner. Gateway error projection then discarded the attached media.

## Fix

- Attach tool media only to a successful, non-reasoning reply.
- Emit a separate media-only payload when the turn has no successful reply.
- Preserve the newer host-owned and automatic-delivery media paths from current `main`.
- Keep regression coverage at the payload owner and physical-delivery boundaries.
- Remove the mocked browser test that manually inserted its expected result.

## Evidence

- Baseline: current `main` at `8544aed05a5dbffb871483be781f71351203319e`.
- Real path: branch-built Control UI → real Gateway → mock OpenAI Responses provider → successful image tool → later failing tool → terminal WebChat event.
- Red: current `main` rendered zero generated images.
- Green: `d2a10d40c633bfe796ad4ab19222aa831184a327` rendered one generated image.
- Anti-cheat: the proof recorded `image-success` before `later-failure` and verified that Chromium loaded the exact Gateway-served asset from the branch build.

## Validation

- Focused unit and integration tests: 19 passed across 2 Vitest shards.
- Real Gateway and built Control UI proof: passed on current `main` and the candidate head with opposite image assertions.
- Targeted format, Oxlint, conflict-marker, max-lines, assertion-safety, and diff checks passed.
- Type checks run in continuous integration because repository policy forbids them on this host.

Production change: `+3/-3`, net zero. Test change: `+23/-1`, net `+22`.

Co-authored-by: A28Hui <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 88be1b8)

* fix(matrix): refresh verification status before reporting device trust (#136226)

* fix(matrix): refresh verification status before reporting device trust

Refresh own-device keys after crypto preparation and before the authoritative trust read. Keep the missing-device preflight and use the Matrix SDK’s existing query contract.

* test(slack): remove core-coupled threading duplicate

---------

Co-authored-by: Dallin Romney <[email protected]>
(cherry picked from commit a812054)

* chore(release): prepare extended-stable 2026.8.33

* fix(release): integrate model and Discord security backports

* docs(release): clarify extended-stable workflow baseline

* fix(release): complete stable-line backport integration

* fix(ios): restore dependency resolution with WebRTC 152 (#134942)

* fix(release): repair frozen validation inputs

* fix(discord): stop error replies after voice consult cancellation (#135380)

* fix(discord): stop error replies after voice consult cancellation

Treat host-cancelled Discord realtime consults as terminal cancellation, preserve late-call dedupe, and wait for every native delivery before returning forced playback ownership. Timeouts and genuine errors retain their normal handling.

Closes #135340. Related phone cancellation helper: #134924.

* test(acp): run CLI lifecycle checks against prepared runtime

* test(cli): cover selective runtime build admission

* test(ci): account for ACP runtime preparation

* fix(release): complete Discord cancellation backport

* test(release): keep candidate fixtures current

* test(update): isolate frozen release version

---------

Co-authored-by: tharuntejmeta <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: dclosefuturex <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: Pavan Kumar Gondhi <[email protected]>
Co-authored-by: Jason (Json) <[email protected]>
Co-authored-by: CGlashu <[email protected]>
Co-authored-by: A28Hui <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: voice-call Channel integration: voice-call docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Realtime phone calls report host tool cancellation as failure

1 participant