Skip to content

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

Merged
fuller-stack-dev merged 1 commit into
openclaw:mainfrom
fuller-stack-dev:fix/doctor-update-skill-preferences-r3
Sep 5, 2026
Merged

fuller-stack-dev merged 1 commit into
openclaw:mainfrom
fuller-stack-dev:fix/doctor-update-skill-preferences-r3

Conversation

@fuller-stack-dev

Copy link
Copy Markdown
Member

Related: #124396

Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers can help update the branch when needed.

What Problem This Solves

Fixes an issue where users running an automatic update would have an explicitly enabled skill persistently disabled when an optional binary was missing in the update environment.

This is a separate two-file Doctor approval-policy repair. It does not include the migration-planner feature in #136529.

Why This Change Was Made

Use Doctor's existing runtime-repair approval for optional skill disabling. That approval preserves preferences during noninteractive updates while allowing explicit standalone repair. Keep updater --fix, required migrations, skill discovery and the healthy-other-agent guard unchanged.

Production +2/-1, net +1 for the caller-invariant comment. Tests +57/-7. No new configuration, environment option, schema, dependency or storage owner.

User Impact

Automatic updates retain enabled skills even when the current environment cannot use them. Explicit standalone Doctor repair can still disable unavailable skills. Required configuration migrations still run and persist independently.

Evidence

The disposable source/caller fixture exercises actual skill discovery, update policy, Doctor approval and the real config writer. Its approved scope is not full CLI, packaged, service or containment proof.

Unmodified canonical 66fa0bd2be4f811a6c6dbee8bd5dd102dae8e544 reproduced the unwanted persisted disable. Standalone repair, an available skill and a required legacy migration supplied the controls. The regression also failed before the fix. The healthy-other-agent test verifies actual availability on another agent, rather than an empty candidate set.

Final local candidate 1d9c71210c293d8fab30dae576de2775f2b2865c, tree 860e399fc966ef8825dad554962a8a907052c658, descends directly from fetched canonical 51202a46f7b2d1a501b2194c63b0ca1bb915b339. The nineteen-commit range was inspected. Doctor approval/callers, migration writer and dependency inputs are unchanged. The shared SQLite coordinator changed, so the real-writer proof was refreshed on this final tree. No source repair or proof-contract change was needed.

One independent source-blind invocation passed all five clauses. All four children exited 0 with no signal or error. The parent rehashed all 28 manifest artifacts and their retained original files, checked individual versus aggregate process receipts, and reopened each final config. No mismatch.

Case Config writes Persisted result
Automatic update, missing optional binary 0 Skill stays enabled; exact bytes preserved
Explicit standalone repair, missing binary 1 final write Skill becomes disabled
Automatic update, available binary 0 Skill stays enabled; exact bytes preserved
Automatic update, required legacy migration 1 initial write Retired field becomes mode=off; optional skill stays enabled

Source-blind report SHA-256: 3c2e1aa566c8d266465823ffc61cc48dc4bb0a8c28f43fbaaee311bc42e41aaf. Evidence manifest SHA-256: 60b13c1f05c261a8e2028ec998009e54dc369a56518091ac0803ae283f906fb5. Native handle 76407, Darwin, Node 24.20.0. This does not attribute unrelated historical config changes.

Retained focused proof: 92 tests passed on the prior integrated candidate across Doctor skills/prompter, required legacy skill-config migration, skill-path containment and config paths. Those tested files and their approval/discovery inputs remain unchanged.

node scripts/run-vitest.mjs src/commands/doctor-skills.test.ts src/commands/doctor-prompter.test.ts src/commands/doctor/shared/legacy-config-migrations.runtime.skills.test.ts src/skills/loading/skill-path-containment.test.ts src/config/paths.test.ts

The final selected native changed gate passed on this exact local candidate, native handle 81994 exit 0. Core/core-test types, all three dead-export scans, lint and all selected guards passed without skips. Log SHA-256: d74a5460a6e5a521442a99b3627ead43b5297db2b1374335f783d2b2e1768c1d.

node scripts/check-changed.mjs --base 51202a46f7b2d1a501b2194c63b0ca1bb915b339 -- src/commands/doctor-skills.ts src/commands/doctor-skills.test.ts

Max-P2 Autoreview was scoped-clean at 59e1a197. The patch and all eight reviewed approval/caller/writer context files are byte-identical on this candidate; that review is retained, not relabeled as a new invocation. Relevant integration behavior was revalidated by the independent caller/writer run.

The native production dependency audit completed exit 0 with no matching high-or-higher advisories from npm bulk. Its dependency, lockfile, policy and audit implementation inputs are unchanged. It does not check upstream repository advisories. Exact published-head security and required CI remain separate gates.

Native GraphQL publication produced 78b484ae609982e34c3ff342e68e1b344bd02fd7. GitHub reports its signature verified with reason valid; its sole parent is the pinned canonical base. The full tree and both file modes/blob IDs exactly match the tested local candidate. This signature-only publication does not relabel the local proof as a run on the returned commit SHA.

No remote runtime, packaged, video, native-service or final-head hosted-CI result is claimed by this local evidence.

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

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: S maintainer Maintainer-authored PR labels Sep 5, 2026
@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review September 5, 2026 00:33
@fuller-stack-dev fuller-stack-dev self-assigned this Sep 5, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 8:47 PM ET / September 5, 2026, 00:47 UTC.

ClawSweeper review

What this changes

Doctor now preserves skill enablement during automatic updates while retaining the ability to disable unavailable skills during explicit standalone repair.

Merge readiness

✅ Ready for maintainer review

Still necessary on the inspected main revision. The patch corrects the approval boundary without changing migration behavior, and no blocking correctness or security findings were identified.

Priority: P2
Reviewed head: 78b484ae609982e34c3ff342e68e1b344bd02fd7

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary correction with useful regression coverage and recorded real-writer controls, without identified blocking defects.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The supplied Darwin caller/writer results exercise actual skill discovery and Doctor approval through real config persistence, showing unchanged bytes during updates, retained standalone disabling, and an independent required-migration write. The checkout tree matches the reported tested tree; coverage is the stated caller boundary, not packaged CLI or service behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The supplied Darwin caller/writer results exercise actual skill discovery and Doctor approval through real config persistence, showing unchanged bytes during updates, retained standalone disabling, and an independent required-migration write. The checkout tree matches the reported tested tree; coverage is the stated caller boundary, not packaged CLI or service behavior.
Evidence reviewed 12 items Verified patch ownership: The checkout is the pinned original head. Raw commit records confirm its single recorded parent and the test merge’s ordered base/head parents. Comparing the verified test merge with its base shows the same skill-approval correction; unrelated Codex changes are base-branch work.
Current-main defect remains: The inspected main revision still uses confirmAutoFix for optional skill disabling. That approval accepts repair mode without the existing update-specific restriction, allowing temporary missing requirements to become persistent enabled=false settings.
Release comparison: The supplied latest release, v2026.9.1, also contains the confirmAutoFix call at this boundary. No released implementation of this correction was identified; this was source inspection, not a release-runtime reproduction.
Findings None None.
Security None None.

How this fits together

Doctor checks installed skills against each agent’s configuration and available requirements. Its repair policy determines whether those observations may change saved preferences before the shared configuration writer runs.

flowchart TD
  A[Update or standalone Doctor] --> B[Skill readiness across agents]
  B --> C[Existing repair policy]
  C -->|Automatic update| D[Keep skill preferences]
  C -->|Approved standalone repair| E[Disable unavailable skills]
  D --> F[Config write decision]
  E --> F
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +1, Tests +50. Total +51 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 2 1 +1
Tests 1 57 7 +50
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 59 8 +51

Review metrics

Metric Value Why it matters
Production versus test growth Executable production LOC neutral; one invariant-comment line added; tests net +50 The fix reuses an existing policy instead of adding runtime branches; production growth is explanatory only.
Repair-policy surface 1 approval call changed; 0 new options, environment variables, or schemas The existing update restriction now covers optional skill disabling while standalone repair and migration controls remain unchanged.

Technical review

Best possible solution:

Keep the correction at the skill-repair approval call; neither a new option nor removing updater --fix is needed.

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

Yes, from current source: updater-driven noninteractive repair reaches generic auto-approval and persists enabled=false for an unavailable skill. The supplied before/after fixture supports this mechanism, but this review did not execute it.

Is this the best way to solve the issue?

Yes. Reusing the existing runtime-repair policy fixes the incorrect approval classification; changing the writer or removing updater repair mode would also interfere with required migrations.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 333e43cd52e3.

Labels

Label changes:

  • add P2: Repairs a bounded update bug that can persistently disable optional skills when the updater’s environment lacks their requirements.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The supplied Darwin caller/writer results exercise actual skill discovery and Doctor approval through real config persistence, showing unchanged bytes during updates, retained standalone disabling, and an independent required-migration write. The checkout tree matches the reported tested tree; coverage is the stated caller boundary, not packaged CLI or service behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The supplied Darwin caller/writer results exercise actual skill discovery and Doctor approval through real config persistence, showing unchanged bytes during updates, retained standalone disabling, and an independent required-migration write. The checkout tree matches the reported tested tree; coverage is the stated caller boundary, not packaged CLI or service behavior.

Label justifications:

  • P2: Repairs a bounded update bug that can persistently disable optional skills when the updater’s environment lacks their requirements.
  • 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. Sufficient (live_output): The supplied Darwin caller/writer results exercise actual skill discovery and Doctor approval through real config persistence, showing unchanged bytes during updates, retained standalone disabling, and an independent required-migration write. The checkout tree matches the reported tested tree; coverage is the stated caller boundary, not packaged CLI or service behavior.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied Darwin caller/writer results exercise actual skill discovery and Doctor approval through real config persistence, showing unchanged bytes during updates, retained standalone disabling, and an independent required-migration write. The checkout tree matches the reported tested tree; coverage is the stated caller boundary, not packaged CLI or service behavior.

Evidence

What I checked:

  • Verified patch ownership: The checkout is the pinned original head. Raw commit records confirm its single recorded parent and the test merge’s ordered base/head parents. Comparing the verified test merge with its base shows the same skill-approval correction; unrelated Codex changes are base-branch work. (src/commands/doctor-skills.ts:151, 78b484ae6099)
  • Current-main defect remains: The inspected main revision still uses confirmAutoFix for optional skill disabling. That approval accepts repair mode without the existing update-specific restriction, allowing temporary missing requirements to become persistent enabled=false settings. (src/commands/doctor-skills.ts:150, 333e43cd52e3)
  • Release comparison: The supplied latest release, v2026.9.1, also contains the confirmAutoFix call at this boundary. No released implementation of this correction was identified; this was source inspection, not a release-runtime reproduction. (src/commands/doctor-skills.ts:150, ad6fe23aecb9)
  • Real updater entrypoint: Fresh pre-plugin and post-plugin Doctor invocations pass --repair and --non-interactive and obtain OPENCLAW_UPDATE_IN_PROGRESS=1 from buildUpdateDoctorEnv. The package-install verification path similarly invokes noninteractive Doctor with the update policy. (src/cli/update-cli/update-command-fresh-doctor.ts:118, 78b484ae6099)
  • Existing canonical approval policy: confirmRuntimeRepair uses shouldAutoApproveDoctorFix with blockDuringUpdate=true. Noninteractive update runs therefore decline this optional repair; standalone repair remains accepted. Existing memory and workspace repair callers already use this policy. The relevant policy files are unchanged between the inspected main and this head. (src/commands/doctor-prompter.ts:75, 78b484ae6099)
  • Persistence and migration separation: runSkillsHealth assigns the returned configuration to the Doctor context. The shared writer commits pending required migrations or actual configuration changes, while runInitialConfigWriteHealth commits required config migrations before later diagnostics. Returning the unchanged configuration prevents this skill repair from producing a final write without suppressing required migrations. (src/flows/doctor-health-contribution-runners.config.ts:58, 78b484ae6099)

Likely related people:

  • Peter Steinberger: 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)

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.

@fuller-stack-dev
fuller-stack-dev merged commit acc9a65 into openclaw:main Sep 5, 2026
280 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@fuller-stack-dev
fuller-stack-dev deleted the fix/doctor-update-skill-preferences-r3 branch September 5, 2026 00:53
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
…aw#138730)

Use runtime-repair approval for optional skill disabling. Keep standalone explicit repair and required config migrations unchanged.
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

commands Command implementations maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

1 participant