Skip to content

fix(cli): prevent node/device RPCs from corrupting shared state - #123674

Merged
Patrick-Erichsen merged 8 commits into
openclaw:mainfrom
VACInc:fix/state-db-writer-ownership
Aug 17, 2026
Merged

Patrick-Erichsen merged 8 commits into
openclaw:mainfrom
VACInc:fix/state-db-writer-ownership

Conversation

@VACInc

@VACInc VACInc commented Aug 14, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

One-shot node/device CLI processes could open the live Gateway shared-state database during startup and authentication, creating a competing SQLite WAL/checkpoint lifecycle that could corrupt canonical state. These commands should validate core config and delegate mutation to the Gateway without changing local shared-state artifacts.

Evidence

The checked-in real CLI/WebSocket regression reproduces the node pairing path with an existing identity and origin token, completes node.pair.list and node.pair.approve, and proves the canonical directory and logical SQLite contents remain unchanged. At exact head, that process suite passes 6/6; focused Gateway, identity/auth, and config-guard suites pass 245/245; changed-surface Blacksmith proof passed in run 31923968879.

Summary

High Level TLDR

A live Gateway and a one-shot node/device CLI process could both open the canonical SQLite state database as writable owners. This caused actual production database corruption, not only lock contention: the Gateway failed with database disk image is malformed after the CLI opened its own WAL/checkpointing connection.

This change keeps built-in node/device Gateway RPC commands off that writable lifecycle. The CLI still rejects invalid core config, but it does so without config-health writes, plugin-state reads, state migration, identity creation, auth-schema creation, or writable token reads.

Related to #101290 and #117262. This also protects mutating node/device RPC commands that the currently open #119585 does not cover.

Root Cause

The command startup policy coupled two independent decisions:

  1. whether a command must validate config;
  2. whether startup may observe or migrate canonical shared state.

Built-in node/device commands dispatch their operation to the Gateway, including pairing mutations such as approve, reject, remove, and rename. Their separate CLI process nevertheless ran the normal config guard first. That guard could record config health and run state migrations, opening state/openclaw.sqlite read-write and creating another WAL/checkpoint lifecycle while the Gateway already owned the database.

Remote authentication added two more writable entry points: automatic device-identity creation and stored-token reads that opened the normal writable database and lazily created the origin-token schema.

In the observed production incident, this second writable CLI owner caused shared-state corruption. The corrupt image contained committed B-tree references to zero-filled pages added after the last clean snapshot, and subsequent Gateway audit writes failed with database disk image is malformed.

An isolated reproduction on stock main showed one failed nodes approve invocation creating:

state/state/openclaw.sqlite      4096 bytes
state/state/openclaw.sqlite-shm  32768 bytes
state/state/openclaw.sqlite-wal  1664512 bytes

What changed

  • Add a validate config-guard policy distinct from run and skip.
  • Validate core config with observe: false and skipPluginValidation: true.
  • Suppress startup state migrations in validation-only mode.
  • Apply that mode to all devices commands and built-in nodes RPC commands not already on a non-observing path.
  • Make node/device CLI transport load existing identity and auth records through read-only, no-create paths.
  • Preserve fail-closed invalid-config behavior so a misspelled remote selector cannot misroute a destructive RPC to localhost.

The Gateway remains the owner of the actual RPC mutation. Intentional loopback-local device-pairing fallback remains an explicit writable path.

Real behavior proof

Before

Run nodes approve from stock origin/main against an unreachable explicit Gateway with an isolated valid config and state directory. The command fails as expected, but creates the SQLite main file, SHM, a 1.6 MB WAL, and a state-ownership coordinator.

After

The same command against this branch creates no canonical state database.

The process regression test starts a real minimal WebSocket Gateway and proves all three outcomes together:

node.pair.list -> node.pair.approve
CLI exit: 0
state/state/openclaw.sqlite: ENOENT

A second process test uses gateway.mode: "remtoe" and proves the safety boundary:

CLI exit: 1
stderr: OpenClaw config is invalid ... gateway.mode
Gateway RPC calls: []
state/state/openclaw.sqlite: ENOENT

Focused tests also prove that remote stored-device authentication uses the read-only identity and exact-origin token loaders, while missing shared state returns no token without creating a database.

Verification

  • pnpm vitest run src/infra/device-auth-store.test.ts src/gateway/call.test.ts src/cli/gateway-backed-exit.process.test.ts src/cli/nodes-cli.coverage.test.ts src/cli/devices-cli.runtime.test.ts src/cli/devices-cli.runtime.timeout.test.ts src/cli/command-bootstrap.test.ts src/cli/command-startup-policy.test.ts src/cli/command-execution-startup.test.ts src/cli/command-path-policy.test.ts
    • 11 files passed, 519 tests passed.
  • pnpm vitest run src/cli/program/config-guard.test.ts src/cli/gateway-backed-exit.process.test.ts src/cli/nodes-cli.coverage.test.ts src/cli/devices-cli.runtime.test.ts src/cli/devices-cli.runtime.timeout.test.ts src/cli/command-bootstrap.test.ts src/cli/command-startup-policy.test.ts src/cli/command-execution-startup.test.ts src/cli/command-path-policy.test.ts
    • 8 files passed, 177 tests passed.
  • node scripts/check-changed.mjs
    • Passed locally after the remote Crabbox backend was unavailable. This covered formatting, production and test typechecking, changed-file lint, dead exports, schema guards, dependency checks, import cycles, and pairing/auth guards.
  • git diff --check
  • Startup benchmark on Node 25.9.0, same host and workload, 3 warmups plus 12 measured samples per tree:
    • stock main: mean 1638.4 ms, median 1633.7 ms, range 1602.1 to 1714.6 ms
    • this branch: mean 1140.6 ms, median 1138.3 ms, range 1080.5 to 1200.5 ms

What was not tested

  • The test suite does not intentionally corrupt a database. It reproduces the second writable-owner path before the fix and proves that path is absent afterward.
  • This is not a universal process-lifetime single-writer lease. Intentional local pairing fallback writes and broader same-process worker ownership remain separate concerns.
  • No production Gateway restart or deployment was performed for this PR.

AI assistance

AI assisted with incident analysis, implementation, test construction, and review. The writable second-owner behavior was independently reproduced, review findings about invalid-config routing, remote authentication, and plugin-state reads were fixed, and the final diff was revalidated before publication.

Maintainer validation

  • Completed the transport-wide read-only repair in 06f5c6378c0: authoritative Gateway-client host dependencies, artifact-free identity loading, and suppression of hello-token store/clear writes.
  • Focused proof passed: 229 Gateway tests, 32 identity/auth tests, and 6 real CLI/WebSocket process tests (267 total). A separate conflict-preservation run passed 226 CLI tests plus the 6 process tests.
  • Changed-surface Blacksmith Testbox proof passed in 10m38s: https://github.com/openclaw/openclaw/actions/runs/31923968879
  • The one-box full pnpm test attempt was stopped by the Testbox lifecycle ceiling after 5,834 seconds while Voice Call was still running. It reported no assertion failure, but is not claimed as a pass.
  • Conflict resolution preserves the current-main doctor --lint source-only config path while retaining the startup-policy object required by this fix.
  • Exact-head structured autoreview: no actionable findings (confidence 0.96). Fresh hosted CI and the native merge gates remain required before landing.

@clawsweeper

clawsweeper Bot commented Aug 14, 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 gateway Gateway runtime cli CLI command changes size: M triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Aug 14, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. labels Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 9:25 AM ET / 13:25 UTC.

ClawSweeper review

What this changes

The PR makes built-in node and device Gateway RPC commands validate configuration and authenticate without creating, migrating, or mutating Gateway-owned shared SQLite state.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open: current main still permits this CLI startup/auth lifecycle, while this branch supplies a focused repair and accepted recovery policy; no blocking patch defect was found.

Priority: P1
Reviewed head: b90a2b863437b1b99bc21f4aac94f9332bd382fd

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A real CLI/WebSocket boundary test and focused owner coverage support a mergeable repair, subject to normal exact-head gates.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The PR body and checked-in process test show an after-fix CLI process completing real WebSocket pairing RPCs while canonical SQLite state remains absent or unchanged.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body and checked-in process test show an after-fix CLI process completing real WebSocket pairing RPCs while canonical SQLite state remains absent or unchanged.
Evidence reviewed 8 items Current-main startup path: Current main still runs the state-migration preflight for ordinary node/device commands and has no validation-only guard mode.
Current-main auth lifecycle: Current Gateway calls create device identity and use writable origin-token loaders; the branch adds a constrained read-only mode for these paths.
Branch owner-boundary repair: The branch makes read-only mode authoritative over identity creation and token load/store/clear host callbacks, preventing caller overrides from restoring writes.
Findings None None.
Security None None.

How this fits together

One-shot node and device CLI commands validate local configuration, then send pairing and device RPCs to the running Gateway. The Gateway remains the owner of canonical SQLite state and the resulting mutations.

flowchart LR
  A[Node or device CLI command] --> B[Startup policy]
  B --> C[Core configuration validation]
  C --> D[Read-only identity and token lookup]
  D --> E[Gateway WebSocket client]
  E --> F[Gateway-owned pairing mutation]
  D -. preserves .-> G[Shared SQLite state]
Loading

Before merge

  • Resolve merge risk (P1) - Read-only one-shots no longer create identity or persist/clear tokens, so a stale or rotated stored token requires explicit authentication or re-pairing; the recorded maintainer disposition accepts this.
  • Resolve merge risk (P1) - An unstable SQLite snapshot can make stored-token lookup fail closed, turning the command into an actionable credential failure rather than allowing a second writer.
  • Resolve merge risk (P1) - The bug fix adds 183 net production lines; the added owner-boundary policy is focused, but exact-head native gates should still verify the full integration.
  • Complete next step (P2) - No repair job is needed: no discrete actionable defect remains; retain this PR for ordinary exact-head merge gating under the accepted recovery policy.
Agent review details

Security

None.

PR surface

Source +183, Tests +532. Total +715 across 28 files.

View PR surface stats
Area Files Added Removed Net
Source 19 242 59 +183
Tests 9 542 10 +532
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 28 784 69 +715

Review metrics

Metric Value Why it matters
Production versus regression coverage production +241/-58; tests and test support +543/-11 The positive production delta implements explicit config, auth, and artifact-preserving state ownership boundaries; regression coverage is concentrated at the CLI/WebSocket boundary.
Startup policy surface 1 validation-only guard mode added; 2 command roots changed Node and device commands now validate core configuration without migration or plugin-state observation, which changes upgrade-sensitive startup behavior.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/cli/command-bootstrap.test.ts, serialized state: src/state/openclaw-state-db-readonly.ts. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Merge-risk options

Maintainer options:

  1. Honor the accepted read-only recovery (recommended)
    Merge after exact-head native gates pass, accepting explicit authentication or re-pairing after token rotation rather than reopening shared SQLite as a second writer.
  2. Pause if recovery policy changes
    Do not merge if maintainers no longer accept explicit recovery for stale tokens; any alternative must retain Gateway-only SQLite writer ownership.

Technical review

Best possible solution:

Keep one explicit read-only lifecycle for these Gateway-dispatched commands, preserve explicit-auth and re-pair recovery, and merge only after the exact head satisfies native gates.

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

Yes—source inspection shows current main can enter migration and writable identity/token paths, and the branch contains a separate-process CLI/WebSocket regression covering the repaired boundary.

Is this the best way to solve the issue?

Yes. The branch fixes the producer paths—startup validation plus transport identity/token callbacks—rather than adding downstream command-specific guards.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 243f51d314d1.

Labels

Label justifications:

  • P1: The patch addresses a live Gateway and one-shot CLI workflow that can affect pairing/device operations and shared-state integrity.
  • merge-risk: 🚨 compatibility: Existing one-shot clients stop persisting or clearing device credentials and may require explicit recovery after token rotation.
  • merge-risk: 🚨 auth-provider: The patch changes identity and origin-scoped token loading, persistence, and stale-token clearing during Gateway authentication.
  • merge-risk: 🚨 availability: A command without usable explicit credentials can fail closed when artifact-preserving state reads cannot supply a stable stored token.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body and checked-in process test show an after-fix CLI process completing real WebSocket pairing RPCs while canonical SQLite state remains absent or unchanged.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body and checked-in process test show an after-fix CLI process completing real WebSocket pairing RPCs while canonical SQLite state remains absent or unchanged.

Evidence

What I checked:

  • Current-main startup path: Current main still runs the state-migration preflight for ordinary node/device commands and has no validation-only guard mode. (src/cli/program/config-guard.ts:237, 243f51d314d1)
  • Current-main auth lifecycle: Current Gateway calls create device identity and use writable origin-token loaders; the branch adds a constrained read-only mode for these paths. (src/gateway/client.ts:57, 243f51d314d1)
  • Branch owner-boundary repair: The branch makes read-only mode authoritative over identity creation and token load/store/clear host callbacks, preventing caller overrides from restoring writes. (src/gateway/client.ts:52, b90a2b863437)
  • Shared client contract: The local gateway-client contract accepts an absent device identity and no-op token storage callbacks, matching the branch's read-only host dependencies. (packages/gateway-client/src/client.ts:74, 243f51d314d1)
  • Behavior-boundary coverage: The branch launches a separate CLI process against a WebSocket Gateway, verifies pairing RPCs complete, checks no SQLite file is created, and separately preserves existing database contents after hello issues a token. (src/cli/gateway-backed-exit.process.test.ts:296, b90a2b863437)
  • Maintainer recovery disposition: Patrick-Erichsen explicitly accepted explicit authentication or re-pairing after a rotated/stale stored token, rather than permitting a second SQLite writer.

Likely related people:

  • Peter Steinberger: Introduced the canonical SQLite device-identity and per-origin device-auth storage that this repair protects. (role: feature owner; confidence: high; commits: 98410d986eee, 47fd629c8d6b; files: src/infra/device-auth-store.ts, src/infra/device-identity-store.ts)
  • xingzhou: Authored the earlier shared-state corruption repair in the same CLI and SQLite ownership area. (role: adjacent owner; confidence: medium; commits: 688317628afe; files: src/state/openclaw-state-db-readonly.ts)
  • Patrick-Erichsen: Authored the transport-wide read-only commits on this branch and recorded the maintainer recovery disposition. (role: recent repair contributor; confidence: high; commits: 06f5c6378c0e, cfbb8da24e97, b90a2b863437; files: src/gateway/call.ts, src/gateway/client.ts, src/state/openclaw-state-db-readonly.ts)

Rank-up moves

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

  • Keep required native checks green on the exact head before merge.

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-08-14T13:49:38.539Z sha 7161bc2 :: needs changes before merge. :: [P1] Propagate read-only state through the Gateway client | [P2] Avoid coordinator writes when loading identity read-only
  • reviewed 2026-08-16T05:47:51.419Z sha cfbb8da :: needs maintainer review before merge. :: none
  • reviewed 2026-08-16T06:28:34.389Z sha b90a2b8 :: needs maintainer review before merge. :: none
  • reviewed August 16, 2026, 5:31 AM ET / 09:31 UTC sha unknown :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. and removed 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. labels Aug 16, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Aug 16, 2026
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

Maintainer disposition for the ClawSweeper rank-up move: accept explicit recovery.

For node/device one-shot CLI processes, retaining Gateway-only SQLite writer ownership is the priority. If a stored device token is rotated or stale, the supported recovery is the existing explicit-auth or re-pair path; these one-shot processes should not persist or clear tokens by reopening canonical shared state as a second writer. A separate two-invocation token-persistence proof is not required for this landing.

@Patrick-Erichsen

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

Please review exact head b90a2b863437b1b99bc21f4aac94f9332bd382fd. The prior review lease was tied to cfbb8da24e97841220105d7bea4220c81ad99905 and has expired. Maintainer disposition for its stored-token recovery rank-up move is recorded above.

@clawsweeper

clawsweeper Bot commented Aug 16, 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:

@Patrick-Erichsen
Patrick-Erichsen merged commit ab9b40d into openclaw:main Aug 17, 2026
285 of 289 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 17, 2026
…claw#123674)

* fix(cli): prevent node/device RPCs from corrupting shared state

* fix(cli): keep gateway RPC transport state read-only

* fix(cli): preserve doctor lint config isolation

* fix(cli): keep gateway RPC transport state read-only

* fix(gateway): keep auth preflight state read-only

* fix(cli): preserve SQLite artifacts in read-only RPCs

* fix(infra): remove stale identity store import

---------

Co-authored-by: VACInc <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>
steipete added a commit that referenced this pull request Aug 17, 2026
Gateway health, suspend, and resume now preserve shared SQLite state when the target is unreachable.

Related: #101290

Follow-up to #123674
steipete added a commit that referenced this pull request Aug 17, 2026
* fix: keep device identity reads lock-free

Amp-Thread-ID: https://ampcode.com/threads/T-01a00ae0-190d-718b-8a76-b75f3e8d1fae

* feat(lint): enforce import ordering and deduplication (#124730)

* refactor(imports): dedupe and hoist imports

* feat(lint): enforce import/no-duplicates and import/first

* feat(voice-call): sessionScope "main" routes calls into the agent main session (#124708)

* feat(voice-call): add sessionScope "main" for main-session call routing

Inbound and outbound calls can now share the configured agent's main
session instead of a dedicated voice session. The new scope resolves
through the existing explicit-key canonicalization path, honoring core
session.mainKey and global-scope aliasing. The inbound webhook path now
forwards coreSession like every other resolver call site.

* style: format events.test.ts

* test(voice-call): split events.test.ts under the max-lines cap

* fix(cli): forward agent name through setup (#124740)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b6b-e4e9-74af-bb31-30363fae6c89

Co-authored-by: Amp <[email protected]>

* refactor(mcp): centralize tool filter policy (#124739)

* fix(agents): preserve restart-unsafe delivery evidence (#124737)

* fix(ci): snapshot synced Testbox candidates (#124743)

Co-authored-by: Amp <[email protected]>

* fix(ci): keep QA evidence output repo-relative (#124760)

* fix(cli): allow hook toggles to select an agent (#124761)

* test(upgrade): drop retired agent context assertion (#124765)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00a6a-b64e-74a5-8b15-2d3b966a468d

Co-authored-by: Amp <[email protected]>

* fix(skills): report missing ClawHub skills as not found (#124764)

* feat(codex): show sessions from additional homes (#124660)

* feat(codex): register additional session homes

* fix(codex): preserve automatic session homes

* docs(codex): explain automatic home discovery around sessionCatalog.homes

---------

Co-authored-by: IWhatsskill <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>

* fix(qa): preserve effective fast mode (#124762)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b6b-e4e9-74af-bb31-30363fae6c89

Co-authored-by: Amp <[email protected]>

* fix(ui): keep Control UI device identity working on plain-HTTP origins (#124724)

* fix(ui): keep Control UI device identity working on plain-HTTP origins

@noble/ed25519 defaults its SHA-512 provider to crypto.subtle, which
browsers gate to secure contexts, so device identity silently vanished
on http:// LAN dashboards and connects fell back to shared-credential
auth with no pairing. Wire a lazy pure-JS @noble/hashes fallback for
SHA-512 and the fingerprint SHA-256, and drop the isSecureContext gate
in the connect path. Secure contexts keep the platform digests and pay
no startup bytes: the fallback loads as its own lazy chunk, kept out of
the gateway-runtime startup chunk on purpose.

* test(ui): cover device identity minting and signing without crypto.subtle

New jsdom regression suite fails on pre-fix code (subtle-less crypto stub
with getRandomValues, which real insecure contexts keep). Rewrites the
gateway connect tests that previously asserted the device-less insecure
fallback: an insecure context now attaches a device identity.

* docs(web): plain-HTTP dashboards now pair with a device identity

The signing key never crosses the wire, so HTTP+pairing is strictly
stronger than the old HTTP token-only fallback; HTTPS (Tailscale Serve)
stays the recommendation for transport privacy.

* fix(ui): drop unnecessary boolean literal compare in secure-context timing meta

* test(ui): declare device.id on the connect-frame test shape

* test(ui): split the subtle-less scope-upgrade e2e into the two real invariants

Without crypto.subtle the browser can now sign, so the banner offers the
explicit admin upgrade; manual-only guidance is reserved for browsers that
cannot mint an identity at all (no WebCrypto RNG). Also corrects the
connect-path comment: blocked storage yields an ephemeral identity, only a
failed mint degrades device-less.

* fix(ui): address review findings on the HTTP device-identity path

- Storage-blocked pages keep one stable in-memory identity per page
  lifetime instead of minting a fresh unpaired key on every reconnect,
  and a write-rejecting store no longer fails the mint (regression tests
  bite pre-fix).
- Connect timing now reports the real browser secure-context fact via a
  shared browserSecureContext() helper instead of inferring it from
  device-identity presence.
- Docs state the accepted trusted-proxy contract: browsers attach a
  device identity on every origin, so first connects follow the standard
  pairing flow (deviceAutoApprove or a one-time approval); device-less
  admission remains only for browsers that cannot mint an identity.

* refactor(ui): trim the connect-path additions under the max-lines cap

* fix(line): retry lost pushes without duplicating an accepted send (#124464)

A LINE push made exactly one attempt, so a transient provider or transport
failure dropped the reply even though retrying was safe to do. Retrying alone
would have duplicated a send LINE already accepted, so every push now carries an
X-Line-Retry-Key and reuses it across attempts: LINE answers a replayed key with
409 and the accepted request's sent messages, which resolves to the original
delivery instead of a second message.

Retries follow LINE's documented policy - server errors and transport failures
only, never 2xx, 409 or any 4xx - and run through the shared channel API retry
runner in strict mode. Replies stay single-attempt because LINE offers no retry
key for them.

* fix(outbound): record queue-write loss and fail every payload on prep abort (#124756)

* fix(outbound): record queue-write loss and fail every payload on prep abort

Two silent-observer gaps in the outbound queue admission path:

1. Best-effort staging/queue-write failures were swallowed with a bare
   'return null'. The send proceeded live-only, so a crash mid-send lost
   the message with zero forensic trace of why the write-ahead row was
   missing. Every sibling degradation on this boundary logs
   (persistQueuedPreSendState, the dispatch-refresh fallback); this one
   now warns with channel/target and the error.

2. Batch preparation failure emitted message_sent for only the first
   payload while audit emitted per-payload terminals, so plugins with
   message_sent hooks saw 1 failure for an N-payload batch. The failure
   path now emits one hook failure per logical payload, matching the
   audit terminals and the recovery sibling's
   queuedTerminalFailureEvents. The unused error.payload pick and its
   OutboundPayloadPreparationError import went with it.

Regressions: queue-write warn asserted in the existing best-effort
fallback test; new multi-payload prep-failure test asserts 2 hook
failures. Both fail pre-fix.

* chore(outbound): keep OutboundPayloadPreparationError module-local

Last external consumer went away with the per-payload emit; the
deadcode:exports gate rejects unused exports.

* refactor(gateway): drop dead session-subscriber registry surface (#124754)

* refactor(gateway): drop dead session-subscriber registry surface

getForConnection and both registry clear() methods had no production
callers — only server-chat-state.test.ts consumed them (verified by
repo-wide grep incl. plugin-sdk). The recency-sorted connToSessionKeys
index existed solely so getForConnection returned keys in subscription
order, an ordering nothing read, rebuilt via toSorted() on every
subscribe/unsubscribe/settle — including the provisional-replay settle
path.

unsubscribeAll now reads the reverse index directly from
connToSessionRecency's keys (same contents, no ordering), removing the
per-call O(k log k) rebuild and the duplicate map. Tests assert through
get()/getApprovals(), the production read paths, per test-audit norms.

Behavior-neutral: subscription state transitions and event-visible
delivery unchanged; chat-state, broadcast, node-subscription,
instance-runtime, agent-events, session-events suites pass.

* test(gateway): fix ETXTBSY flake in workspace-sync candidate bounding

The test rewrote its mock git script between two createGitTransferList
calls. On Linux CI the second spawn can race a lingering fork of the
first child still holding the script's write fd, failing exec with
ETXTBSY. Write the script once; vary the entry count through a data file
the script reads instead.

* fix(config): preserve migration notice paths (#124719)

* fix(runners): preserve device sessions through lifecycle faults (#124744)

* test(runners): cover paired-node lifecycle wire

* fix(runners): preserve retryable device lifecycle

* test(runners): keep wire fixture internals local

* fix(runners): stop fallback on device capacity

* fix(doctor): keep identity probe within typed storage APIs

Amp-Thread-ID: https://ampcode.com/threads/T-01a00ae0-190d-718b-8a76-b75f3e8d1fae

* fix(openai): keep setup auth choices consistent (#124729)

* fix(openai): centralize setup auth metadata

* refactor(openai): overlay auth hooks in place

* fix(tasks): cancel subagents through gateway (#124752)

* fix: honor context caps on Codex-routed models (#124735)

* fix(codex): forward authored context caps

* test(codex): keep binding fixtures uncapped

* fix(agent-harness): separate authored context cap

* fix(config): render actionable validation errors (#124763)

* fix(config): render actionable validation errors

* fix(config): cover service and gateway validation

* docs: remove agent-hierarchy guardrail from VISION roadmap

Agent-created agents (durable roster entries with provenance) are now
planned work, so the blanket VISION.md guardrail against agent-hierarchy
frameworks no longer reflects direction. The adjacent guardrail against
heavy duplicative orchestration layers stays.

* fix(gateway): preserve worker lifecycle failure reasons (#124774)

* fix(cli): explain empty directory lookups (#124753)

* fix(cli): explain empty directory lookups instead of printing nothing

* fix(cli): distinguish unsupported self lookups

* fix(codex): honor session node exec host (#124777)

* refactor(line): replace nine-marker prompt DSL with typed rich messages (#124755)

* refactor(line): replace nine-marker prompt DSL with typed rich messages

Delete the LINE plugin's double-bracket marker language (quick_replies,
location, confirm, buttons, media_player, event, agenda, device,
appletv_remote) and its parser. Portable interactions now flow through the
existing presentation-block seam (renderPresentation, matching Discord and
Feishu); LINE-specific cards ride closed channelData.line schemas mapped to
the existing Flex renderers. Prompt section shrinks to four capability
lines and explicitly de-fangs marker text. Removes the stale
assertion-safety baseline entry for the deleted parser.

Production LOC net -69, tests net -433. Suite: 510/510 green.

* fix(line): declare rich message schema dependency

* fix(line): satisfy rich message type checks

* docs(line): mark card fragments as partial

* feat(ui): surface approvals passively and redesign the approval card (#124767)

* feat(ui): surface approvals passively and redesign the approval card

Approvals no longer auto-open the centered modal: the queue is reachable
only through the sidebar attention chip, while the owning session shows
the inline card and other sessions surface via the session-row shield
icon, agent badges, and the chip. Deletes the inline-vs-modal exclusion
machinery (modalApprovalQueue, inlineApprovalId, forceShowAll) and makes
modal dismissal close the view instead of denying the active request.

Card: severity now drives the accent color instead of a table row,
plugin/agent render as header chips, the session key moves behind a
collapsed Details disclosure (modal only), and low-value exec rows
(Resolved/Security/Ask) collapse into the same disclosure. The codex
app-server bridge stops duplicating the session key into description
text; the envelope already carries it.

* fix(ui): gate settings Escape on the approval dialog's recorded open state

ClawSweeper caught that shouldIgnoreSettingsEscape still inferred an open
approval dialog from queue non-emptiness; with passive approvals a pending
queue no longer implies a visible dialog, so settings would swallow Escape.
The exec-approval element now records dialogOpen as a fact and the guard
reads it.

* refactor(channels): carry typed approval-prompt bindings through signal/imessage send seams (#124742)

The Signal and iMessage channel plugins inferred approval prompts by
regex-sniffing rendered message text (header matching like 'Exec approval
required', /approve command parsing), violating the transport-only channel
doctrine: approval actions must stay typed until channel encoding.

The typed envelope already existed (channelData.execApproval with
approvalId/approvalKind/allowedDecisions) and every payload-level delivery
path consumed it; the regex paths were redundant re-derivation at the raw
send seam plus restart recovery for in-memory iMessage poll state.

- Signal: delete send-level prompt sniffing entirely; all approval sends
  already flow through typed structured-payload or native-handler paths.
- iMessage: sendMessageIMessage takes a typed approvalPrompt binding
  (id/kind/decisions) from the native approval handler instead of an
  approvalKind flag plus text re-parsing.
- iMessage poller: persist pending poll targets in the plugin keyed store
  so restart recovery no longer regex-scans chat history; typed recent-chat
  discovery for handle-only DM targets stays. Split poll-target ownership
  into approval-reaction-poll-targets.ts (max-lines).
- Plugin SDK: remove extractApprovalReactionPromptBinding — beta-only
  surface, never in a stable release, so no deprecation window applies;
  AGENTS.md now records that rule.

Accepted tradeoff: approval prompts delivered by a pre-upgrade process are
not rediscovered from chat text after restart (<=24h transient state;
persisted reaction bindings and event-driven tapbacks still work).

* fix(ci): select aggregate QA evidence by manifest (#124802)

* docs: correct code mode runtime contract (#124792)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b7c-b9f0-73d5-8fb7-e619e8e458e1

Co-authored-by: Amp <[email protected]>

* fix(ci): invalidate extension boundary cache for attempt types (#124800)

* refactor(plugin-sdk): consolidate session catalog families (#124801)

* fix(memory): fail corrupted index commands (#124770)

* fix(memory): fail corrupted index commands

* fix(memory): preserve promotion output limit

* fix(memory): keep ranked promotion output

* feat(codex): name additional session-catalog homes (#124807)

* fix(state): copy-safe agent database registry via state-relative paths (schema v9) (#124728)

* fix(state): store in-root agent database registry paths relative to the state dir (schema v9)

Copied state directories retained stale absolute agent database registry rows. The combined gateway store then merged old and new copies, causing every sessions.list request to fail with SessionCanonicalKeyMigrationRequiredError.

Schema v9 stores in-root registry paths relative to the state directory; migration rewrites eligible rows, deletes stale duplicates, and preserves external paths.

* fix(voice-call): describe state-relative registry migration

* fix(state): preserve registry locator traversal

* test(macos): move PortGuardian schema-version boundary to v9

The store opens any state database up to maximumSupportedSchemaVersion,
which the schema v9 bump moved from 8 to 9. Shift the supported/newer
partition in the boundary test accordingly.

* fix(state): re-anchor copied default-layout registry rows instead of deleting them

Resolve the ClawSweeper P1 by preserving genuine external default-layout registrations, re-anchoring copied rows when an in-root counterpart exists, and deleting only dual default-layout conflicts.

* fix(upgrade): retain owners in legacy cron stores (#124809)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00a6a-b64e-74a5-8b15-2d3b966a468d

Co-authored-by: Amp <[email protected]>

* feat(tools): prompt proactive widget use (#124810)

* fix(ui): stop stale clients from acting connected (#124772)

* fix(ui): stop stale clients from acting connected

Carry reload metadata on terminal Control UI build rejections, render an explicit refresh-required recovery state, fence reconnect-only actions, and surface disconnected approval failures with accessible modal controls.

* fix(ui): preserve reconnecting session drafts

* fix(ui): preserve offline preference intent

* fix(ui): return owned fallback digest bytes

* test(ui): follow passive approval presentation

* fix(ui): distinguish stale builds from protocol mismatches

* style(ui): format gateway recovery phase

* refactor(validation): type producers and drop internal re-validation — pilot lane C (#124808)

* fix(cli): restart disabled installed services (#124786)

* refactor(agents): persist directive facts at the assistant write boundary (#124793)

* refactor(agents): persist directive facts at the assistant write boundary

Assistant final text is now stripped of inline delivery directives once, at
the SessionManager append boundary, with the parsed facts persisted as a
typed openclawDelivery field on the assistant message (openclawDeliveryMirror
precedent, inside event_json — no schema change). Live session state is
replaced with the persisted canonical bytes so same-run continuations and
next-turn store rebuilds never diverge (prompt-cache invariant).

Delivery and restart recovery consume the stored facts instead of re-parsing
persisted text; pre-upgrade in-flight messages without facts intentionally get
no text-parse fallback (commented tradeoff at the read site). Directive
parsing is now code-region aware, so markers quoted in inline code or fences
neither parse nor strip — fixes the empty-code-pill display bug.

The undocumented reaction marker DSL ([[react:]], [[react_to_current:]]) is
deleted; structured message-tool reactions remain the canonical path. Stale
assertion-safety baseline entry removed with the parser.

Production net -10, tests net +38. Focused suites: 9,068 passed; pre-fix
regressions fail for the intended reasons. Codex autoreview clean.

* fix(agents): satisfy directive persistence gates

* fix(config): drop unused directive export

* fix(agents): preserve indented directive examples

* perf(test): remove ClickClack scheduler waits (#124819)

* refactor: split max-lines pilot files and retire suppressions (#124813)

* fix(runners): align reclaim results with runtime (#124791)

* refactor(runners): prepare placement move targets

* fix(runners): preserve normalized dispatch targets

* style(protocol): format reclaim result type

* fix(ui): make light-theme diff syntax readable (#124814)

Co-authored-by: RoboClaw <[email protected]>

* fix(ci): render only aggregate QA evidence (#124823)

* fix(ui): show session changes in review panel (#124824)

* fix(gateway): stop closed clients from restoring session subscriptions (#124771)

* fix(gateway): reject closed session subscribers

* test(gateway): type subscription race params

* test(gateway): use public subscription assertion

* fix(ci): invalidate SDK declarations on attempt types

* chore(ci): align boundary cache comment with main

* fix(gateway): surface failed node event delivery (#124798)

* fix(gateway): surface failed node event delivery

* fix(plugin-sdk): preserve authored context cap

* fix(mcp): make Codex approval dead ends actionable (#124766)

* fix(mcp): make Codex approval dead ends actionable

* fix(mcp): preserve native approval fallback

* fix(mcp): configure saved approval modes

* fix(mcp): preserve saved Codex metadata

* style(mcp): simplify saved metadata spread

* improve(ui): one primary composer button, Enter-steer, Esc-stop, quiet mic, no transcript focus ring (#124799)

* fix(ui): drop the transcript keyboard-focus ring

The .chat-thread:focus-visible 2px inset outline (added in #120693) boxed
the entire main content whenever the transcript took keyboard focus
(Shift+Tab, closing transcript search) and read as a broken border that
stopped above the composer. The transcript stays keyboard-focusable for
scroll keys; it just paints no focus box. Accepted tradeoff: no visible
focus indicator on the scroll container.

* feat(ui): single primary composer button with Enter-steer and Esc-stop

The composer now renders exactly one primary action, always rightmost:
- draft or attachments present: one send-shaped button whose label follows
  the session follow-up mode (Send / Queue / Steer); the stop button no
  longer renders beside it
- empty while a run is active: Stop (tooltip "Stop (Esc)"); Escape in the
  composer aborts the run, deferring to reply-clear and menu precedence
- empty while idle: disabled send labeled "Write a message to send."

Enter on an empty composer while a run is active steers the oldest
steerable queued message — Enter queues, Enter again steers — using the
same eligibility predicate as the queue chip's Steer action (shared
steerableQueuedMessage helper). The mic/dictation control is now always a
compact secondary control left of the primary instead of morphing into
the primary when the composer is empty. Dead ChatRunControlsProps fields
(hasMessages, onExport, onNewSession, showPrimary, showSecondary) and the
composer exportMarkdown wrapper are removed; the assertion-safety
baseline entry for chat-composer.ts shrinks 8 -> 7.

* refactor(ui): quiet the idle composer mic

The idle mic was an accent-tinted two-segment pill (mic + permanently
visible device-picker chevron) that outweighed the primary action. It now
matches the attach button's ghost weight: transparent idle, subtle hover,
and the accent treatment is reserved for the recording and talk-active
states so the idle -> recording escalation reads stronger. The device
picker chevron collapses at idle and reveals on hover/focus-within (kept
always visible on coarse pointers, where dictation matters most; reveal
transition disabled under prefers-reduced-motion). The idle tooltip now
teaches the gesture split — "Tap to talk · Hold to dictate" — while the
aria-label stays "Start voice input".

* refactor(ui): split composer keydown and oversized composer test files

chat-composer.ts crossed the 700-line oxlint budget after the keyboard
additions; the keydown handling (menu routing, history keys, Escape-stop,
Enter steer/send) moves to chat-composer-keydown.ts behind a typed deps
factory. The composer unit tests split their primary-action/keyboard
coverage into chat-composer-actions.test.ts over a shared
chat-composer.test-support.ts, and the catalog/model-discovery e2e cases
move to chat-composer-catalog.e2e.test.ts. Pure moves, no behavior
change; no max-lines suppressions or baseline entries added.

* chore(ui): keep composer test-support ComposerProps internal

The split exported a type nothing imports; the dead-export scan is a
merge gate.

* fix(ui): narrow composer keydown target and adapt keyboard tab-order proof

The keydown split moved two bare textarea assertions into a zero-baseline
file; a single instanceof narrowing at the handler entry replaces both
(the handler only binds to the composer textarea). chat-composer.ts's own
assertion baseline ratchets 7 -> 5. The pointer-activation e2e now walks
the real post-redesign tab order (mic, focus-revealed picker trigger,
then primary send) instead of assuming one Tab.

* fix(ui): gate Enter-steer on the queue chip's visible availability

ClawSweeper P1: the Enter path only required an abortable run, so
offline Enter swallowed the keypress and invoked a steer lifecycle that
returns at !connected with no visible outcome, while the queue chip's
Steer button was correctly hidden behind connected && canCompose. The
keydown path now mirrors the chip's exact boundary (connected, canSend,
abortable, visible queue surface including sessionKey-less pending
rows).

* refactor(ui): align approval page with redesigned approval card (#124816)

* refactor(ui): align approval page with redesigned approval card

Follow up #124767 by carrying severity accents and identity chips onto the standalone approval page.

Remove the unused execApproval.labels severity, plugin, and agent keys.

* refactor(ui): keep approval-page helpers in repo idiom

Reverts drive-by rewrites from the build pass: restore the exhaustive
decisionLabel switch (the ternary lost the never check), the early-return
appliedDecisionMatches, explicit gatewayCode comparisons, and align the
severity mapping shape with the sibling exec-approval-card.ts.

* test(ui): type approval severity fixtures

* test(scripts): wait for a parseable descendant pid in Bun smoke cleanup

The readiness gate only required the descendant pid file to exist, but
existsSync can observe it between open() and write(); a loaded runner
then reads an empty file and the integer assertion flakes (seen on PR
#124816 CI run 31971191374). Readiness now requires parseable content.

* perf(webui): reuse the chat metadata catalog across pages (#124794)

* refactor(webui): centralize chat metadata caching

* test(webui): cover shared chat metadata store

* refactor(webui): move ChatMetadataResult type to its store owner

* fix(webui): let the metadata store own revalidation lifetime

* fix(webui): satisfy no-promise-executor-return in retry delay

* fix(browser): stop local actions when agent turns are cancelled (#124795)

* fix(browser): cancel local actions with agent signal

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b6b-e4e9-74af-bb31-30363fae6c89

* fix(agent-harness): expose authored context cap

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b6b-e4e9-74af-bb31-30363fae6c89

* chore(agent-harness): drop redundant context-cap override

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b6b-e4e9-74af-bb31-30363fae6c89

---------

Co-authored-by: Amp <[email protected]>

* improve(ui): make chat disclosures compact (#124832)

Co-authored-by: RoboClaw <[email protected]>

* fix(gateway): share generated session titles with worktree names and start title work at dispatch (#124787)

Worktree sessions now derive their worktree/branch name from the same
concise generated title the sidebar shows (bounded 8s wait, raw-prompt
slug then crustacean fallback), persisted once as displayName so the
chat-send pass never duplicates the model call. Dashboard title
scheduling moves from the dispatch chain's finally (after the whole
first turn) back to dispatch start, so long or interrupted first turns
no longer leave sessions silently untitled (regression from #122471).
slugifyWorktreeTitle truncates at word boundaries; dead
generatedDisplayName plumbing removed.

* fix(browser): support Chrome Web Store native bootstrap (#124775)

* fix(browser): support Chrome Web Store native bootstrap

* chore: keep browser release note in PR body

* docs(browser): document Store identity trust boundary

* docs(browser): correct Store recovery guidance

* fix(media): bound image-optimize fetch headroom to the image cap (#124838)

When a caller passed an explicit maxBytes with optimizeImages on (the
default), the source-read bound was inflated to max(maxBytes, 100MB
document cap). A channel with a 5MB attachment cap therefore let a
hostile or oversized URL buffer up to 100MB before the final size check
— 20x resource amplification, and the inflation applied before content
classification, so it was not limited to images.

The inflation exists so oversized-but-compressible originals can be
fetched and compressed under the delivery cap. Size that headroom off
the thing that justifies it: 4x the 6MB image cap (24MB), enough for
large phone photos, instead of the document cap.

Accepted tradeoff (named at the constant): originals above 24MB that
would have compressed under the cap now fail; the fetch error names the
bound. Callers without an explicit cap keep per-kind defaults.

Live proof on a real localhost HTTP server (no mocked fetch): an 8.1MB
PNG under a 5MB cap compresses to 3.75MB and delivers; a 30MB-declared
image is rejected at the Content-Length precheck in 7ms with 'content
length 31457280 exceeds maxBytes 25165824'.

Regression: headroom-bound test fails pre-fix (30MB passes the old
100MB bound); companion test proves compression headroom still works.

* fix(channels): route direct DM replies to sender (#124837)

Default direct-message reply context to the authenticated sender address so targetless Reef and Nostr replies do not resolve to the local recipient.

* feat(auto-reply): record message-tool mute outcomes (#124830)

* feat(auto-reply): record message-tool mute outcomes

* fix(auto-reply): require source delivery evidence

* test(infra): preserve historical agent schema fixtures

* fix(agent): preserve implicit roster in configless exec (#124805)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b7c-b9f0-73d5-8fb7-e619e8e458e1

Co-authored-by: Amp <[email protected]>

* fix(delivery): unify terminal settlement ownership (#124825)

* fix(delivery): unify terminal settlement ownership

Treat identityless adapter returns as potentially visible across channel, queue, and cron paths. Let recovery own terminal completion so ambiguity persists as notice debt instead of being double-settled or silently suppressed.

Co-authored-by: ruel225 <[email protected]>

* refactor(delivery): narrow terminal internals

Remove now-unused internal exports after terminal-settlement ownership was consolidated.

* test(tts): preserve message runtime exports

Import and spread the actual message runtime so the focused mock retains every runtime binding while overriding only the durable send core.

---------

Co-authored-by: ruel225 <[email protected]>

* fix(ui): give queued-outbox badges their own outbox icon (#124842)

The sidebar queued-message badge and the composer queue reused the clock
glyph that also marks attached automations, so a session with both showed
two identical clocks distinguishable only by tooltip. Add an outbox tray
icon (Lucide inbox with the roof swapped for a rising arrow) and use it
for queued-to-send surfaces; the clock stays automation/cron-only. The
mock dev fixture now flags one session with hasAutomation so the badge
renders in mocked-dashboard proofs.

* refactor(plugin-sdk): extract stream and SecretRef primitives (#124835)

* refactor(ui): derive cron types from gateway protocol (#124827)

* refactor(ui): derive cron types from gateway protocol

* fix(protocol): preserve cron session target type

* fix(ui): keep sent images visible through history handoff (#124839)

* fix(memory): report indexed SQLite sessions (#124834)

* fix(memory): report indexed SQLite sessions

* refactor(memory): remove unused state path export

* refactor(validation): consolidate boundary guards into schemas (#124820)

* refactor(validation): consolidate boundary guards into schemas — pilot lane B

* fix(meetings): reject non-object browser status

* perf(test): remove Gmail watcher shutdown wait (#124851)

* refactor(types): discriminated unions for internal contracts — pilot lane A (#124845)

* refactor(slack): mark approval headers with typed block ids (#124841)

* feat(ui): add steer-now composer shortcut (#124826)

* fix(slack): drop the tool-call receipt from finished progress cards (#123851)

The Block Kit session card terminalized into a '🛠️ N tool calls · ⏱️ Ns'
footer, leaving a per-turn receipt in the Slack transcript on the default
progress path. PR #122976 deleted the same receipt from the native progress
surface but left this sibling rendering it.

Finished cards now keep only the durable diff stat and the session link;
tool-call and elapsed counters stay live working state. Also corrects the
documented channels.slack.streaming.mode default, stale since #122552.

* fix(agents): keep queued followups from missing post-compaction context (#124850)

* fix(auto-reply): order post-compaction context before followups

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b6b-e4e9-74af-bb31-30363fae6c89

* test(auto-reply): clean compaction workspace fixture

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b6b-e4e9-74af-bb31-30363fae6c89

---------

Co-authored-by: Amp <[email protected]>

* fix(test): propagate parent heavy-check ownership (#124859)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b7c-b9f0-73d5-8fb7-e619e8e458e1

Co-authored-by: Amp <[email protected]>

* fix(cli): emit one JSON failure contract for --json invocations (#124849)

* fix(cli): unify JSON failure output

* test(cli): update skills verify failure envelope

* fix(gateway): preserve prepared plugin metadata under load (#124844)

* fix(gateway): preserve prepared plugin metadata under load

* fix(gateway): project metadata before catalog preparation

* test(agents): assert projected startup metadata

* test(gateway): bind load probes to each finalization wave

* docs(ci): record artifact checkout experiment

* perf(test): reuse postpublish file-cap fixture (#124871)

* fix(protocol): model cron run delivery trace (#124856)

* fix(protocol): model cron run delivery trace

* chore(protocol): refresh generated cron run model

* test: replace assertion chains with typed fixture builders — wave 2 (#124865)

* refactor(security): consolidate path containment onto canonical fs-safe guard (#124870)

* refactor(security): expose canonical path containment modes

* refactor(agents): use canonical path containment guard

* refactor(security): consolidate core path containment sites

* refactor(plugins): consolidate path containment sites

* test(security): cover canonical path containment behavior

* fix(gateway): persist agent turns before acknowledgement (#124857)

* fix(gateway): persist agent turns before acknowledgement

* fix(gateway): revalidate exec approval handoffs

* docs(gateway): clarify durable session ownership

* fix(gateway): reject stale transcript admission targets

* fix(ui): show recovery when Control UI does not render (#124861)

* fix(ui): retire bootstrap fallback after render

* test(ui): avoid returning from Promise executor

* fix(qa): recover repeated gateway restarts through channel ingress (#124746)

* fix(qa): repair repeated gateway restart recovery

* test(qa): satisfy restart recovery checks

* fix(audit): rekey repeated recovery identity

* fix(plugin-sdk): expose authored context cap

* test(android): synchronize process tree readiness

* fix(ui): restore task count badge (#124840)

* fix(ui): align update status card spacing (#124878)

* fix(browser): cancel node discovery with tool runs (#124880)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b6b-e4e9-74af-bb31-30363fae6c89

Co-authored-by: Amp <[email protected]>

* perf(webui): render cached model catalog while the chat pane refreshes (#124868)

* perf(webui): render cached model catalog while the chat pane refreshes

* test(webui): fix seed-test types and shrink assertion baseline

* fix(state): report v9 registry migration row decisions (#124862)

* fix(state): report v9 registry migration row decisions in doctor and logs

* fix(state): consume registry migration summary type

* fix(state): avoid registry path observer import cycle

* fix(workboard): include actual length in bounded-string error

The shared normalizeBoundedString helper in extensions/workboard/src
threw an opaque error like 'comment body must be 2000 characters or
fewer.' whenever an oversize string hit any bounded field. Agents that
posted a long run summary or oversized link URL had no way to tell
how far over the limit they were, so they could not retry with a
trimmed payload.

Include the actual length in the error so the message tells the agent
exactly what to do next:

  comment body must be 2000 characters or fewer (got 3502).

The format applies uniformly to every bounded field routed through
this helper (labels, link URL, link title, link target, comment
body, title, notes, worker log message, session key, run id,
protocol violation detail, etc.) since the helper is the single
canonical owner of the message.

Cover the new format with a focused unit test that pins the regex
for the comment-body repro from #118845 and exercises the six other
bounded fields listed in the issue. Update the existing
gateway.test.ts assertion to allow both the old and new format so
the format change is a forward-compatible improvement.

* test(workboard): align matrix with real normalizeBoundedString consumers

ClawSweeper flagged that the prior matrix at line 31-48 tested
labels/title/notes by manually invoking normalizeBoundedString, even
though those fields use the independent normalizeTitle, normalizeNotes,
and normalizeLabels functions (each with its own generic message).
A regression that drops the (got N) suffix from normalizeBoundedString
would not be caught for those three surfaces — operators would still
see the old opaque error.

This commit narrows the matrix to only the consumers of the shared
helper (comment body, link title, link target, link URL, card id) and
restores the exact labels gateway assertion that should match the
unchanged normalizeLabels error.

Verification: 9/9 inline Node 18 AST harness (node /tmp/verify-pr-118888-v77.mjs);
parent-commit proof-gate (pre-PR helper without the got suffix) fails
4/9 of the post-fix expected messages.

Closes ClawSweeper review on PR #118888 (P2 + P3).

* test: cover Workboard length errors at gateway boundary

* docs: note length-aware Workboard errors (#118888)

* perf(ci): split Windows CI two ways instead of one serial lane

`checks-windows-node-test` ran the whole 222-266s Windows body in a single
Blacksmith lane, so every run that scheduled it finished at 287-334s against a
~180s plateau. Measured across 45 canonical main runs it was the wall in all
seven runs that triggered it (324-519s vs a 210s median elsewhere).

Blacksmith's Windows class admits exactly 2 concurrent jobs (run 31865243804),
which is why the earlier 3-part split failed: its tail queued 211s behind a
finished part. Pin the split width to that measured capacity instead. The two
parts are balanced by measured per-project wall time -- part 1 keeps the old
list 1 plus list 2's non-infra projects (~108s), part 2 takes list 2's infra
project plus the old list 3 (~112s) -- so both land near 113s and the lane
stops setting the wall.

One canonical partition now serves every backend; the github-mode/dispatch
3-part variant and its separate file inventory are gone, along with the
single-lane `task: test` case and the per-row `matrix.runner` the collapsed
lane needed. The complete 65-file Windows inventory is preserved exactly, and
the guards pin the width on both sides (mutation-checked: restoring 3 parts
fails the matrix guard).

* fix: stop forked commands after Gateway timeouts (#124081)

* fix: stop service child trees before timeout completion

* fix: preserve service child root results during cleanup

* test: isolate relay selection from linux spawn wrapping

* refactor: keep service anchor payload internal

* test: validate lifecycle probe pid output

* fix: close service child adversarial races

* fix: preserve service startup failures

* fix(process): flush service output before root result

* fix(process): bound cleanup on held output

* chore(process): satisfy promise executor lint

* fix(process): finish cleanup after lineage loss

* fix(process): retain relay output before subscription

* fix(ci): register service child runtime entries

* fix(ci): expose relay safety invariants

* fix(process): preserve service cancellation grace

* test(process): prove service grace on macOS

* fix: prevent clipped session selections and Code Mode timer crashes (#124879)

* fix(agents): support timers in code mode

* fix(ui): keep selected sessions clear of scrollbars

* fix(agents): propagate timer cancellation after resume

---------

Co-authored-by: RoboClaw <[email protected]>

* fix(ui): reveal clipped session history (#124866)

* fix(ui): reveal clipped session history

Show a persistent earlier-history action for paginated sessions and reveal loaded content without chaining observer fetches.

Related: #110771

* refactor(ui): split chat history support

* fix(cli): keep internal error causes out of operator output (#124887)

* fix(skills): expand explicit references on agent turns (#124784)

* fix(skills): expand explicit references on agent turns

Route generic Gateway, CLI, webhook, and local agent turns through the same explicit skill-reference renderer as channel auto-replies. Keep original transcript text, preserve unknown slash behavior, and fail visibly for allowlist-hidden skills.

Maintainer review: scoped Option 1 — generic agent turns expand both $skill-name and leading /skill-name args through shared skill rendering; they do not run the channel command dispatcher, and all other slash commands retain their existing behavior.

* fix(skills): bound explicit reference prompts

* fix(skills): prefer allowed reference collisions

* fix(skills): preserve command invocation boundaries

* fix(skills): reject hidden channel slash commands

* perf(skills): skip literal dollar discovery

* fix(ui): replace the broken terminal tab underline (#124875)

* fix(ui): redesign dock panel tabs

* fix(ui): remove stale terminal tab overrides

---------

Co-authored-by: RoboClaw <[email protected]>

* fix(tui): close selection overlays and report rejected handlers (#124876)

openSelector's onSelect fired the async handler with void and only
closed the overlay after a successful await. A rejecting handler (e.g.
setAgent -> setSession against a failing gateway) left the selector
stranded open with an unhandled rejection: the TUI froze on the picker
with no visible cause — a silent dead-end.

Root cause: failure path missing from the overlay lifecycle. The
handler now catches, surfaces the cause via chatLog, and always closes
the overlay.

Regression: /agent selection with a rejecting setSession asserts the
overlay closes and the cause reaches the chat log — fails pre-fix.

* fix(ui): make terminal open failures retryable (#124890)

* fix(sandbox): surface list probe failures instead of empty results (#124881)

sandboxListCommand and fetchAndFilterContainers swallowed backend and
registry probe failures with catch(() => []). A broken Docker daemon or
corrupt registry rendered as 'No sandbox runtimes found.' — and in
recreate, filtered an entire fleet down to nothing — indistinguishable
from a clean empty state. --json emitted a success envelope for a
failed probe.

Root cause: failure collapsed into the empty success shape at the
consumer. The listers now propagate; the sandbox CLI runner already
owns the error path (message + exit 1), and the new --json failure
contract (6c66f48a7c1) emits the JSON error envelope.

Regression: replaced the test that enshrined the masking ('handle
errors gracefully' asserting the empty-state message) with the
propagation contract — fails pre-fix.

* fix(tui): report the first last-session write failure (#124886)

* fix(tui): report the first last-session write failure

rememberCurrentSessionKey swallowed writeTuiLastSessionKey failures
with catch(() => undefined). A corrupt or locked state DB silently
disabled session restore: the operator only discovers it on next
launch, landing in the wrong session with no clue why.

Root cause: fire-and-forget with no recorded failure. The write wrapper
moved to its owner (tui-last-session.ts) as
createRememberSessionKeyWriter, which surfaces the first failure via
the chat log ('session memory write failed: ...') and stays silent on
repeats — one line per TUI run, not one per session switch. Empty and
'unknown' keys still skip without touching the writer.

Regression: colocated tests prove first-failure-once reporting and the
skip path — fail pre-fix (factory did not exist; failure was
swallowed at the call site).

* chore(tui): make the last-session write dependency explicit

deadcode:exports rejects writeTuiLastSessionKey as unused when only the
factory default referenced it; tui.ts now passes it explicitly.

* fix: remove delivery markers from historical sessions (#124888)

* fix(sessions): migrate historical transcript directives

* fix(infra): complete directive migration on pre-archives-schema databases

session_transcript_archives is a lazy additive v17 surface; valid databases
may omit it. The archives phase now treats the missing table as empty and
completes the cursor instead of warning-skipping the whole database forever.
Verified against a real long-lived agent DB: previously stuck cursor
completes with zero warnings in ~100ms.

* chore(ci): allow directive migration SQLite access

* fix(sessions): report self-archive before stopping the turn (#124896)

* feat(agents): record agent creation provenance and add roster tree listing (#124828)

Adds an additive agent_provenance table (shared state DB, schema v8) owned
by src/state/agent-provenance.ts. createAgent() records operator/agent
provenance after commit, the system-agent create-agent operation passes its
own id as creator, and Claw installs record created-via claw at their roster
commit point. Agent deletion removes the agent's own row inside the deletion
journal transaction; children keep dangling creator ids as historical fact.
openclaw agents list gains --tree (provenance hierarchy) and JSON provenance
fields.

* fix(ui): keep message presentation stable when expanded (#124898)

* fix(gateway): stop a plugin dangerous flag from revoking desktop computer.act (#124863)

* fix(gateway): stop a plugin dangerous flag from revoking desktop computer.act

`resolveNodeCommandAllowlistInternal` subtracted every plugin-declared
dangerous command from the composed allowlist, including core's own
`PLATFORM_DEFAULTS` entries and including the pairing allowlist, where core's
dangerous defaults are exempted. `computer.act` is both a desktop platform
default (grant = node-local enablement + pairing approval) and a command that
`registerComputerUseProvider` marks dangerous. Since `cua-computer` became
enabled-by-default on darwin, every macOS-hosted Gateway stripped `computer.act`
from both allowlists, so `normalizeDeclaredNodeCommands` dropped it from the
node's declaration with no pairing upgrade, no prompt, and no record. The
`computer` capability survived because caps were never allowlist-filtered, and
the `computerUse` descriptor was then dropped for the missing command.

Scope the plugin-dangerous subtraction to commands outside the platform-default
base: the flag still keeps a plugin's own surface behind an explicit allow and
still forces a registered invoke policy, but it no longer revokes a command core
declares itself.

Also make cap-without-command unrepresentable. `retainFulfilledNodeCapabilities`
drops a capability when policy withheld commands from its family and admitted
none, and the reconciler records the withheld commands so a refused declaration
is never silent.

* test(gateway): type the computer-use fixture against its contract

* fix(doctor): partition retired session stores (#124846)

Recover owner-qualified rows from the retired top-level session store into each configured agent database without guessing ambiguous ownership. Relocate stale transcript paths, tolerate historical Unicode IDs when an explicit transcript exists, and avoid double-counting physical SQLite databases in migration totals.


Amp-Thread-ID: https://ampcode.com/threads/T-01a00a6a-b64e-74a5-8b15-2d3b966a468d

Co-authored-by: Amp <[email protected]>
Co-authored-by: Josh Lehman <[email protected]>

* perf(ci): price agents-core-models from its measured hybrid wall

`agentic-agents-core-models` carried the 36s scaled estimate while measuring
56.3s (n=6, p90 58.6s) across 260 compact jobs on 2026-08-16. Packed beside
`agentic-agents-core-runtime-hosted-1` (60.4s) it built the only bin running
>=1.25x its prediction: compact-large-19 ran 122s of work priced at 88s, which
made it the most frequent slowest job in the workflow.

Add the measured value to the hybrid hint map, which already exists for exactly
these Blacksmith-specific observations. The packer then separates the two, and
the tallest actual compact bin drops 122s -> 109s with no bin above 1.25x and
no change to row counts (48 push / 56 pull-request), so this costs no extra
runner registrations.

Two things deliberately left alone. The `agentic-gateway-core-3` 140s pin looks
like a 2x over-prediction against its 68.5s median, but run 31938297538 really
did take 138.0s (109.03s + 28.98s across its two configs) on a run whose fleet
slowdown factor was 0.98 -- a genuine tail on a healthy run, so unpinning it
would rebuild a >200s bin whenever the tail lands. Every other bin already sits
within 1.24x of its prediction.

The replaced guard pinned one bin arrangement (`runtime-hosted-1` not sharing a
job with `agents-core-tools`) with no stated failure mode, so any honest refit
broke it. It now asserts the property that comment was reaching for -- both
weight sources survive rebalancing under the body ceiling -- plus the specific
regression this fixes. Mutation-checked: dropping the hint fails the new guard.

Measurement note for the next refit: sum a shard's per-config Duration lines
before taking a median. Pooling them reads as a large over-prediction that is
not there.

* fix(codex): prevent app-server leaks after desktop fallback (#124885)

* fix(codex): reuse app server after managed fallback

* test(codex): opt relay fixtures into loop detection

* fix(ui): add spacing between suggested task actions (#124900)

* fix(ui): separate suggested task card actions

* test(ui): keep task suggestion spacing check lint-safe

* fix(ui): drop duplicate plan card summary (#124895)

* fix(backup): give backup create actionable output errors (#124894)

* fix(backup): give backup create actionable output errors

* fix(backup): preserve output errors for debug

* fix(test): create sessions in default Control UI mock (#124912)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b6b-e4e9-74af-bb31-30363fae6c89

Co-authored-by: Amp <[email protected]>

* fix(plugins): adopt root context engines on caller-owned handles (#122457)

Keep caller-owned agent runtime registries in discovery mode so full-only
plugins cannot replace process-global sandbox backends. Copy runtime
context-engine factories from the composition-root registry instead.

Co-authored-by: Josh Lehman <[email protected]>

* docs(codex): clarify loop relay behavior (#124918)

* fix(gateway): terminalize stale worker dispatches (#124920)

* refactor(ui): simplify chat history pagination (#124921)

* test(gateway): make archive lifecycle waits deterministic (#124923)

* fix(android): remove completed plan strikethrough (#124916)

* fix(plugins): restore caller-owned workspace plugin-root projection

#124844 made resolvePluginMetadataSnapshot synthesize workspacePluginRootPresent
itself with a process-memoized fs.existsSync probe whenever a caller did not
supply it. That fact is owned by the prepared-model-runtime lease, which resolves
it only for real agent runs (resolveWorkspacePluginRootPresence) and passes it
explicitly, so the probe silently turned an opt-in fast path into the default for
unrelated control-plane callers.

Gateway startup config validation is one of them. It never asserts the fact, so it
began projecting the published lifecycle graph instead of loading a fresh one, and
the projection derives configFingerprint from that graph rather than a real load.
Startup convergence rewrites the persisted plugin index between the two reads that
form the migration checkpoint identity, so the pre-convergence read projected while
the post-convergence read loaded. The two pluginMigrationFingerprint values differed
and the gateway refused readiness with "OpenClaw plugin migration inputs changed
during startup convergence", failing every config-patch restart.

Deleting the probe restores one owner for the fact and a net-negative production
diff. The agent-side hunks of #124844 are untouched: they still pass the fact
explicitly from the lease.

Root cause: admission fact manufactured outside its lifecycle owner.
Owner boundary: src/agents/prepared-model-runtime-lease.ts owns workspace
plugin-root presence; src/plugins/plugin-metadata-snapshot.ts only consumes it.
Production LOC: -18.

Fixes red main ci-gate: QA Smoke memory-dreaming-sweep, matrix-restart-resume,
matrix-post-restart-room-continue.

* fix(doctor): preserve migrated session owner (#124928)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00a6a-b64e-74a5-8b15-2d3b966a468d

Co-authored-by: Amp <[email protected]>

* refactor(webui): read slash commands through the chat metadata store (#124931)

* fix(doctor): stop reporting phantom shared auth migrations (#124929)

* fix(cron): stop advertising inactive JSON defaults (#124903)

* fix(cron): make --json help match behavior

* fix(cron): preserve scratch write JSON output

* test(cli): classify cron JSON result commands

* fix(ui): remove dashboard card text underlines (#124939)

* fix(agents): refuse add when prompts cannot run (#124940)

* test(ui): assert steer order by rendered position (#124905)

* fix(plugins): keep migration metadata authoritative (#124924)

Restrict exact config identity trust to prepared runtime generations and force startup convergence to verify against a fresh authoritative plugin snapshot.

* test(mistral): wait on delivered transcripts after reconnect (#124935)

* test(mistral): wait on delivered transcripts after reconnect

* test(nvidia): assert the remaining catalog fetch budget as a bound

* fix(cli): show actionable guidance for mistyped commands (#124892)

* fix(cli): render unknown commands as guidance

* fix(cli): keep parse JSON terminal-neutral

* refactor(sdk): source wire models from gateway-protocol schemas (#124943)

* test(ui): split chat follow-up E2E suite (#124938)

* fix: honor provider timeouts during stuck-session recovery (#123877)

* fix(diagnostics): respect active model request timeouts

* chore(diagnostics): keep recovery activity internal

* test(diagnostics): await stream wrapper results

* fix(diagnostics): harden provider timeout recovery

* fix(diagnostics): track compaction model calls

* test: prove provider timeout recovery boundary

* fix(config): reject scalar config roots instead of loading defaults (#124945)

A config file whose JSON5 root parsed to a scalar (null, a number, a
bare string — the classic truncated/clobbered file) hit a special case
in loadConfigFromContext that returned {} with a snapshot marked
valid: true. Three failures in one: the process silently ran with
defaults while the operator's real config (channels, auth, allowlists)
disappeared; the valid snapshot could promote the corrupt file's
fingerprint as lastKnownGood, poisoning the clobber-recovery machinery
that exists to catch exactly this; and the load path contradicted the
snapshot path, which correctly reported the same bytes invalid.

Root cause: an early-return that collapsed invalid input into the
empty-config success shape. Deleted; a scalar root now flows into
validateConfigObjectWithPlugins, fails schema validation, records a
valid:false snapshot, and throws INVALID_CONFIG — same as an array
root, same as the snapshot path, handled by doctor's invalid-config
recovery.

Regression: new io.scalar-root.test.ts (null/number/string roots all
throw INVALID_CONFIG; snapshot agrees invalid) — all 3 fail pre-fix.
Updated the compat warning-fingerprint test that relied on null-root
loading as defaults.

* fix(security): prevent approved scripts from changing before execution (#124858)

* fix(security): bind exec approvals to mutable operands

* test: align approval fixtures with operand binding

* fix(security): close durable operand binding gaps

* fix(security): preserve independent exec policy grants

* improve(ui): simplify widget preview chrome (#124883)

Co-authored-by: RoboClaw <[email protected]>

* fix: deliver requested image artifacts across agent runtimes (#124910)

* fix: distinguish image inspection from delivery

Clarify that image-reading tools only load private model context, prefer native Codex image inspection when available, and preserve explicit outbound tool media across Claude CLI loopback runs.

Co-authored-by: pash <[email protected]>

* fix: propagate CLI vision capability

* chore: refresh CI after main fix

---------

Co-authored-by: pash <[email protected]>

* fix(ci): derive plugin SDK boundary cache inputs (#124897)

* feat: add cloud worker profiles and machine selection (#124864)

* feat(workers): add per-dispatch machine classes

* feat(ui): add cloud worker machine picker

* feat(tts): add structured reply speech fields (#124913)

* feat(tts): add structured reply speech fields

* fix(tts): keep transcript directive parser acyclic

* fix(tts): drop unused directive fact export

* fix(outbound): preserve reply-payload metadata through response prefixes

The response-prefix rebuild spread the payload without its metadata carrier,
dropping structured speech facts (and any other payload metadata) whenever a
channel responsePrefix applied. Rebuild via copyReplyPayloadMetadata.

* fix(tts): keep voice-only sends visible when the speech runtime is cold

A structured voiceText-only send with no visible text returned unchanged from
the cold-runtime guard, so delivery normalized the empty payload to null and
the send silently vanished. The cold exit now applies the same visible
fallback as synthesis failure: explicit spoken text materializes as payload
text when no other content exists.

* fix(qa): isolate capture store startup (#124949)

* refactor(channels): align approval reaction bindings (#124942)

Split Signal approval routing into its concept-owned module and call the shared SDK binding helpers directly.

Reject persisted reaction targets when any allowed decision is invalid or duplicated, rather than retaining a valid subset from a corrupt transient record.

* docs(agents): harden live-test and capture-inspection requirements

Live verification of user-facing behavior is the default before landing,
with skips requiring a stated infeasibility in the PR; captured
screenshots/videos count as evidence only after the agent inspects them
in frame.

* refactor(ui): define sidebar panel contract (#124950)

* improve(ui): move session status to second row (#124960)

* improve(ui): move session status to second row

* test(ui): align session row layout expectations

---------

Co-authored-by: RoboClaw <[email protected]>

* docs: clarify model switching guidance (#124889)

* docs: clarify model switching guidance

* docs: warn that reasoning changes invalidate cache reuse

---------

Co-authored-by: RoboClaw <[email protected]>

* fix(ui): stop duplicate dashboard session queries (#124968)

* fix(doctor): surface legacy-config copy failures (#124948)

* fix(doctor): surface legacy-config copy failures

maybeMigrateLegacyConfig swallowed every copyFile error with a bare
catch whose comment claimed EEXIST-only. EACCES, ENOSPC, and
cross-device failures were silently ignored: the operator's
~/.clawdbot/clawdbot.json exists, migration was attempted and failed,
and doctor proceeded as a clean fresh install with no config, no change
note, and no warning.

Root cause: failure collapsed into the skip-silently success shape. The
catch now rethrows anything other than EEXIST with the source/target
paths in the message; EEXIST (config already at the target) keeps its
skip semantics.

Regression: read-only target dir makes the preflight reject with
'Failed to migrate legacy config' — fails pre-fix (resolved as a clean
run); companion test proves the successful copy path still migrates.

* chore(doctor): annotate the errno assertion for the safety ratchet

* refactor(doctor): narrow the copy error without a type assertion

The assertion-safety ratchet flagged the errno cast; property narrowing
removes the assertion instead of annotating it.

* fix(android): show plan status and explanation (#124958)

* fix: scale Gateway RSS diagnostics to runtime limits (#124914)

* fix(logging): scale RSS pressure to runtime limits

Derive Gateway RSS warning and critical thresholds from the smaller of the effective V8 heap and OS process limit. This preserves heap and rapid-growth pressure detection while avoiding routine false alerts on large heaps.

* test(logging): narrow optional heap fixture

* fix(logging): bound process memory sentinels

* test(logging): pin Bun physical memory fixture

* refactor(channels): delete the per-turn progress receipt line (#124972)

The finished-turn digest ('🧠 N thoughts · 💬 N notes · 🛠️ N tool calls ·
⏱️ Ns') was synthesized onto three surfaces: Slack's Block Kit card footer
(removed in #123851), Discord's final-answer subtext, and a duplicate Telegram
implementation added to match Discord.

Nothing gated it — no config key for the receipt has ever existed on any
channel — so PR #122976, which deleted it from Slack's native progress surface,
could only ever be a partial removal. Finish it: live progress surfaces keep
their in-flight indicators, and a finished turn leaves the answer with nothing
synthesized appended.

Telegram's window collapsed *into* the digest, so it now retires like every
other surface; Discord already discarded its draft after the final landed. The
core tracker keeps only the live counters Slack's working footer reads.

* feat(agents): preserve create request provenance (#124963)

* refactor(types): discriminated unions for internal contracts — wave 2 (#124959)

* fix(gateway): surface blocking startup progress (#124309)

Keep Gateway admission sidecar-gated while surfacing retryable startup progress in TUI and Control UI.

Unify deferred startup ownership and shutdown draining so late workers, plugin services, and sidecars cannot outlive transport teardown.

Co-authored-by: RoboClaw <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>

* test(node-host): own proxy tunnel lifecycle

* fix(codex): preserve resumed session usage (#124969)

* fix(doctor): report malformed final JSONL records (#124977)

Co-authored-by: Amp <[email protected]>

* feat(agents): show creation hierarchy in Control UI (#124967)

* feat(agents): show creation hierarchy in Control UI

* chore(protocol): regenerate Swift agent model

* refactor: consolidate record guards (#124970)

* fix: plugin tools disappear from Codex and restricted profiles (#124947)

* fix(memory): make standing intents reachable

* fix(agents): dedupe macOS read path variants

* docs(plugins): document profile tool metadata

* test(codex): complete prepared runtime fixtures

* fix(agents): preserve prepared tool boundaries

* fix(cli): prevent node/device RPCs from corrupting shared state (#123674)

* fix(cli): prevent node/device RPCs from corrupting shared state

* fix(cli): keep gateway RPC transport state read-only

* fix(cli): preserve doctor lint config isolation

* fix(cli): keep gateway RPC transport state read-only

* fix(gateway): keep auth preflight state read-only

* fix(cli): preserve SQLite artifacts in read-only RPCs

* fix(infra): remove stale identity store import

---------

Co-authored-by: VACInc <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>

* fix(codex): reject malformed native tool arguments (#124649)

* fix(codex): reject invalid native tool arguments

* fix(codex): preserve raw argument preparation

Signed-off-by: sallyom <[email protected]>

---------

Signed-off-by: sallyom <[email protected]>
Co-authored-by: sallyom <[email protected]>

* feat: main-session agent-wide visibility + session.groupScope routing (#124965)

* feat: add main session group routing

* docs: explain main session routing scopes

* fix: align memory session visibility

* test(qa): cover main-scoped group bindings

* fix(sessions): preserve binding-scoped outbound routes

* fix(routing): preserve explicit outbound owners

* fix(sessions): recognize global main visibility

* chore(ci): prune assertion safety baseline

* fix(installer): finalize deferred PATH installs successfully (#124678)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00ae0-190d-718b-8a76-b75f3e8d1fae

Co-authored-by: Amp <[email protected]>

* fix(cli): align agent exec with system owner (#124697)

* fix(onboard): run channel hooks after config commit (#124736)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00ae0-190d-718b-8a76-b75f3e8d1fae

Co-authored-by: Amp <[email protected]>

* fix(ui): hide mobile transcript metadata until tap (#124936)

* fix(ui): reveal mobile message metadata on tap

* fix(ui): centralize mobile transcript disclosure

Co-authored-by: Vyctor H. Brzezowski <[email protected]>

---------

Co-authored-by: RoboClaw <[email protected]…
SemonCat pushed a commit to SemonCat/openclaw that referenced this pull request Aug 17, 2026
Gateway health, suspend, and resume now preserve shared SQLite state when the target is unreachable.

Related: openclaw#101290

Follow-up to openclaw#123674
SemonCat pushed a commit to SemonCat/openclaw that referenced this pull request Aug 17, 2026
…claw#123674)

* fix(cli): prevent node/device RPCs from corrupting shared state

* fix(cli): keep gateway RPC transport state read-only

* fix(cli): preserve doctor lint config isolation

* fix(cli): keep gateway RPC transport state read-only

* fix(gateway): keep auth preflight state read-only

* fix(cli): preserve SQLite artifacts in read-only RPCs

* fix(infra): remove stale identity store import

---------

Co-authored-by: VACInc <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 18, 2026
Gateway health, suspend, and resume now preserve shared SQLite state when the target is unreachable.

Related: openclaw#101290

Follow-up to openclaw#123674
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 18, 2026
* fix: keep device identity reads lock-free

Amp-Thread-ID: https://ampcode.com/threads/T-01a00ae0-190d-718b-8a76-b75f3e8d1fae

* feat(lint): enforce import ordering and deduplication (#124730)

* refactor(imports): dedupe and hoist imports

* feat(lint): enforce import/no-duplicates and import/first

* feat(voice-call): sessionScope "main" routes calls into the agent main session (#124708)

* feat(voice-call): add sessionScope "main" for main-session call routing

Inbound and outbound calls can now share the configured agent's main
session instead of a dedicated voice session. The new scope resolves
through the existing explicit-key canonicalization path, honoring core
session.mainKey and global-scope aliasing. The inbound webhook path now
forwards coreSession like every other resolver call site.

* style: format events.test.ts

* test(voice-call): split events.test.ts under the max-lines cap

* fix(cli): forward agent name through setup (#124740)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b6b-e4e9-74af-bb31-30363fae6c89

Co-authored-by: Amp <[email protected]>

* refactor(mcp): centralize tool filter policy (#124739)

* fix(agents): preserve restart-unsafe delivery evidence (#124737)

* fix(ci): snapshot synced Testbox candidates (#124743)

Co-authored-by: Amp <[email protected]>

* fix(ci): keep QA evidence output repo-relative (#124760)

* fix(cli): allow hook toggles to select an agent (#124761)

* test(upgrade): drop retired agent context assertion (#124765)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00a6a-b64e-74a5-8b15-2d3b966a468d

Co-authored-by: Amp <[email protected]>

* fix(skills): report missing ClawHub skills as not found (#124764)

* feat(codex): show sessions from additional homes (#124660)

* feat(codex): register additional session homes

* fix(codex): preserve automatic session homes

* docs(codex): explain automatic home discovery around sessionCatalog.homes

---------

Co-authored-by: IWhatsskill <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>

* fix(qa): preserve effective fast mode (#124762)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b6b-e4e9-74af-bb31-30363fae6c89

Co-authored-by: Amp <[email protected]>

* fix(ui): keep Control UI device identity working on plain-HTTP origins (#124724)

* fix(ui): keep Control UI device identity working on plain-HTTP origins

@noble/ed25519 defaults its SHA-512 provider to crypto.subtle, which
browsers gate to secure contexts, so device identity silently vanished
on http:// LAN dashboards and connects fell back to shared-credential
auth with no pairing. Wire a lazy pure-JS @noble/hashes fallback for
SHA-512 and the fingerprint SHA-256, and drop the isSecureContext gate
in the connect path. Secure contexts keep the platform digests and pay
no startup bytes: the fallback loads as its own lazy chunk, kept out of
the gateway-runtime startup chunk on purpose.

* test(ui): cover device identity minting and signing without crypto.subtle

New jsdom regression suite fails on pre-fix code (subtle-less crypto stub
with getRandomValues, which real insecure contexts keep). Rewrites the
gateway connect tests that previously asserted the device-less insecure
fallback: an insecure context now attaches a device identity.

* docs(web): plain-HTTP dashboards now pair with a device identity

The signing key never crosses the wire, so HTTP+pairing is strictly
stronger than the old HTTP token-only fallback; HTTPS (Tailscale Serve)
stays the recommendation for transport privacy.

* fix(ui): drop unnecessary boolean literal compare in secure-context timing meta

* test(ui): declare device.id on the connect-frame test shape

* test(ui): split the subtle-less scope-upgrade e2e into the two real invariants

Without crypto.subtle the browser can now sign, so the banner offers the
explicit admin upgrade; manual-only guidance is reserved for browsers that
cannot mint an identity at all (no WebCrypto RNG). Also corrects the
connect-path comment: blocked storage yields an ephemeral identity, only a
failed mint degrades device-less.

* fix(ui): address review findings on the HTTP device-identity path

- Storage-blocked pages keep one stable in-memory identity per page
  lifetime instead of minting a fresh unpaired key on every reconnect,
  and a write-rejecting store no longer fails the mint (regression tests
  bite pre-fix).
- Connect timing now reports the real browser secure-context fact via a
  shared browserSecureContext() helper instead of inferring it from
  device-identity presence.
- Docs state the accepted trusted-proxy contract: browsers attach a
  device identity on every origin, so first connects follow the standard
  pairing flow (deviceAutoApprove or a one-time approval); device-less
  admission remains only for browsers that cannot mint an identity.

* refactor(ui): trim the connect-path additions under the max-lines cap

* fix(line): retry lost pushes without duplicating an accepted send (#124464)

A LINE push made exactly one attempt, so a transient provider or transport
failure dropped the reply even though retrying was safe to do. Retrying alone
would have duplicated a send LINE already accepted, so every push now carries an
X-Line-Retry-Key and reuses it across attempts: LINE answers a replayed key with
409 and the accepted request's sent messages, which resolves to the original
delivery instead of a second message.

Retries follow LINE's documented policy - server errors and transport failures
only, never 2xx, 409 or any 4xx - and run through the shared channel API retry
runner in strict mode. Replies stay single-attempt because LINE offers no retry
key for them.

* fix(outbound): record queue-write loss and fail every payload on prep abort (#124756)

* fix(outbound): record queue-write loss and fail every payload on prep abort

Two silent-observer gaps in the outbound queue admission path:

1. Best-effort staging/queue-write failures were swallowed with a bare
   'return null'. The send proceeded live-only, so a crash mid-send lost
   the message with zero forensic trace of why the write-ahead row was
   missing. Every sibling degradation on this boundary logs
   (persistQueuedPreSendState, the dispatch-refresh fallback); this one
   now warns with channel/target and the error.

2. Batch preparation failure emitted message_sent for only the first
   payload while audit emitted per-payload terminals, so plugins with
   message_sent hooks saw 1 failure for an N-payload batch. The failure
   path now emits one hook failure per logical payload, matching the
   audit terminals and the recovery sibling's
   queuedTerminalFailureEvents. The unused error.payload pick and its
   OutboundPayloadPreparationError import went with it.

Regressions: queue-write warn asserted in the existing best-effort
fallback test; new multi-payload prep-failure test asserts 2 hook
failures. Both fail pre-fix.

* chore(outbound): keep OutboundPayloadPreparationError module-local

Last external consumer went away with the per-payload emit; the
deadcode:exports gate rejects unused exports.

* refactor(gateway): drop dead session-subscriber registry surface (#124754)

* refactor(gateway): drop dead session-subscriber registry surface

getForConnection and both registry clear() methods had no production
callers — only server-chat-state.test.ts consumed them (verified by
repo-wide grep incl. plugin-sdk). The recency-sorted connToSessionKeys
index existed solely so getForConnection returned keys in subscription
order, an ordering nothing read, rebuilt via toSorted() on every
subscribe/unsubscribe/settle — including the provisional-replay settle
path.

unsubscribeAll now reads the reverse index directly from
connToSessionRecency's keys (same contents, no ordering), removing the
per-call O(k log k) rebuild and the duplicate map. Tests assert through
get()/getApprovals(), the production read paths, per test-audit norms.

Behavior-neutral: subscription state transitions and event-visible
delivery unchanged; chat-state, broadcast, node-subscription,
instance-runtime, agent-events, session-events suites pass.

* test(gateway): fix ETXTBSY flake in workspace-sync candidate bounding

The test rewrote its mock git script between two createGitTransferList
calls. On Linux CI the second spawn can race a lingering fork of the
first child still holding the script's write fd, failing exec with
ETXTBSY. Write the script once; vary the entry count through a data file
the script reads instead.

* fix(config): preserve migration notice paths (#124719)

* fix(runners): preserve device sessions through lifecycle faults (#124744)

* test(runners): cover paired-node lifecycle wire

* fix(runners): preserve retryable device lifecycle

* test(runners): keep wire fixture internals local

* fix(runners): stop fallback on device capacity

* fix(doctor): keep identity probe within typed storage APIs

Amp-Thread-ID: https://ampcode.com/threads/T-01a00ae0-190d-718b-8a76-b75f3e8d1fae

* fix(openai): keep setup auth choices consistent (#124729)

* fix(openai): centralize setup auth metadata

* refactor(openai): overlay auth hooks in place

* fix(tasks): cancel subagents through gateway (#124752)

* fix: honor context caps on Codex-routed models (#124735)

* fix(codex): forward authored context caps

* test(codex): keep binding fixtures uncapped

* fix(agent-harness): separate authored context cap

* fix(config): render actionable validation errors (#124763)

* fix(config): render actionable validation errors

* fix(config): cover service and gateway validation

* docs: remove agent-hierarchy guardrail from VISION roadmap

Agent-created agents (durable roster entries with provenance) are now
planned work, so the blanket VISION.md guardrail against agent-hierarchy
frameworks no longer reflects direction. The adjacent guardrail against
heavy duplicative orchestration layers stays.

* fix(gateway): preserve worker lifecycle failure reasons (#124774)

* fix(cli): explain empty directory lookups (#124753)

* fix(cli): explain empty directory lookups instead of printing nothing

* fix(cli): distinguish unsupported self lookups

* fix(codex): honor session node exec host (#124777)

* refactor(line): replace nine-marker prompt DSL with typed rich messages (#124755)

* refactor(line): replace nine-marker prompt DSL with typed rich messages

Delete the LINE plugin's double-bracket marker language (quick_replies,
location, confirm, buttons, media_player, event, agenda, device,
appletv_remote) and its parser. Portable interactions now flow through the
existing presentation-block seam (renderPresentation, matching Discord and
Feishu); LINE-specific cards ride closed channelData.line schemas mapped to
the existing Flex renderers. Prompt section shrinks to four capability
lines and explicitly de-fangs marker text. Removes the stale
assertion-safety baseline entry for the deleted parser.

Production LOC net -69, tests net -433. Suite: 510/510 green.

* fix(line): declare rich message schema dependency

* fix(line): satisfy rich message type checks

* docs(line): mark card fragments as partial

* feat(ui): surface approvals passively and redesign the approval card (#124767)

* feat(ui): surface approvals passively and redesign the approval card

Approvals no longer auto-open the centered modal: the queue is reachable
only through the sidebar attention chip, while the owning session shows
the inline card and other sessions surface via the session-row shield
icon, agent badges, and the chip. Deletes the inline-vs-modal exclusion
machinery (modalApprovalQueue, inlineApprovalId, forceShowAll) and makes
modal dismissal close the view instead of denying the active request.

Card: severity now drives the accent color instead of a table row,
plugin/agent render as header chips, the session key moves behind a
collapsed Details disclosure (modal only), and low-value exec rows
(Resolved/Security/Ask) collapse into the same disclosure. The codex
app-server bridge stops duplicating the session key into description
text; the envelope already carries it.

* fix(ui): gate settings Escape on the approval dialog's recorded open state

ClawSweeper caught that shouldIgnoreSettingsEscape still inferred an open
approval dialog from queue non-emptiness; with passive approvals a pending
queue no longer implies a visible dialog, so settings would swallow Escape.
The exec-approval element now records dialogOpen as a fact and the guard
reads it.

* refactor(channels): carry typed approval-prompt bindings through signal/imessage send seams (#124742)

The Signal and iMessage channel plugins inferred approval prompts by
regex-sniffing rendered message text (header matching like 'Exec approval
required', /approve command parsing), violating the transport-only channel
doctrine: approval actions must stay typed until channel encoding.

The typed envelope already existed (channelData.execApproval with
approvalId/approvalKind/allowedDecisions) and every payload-level delivery
path consumed it; the regex paths were redundant re-derivation at the raw
send seam plus restart recovery for in-memory iMessage poll state.

- Signal: delete send-level prompt sniffing entirely; all approval sends
  already flow through typed structured-payload or native-handler paths.
- iMessage: sendMessageIMessage takes a typed approvalPrompt binding
  (id/kind/decisions) from the native approval handler instead of an
  approvalKind flag plus text re-parsing.
- iMessage poller: persist pending poll targets in the plugin keyed store
  so restart recovery no longer regex-scans chat history; typed recent-chat
  discovery for handle-only DM targets stays. Split poll-target ownership
  into approval-reaction-poll-targets.ts (max-lines).
- Plugin SDK: remove extractApprovalReactionPromptBinding — beta-only
  surface, never in a stable release, so no deprecation window applies;
  AGENTS.md now records that rule.

Accepted tradeoff: approval prompts delivered by a pre-upgrade process are
not rediscovered from chat text after restart (<=24h transient state;
persisted reaction bindings and event-driven tapbacks still work).

* fix(ci): select aggregate QA evidence by manifest (#124802)

* docs: correct code mode runtime contract (#124792)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b7c-b9f0-73d5-8fb7-e619e8e458e1

Co-authored-by: Amp <[email protected]>

* fix(ci): invalidate extension boundary cache for attempt types (#124800)

* refactor(plugin-sdk): consolidate session catalog families (#124801)

* fix(memory): fail corrupted index commands (#124770)

* fix(memory): fail corrupted index commands

* fix(memory): preserve promotion output limit

* fix(memory): keep ranked promotion output

* feat(codex): name additional session-catalog homes (#124807)

* fix(state): copy-safe agent database registry via state-relative paths (schema v9) (#124728)

* fix(state): store in-root agent database registry paths relative to the state dir (schema v9)

Copied state directories retained stale absolute agent database registry rows. The combined gateway store then merged old and new copies, causing every sessions.list request to fail with SessionCanonicalKeyMigrationRequiredError.

Schema v9 stores in-root registry paths relative to the state directory; migration rewrites eligible rows, deletes stale duplicates, and preserves external paths.

* fix(voice-call): describe state-relative registry migration

* fix(state): preserve registry locator traversal

* test(macos): move PortGuardian schema-version boundary to v9

The store opens any state database up to maximumSupportedSchemaVersion,
which the schema v9 bump moved from 8 to 9. Shift the supported/newer
partition in the boundary test accordingly.

* fix(state): re-anchor copied default-layout registry rows instead of deleting them

Resolve the ClawSweeper P1 by preserving genuine external default-layout registrations, re-anchoring copied rows when an in-root counterpart exists, and deleting only dual default-layout conflicts.

* fix(upgrade): retain owners in legacy cron stores (#124809)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00a6a-b64e-74a5-8b15-2d3b966a468d

Co-authored-by: Amp <[email protected]>

* feat(tools): prompt proactive widget use (#124810)

* fix(ui): stop stale clients from acting connected (#124772)

* fix(ui): stop stale clients from acting connected

Carry reload metadata on terminal Control UI build rejections, render an explicit refresh-required recovery state, fence reconnect-only actions, and surface disconnected approval failures with accessible modal controls.

* fix(ui): preserve reconnecting session drafts

* fix(ui): preserve offline preference intent

* fix(ui): return owned fallback digest bytes

* test(ui): follow passive approval presentation

* fix(ui): distinguish stale builds from protocol mismatches

* style(ui): format gateway recovery phase

* refactor(validation): type producers and drop internal re-validation — pilot lane C (#124808)

* fix(cli): restart disabled installed services (#124786)

* refactor(agents): persist directive facts at the assistant write boundary (#124793)

* refactor(agents): persist directive facts at the assistant write boundary

Assistant final text is now stripped of inline delivery directives once, at
the SessionManager append boundary, with the parsed facts persisted as a
typed openclawDelivery field on the assistant message (openclawDeliveryMirror
precedent, inside event_json — no schema change). Live session state is
replaced with the persisted canonical bytes so same-run continuations and
next-turn store rebuilds never diverge (prompt-cache invariant).

Delivery and restart recovery consume the stored facts instead of re-parsing
persisted text; pre-upgrade in-flight messages without facts intentionally get
no text-parse fallback (commented tradeoff at the read site). Directive
parsing is now code-region aware, so markers quoted in inline code or fences
neither parse nor strip — fixes the empty-code-pill display bug.

The undocumented reaction marker DSL ([[react:]], [[react_to_current:]]) is
deleted; structured message-tool reactions remain the canonical path. Stale
assertion-safety baseline entry removed with the parser.

Production net -10, tests net +38. Focused suites: 9,068 passed; pre-fix
regressions fail for the intended reasons. Codex autoreview clean.

* fix(agents): satisfy directive persistence gates

* fix(config): drop unused directive export

* fix(agents): preserve indented directive examples

* perf(test): remove ClickClack scheduler waits (#124819)

* refactor: split max-lines pilot files and retire suppressions (#124813)

* fix(runners): align reclaim results with runtime (#124791)

* refactor(runners): prepare placement move targets

* fix(runners): preserve normalized dispatch targets

* style(protocol): format reclaim result type

* fix(ui): make light-theme diff syntax readable (#124814)

Co-authored-by: RoboClaw <[email protected]>

* fix(ci): render only aggregate QA evidence (#124823)

* fix(ui): show session changes in review panel (#124824)

* fix(gateway): stop closed clients from restoring session subscriptions (#124771)

* fix(gateway): reject closed session subscribers

* test(gateway): type subscription race params

* test(gateway): use public subscription assertion

* fix(ci): invalidate SDK declarations on attempt types

* chore(ci): align boundary cache comment with main

* fix(gateway): surface failed node event delivery (#124798)

* fix(gateway): surface failed node event delivery

* fix(plugin-sdk): preserve authored context cap

* fix(mcp): make Codex approval dead ends actionable (#124766)

* fix(mcp): make Codex approval dead ends actionable

* fix(mcp): preserve native approval fallback

* fix(mcp): configure saved approval modes

* fix(mcp): preserve saved Codex metadata

* style(mcp): simplify saved metadata spread

* improve(ui): one primary composer button, Enter-steer, Esc-stop, quiet mic, no transcript focus ring (#124799)

* fix(ui): drop the transcript keyboard-focus ring

The .chat-thread:focus-visible 2px inset outline (added in #120693) boxed
the entire main content whenever the transcript took keyboard focus
(Shift+Tab, closing transcript search) and read as a broken border that
stopped above the composer. The transcript stays keyboard-focusable for
scroll keys; it just paints no focus box. Accepted tradeoff: no visible
focus indicator on the scroll container.

* feat(ui): single primary composer button with Enter-steer and Esc-stop

The composer now renders exactly one primary action, always rightmost:
- draft or attachments present: one send-shaped button whose label follows
  the session follow-up mode (Send / Queue / Steer); the stop button no
  longer renders beside it
- empty while a run is active: Stop (tooltip "Stop (Esc)"); Escape in the
  composer aborts the run, deferring to reply-clear and menu precedence
- empty while idle: disabled send labeled "Write a message to send."

Enter on an empty composer while a run is active steers the oldest
steerable queued message — Enter queues, Enter again steers — using the
same eligibility predicate as the queue chip's Steer action (shared
steerableQueuedMessage helper). The mic/dictation control is now always a
compact secondary control left of the primary instead of morphing into
the primary when the composer is empty. Dead ChatRunControlsProps fields
(hasMessages, onExport, onNewSession, showPrimary, showSecondary) and the
composer exportMarkdown wrapper are removed; the assertion-safety
baseline entry for chat-composer.ts shrinks 8 -> 7.

* refactor(ui): quiet the idle composer mic

The idle mic was an accent-tinted two-segment pill (mic + permanently
visible device-picker chevron) that outweighed the primary action. It now
matches the attach button's ghost weight: transparent idle, subtle hover,
and the accent treatment is reserved for the recording and talk-active
states so the idle -> recording escalation reads stronger. The device
picker chevron collapses at idle and reveals on hover/focus-within (kept
always visible on coarse pointers, where dictation matters most; reveal
transition disabled under prefers-reduced-motion). The idle tooltip now
teaches the gesture split — "Tap to talk · Hold to dictate" — while the
aria-label stays "Start voice input".

* refactor(ui): split composer keydown and oversized composer test files

chat-composer.ts crossed the 700-line oxlint budget after the keyboard
additions; the keydown handling (menu routing, history keys, Escape-stop,
Enter steer/send) moves to chat-composer-keydown.ts behind a typed deps
factory. The composer unit tests split their primary-action/keyboard
coverage into chat-composer-actions.test.ts over a shared
chat-composer.test-support.ts, and the catalog/model-discovery e2e cases
move to chat-composer-catalog.e2e.test.ts. Pure moves, no behavior
change; no max-lines suppressions or baseline entries added.

* chore(ui): keep composer test-support ComposerProps internal

The split exported a type nothing imports; the dead-export scan is a
merge gate.

* fix(ui): narrow composer keydown target and adapt keyboard tab-order proof

The keydown split moved two bare textarea assertions into a zero-baseline
file; a single instanceof narrowing at the handler entry replaces both
(the handler only binds to the composer textarea). chat-composer.ts's own
assertion baseline ratchets 7 -> 5. The pointer-activation e2e now walks
the real post-redesign tab order (mic, focus-revealed picker trigger,
then primary send) instead of assuming one Tab.

* fix(ui): gate Enter-steer on the queue chip's visible availability

ClawSweeper P1: the Enter path only required an abortable run, so
offline Enter swallowed the keypress and invoked a steer lifecycle that
returns at !connected with no visible outcome, while the queue chip's
Steer button was correctly hidden behind connected && canCompose. The
keydown path now mirrors the chip's exact boundary (connected, canSend,
abortable, visible queue surface including sessionKey-less pending
rows).

* refactor(ui): align approval page with redesigned approval card (#124816)

* refactor(ui): align approval page with redesigned approval card

Follow up #124767 by carrying severity accents and identity chips onto the standalone approval page.

Remove the unused execApproval.labels severity, plugin, and agent keys.

* refactor(ui): keep approval-page helpers in repo idiom

Reverts drive-by rewrites from the build pass: restore the exhaustive
decisionLabel switch (the ternary lost the never check), the early-return
appliedDecisionMatches, explicit gatewayCode comparisons, and align the
severity mapping shape with the sibling exec-approval-card.ts.

* test(ui): type approval severity fixtures

* test(scripts): wait for a parseable descendant pid in Bun smoke cleanup

The readiness gate only required the descendant pid file to exist, but
existsSync can observe it between open() and write(); a loaded runner
then reads an empty file and the integer assertion flakes (seen on PR
#124816 CI run 31971191374). Readiness now requires parseable content.

* perf(webui): reuse the chat metadata catalog across pages (#124794)

* refactor(webui): centralize chat metadata caching

* test(webui): cover shared chat metadata store

* refactor(webui): move ChatMetadataResult type to its store owner

* fix(webui): let the metadata store own revalidation lifetime

* fix(webui): satisfy no-promise-executor-return in retry delay

* fix(browser): stop local actions when agent turns are cancelled (#124795)

* fix(browser): cancel local actions with agent signal

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b6b-e4e9-74af-bb31-30363fae6c89

* fix(agent-harness): expose authored context cap

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b6b-e4e9-74af-bb31-30363fae6c89

* chore(agent-harness): drop redundant context-cap override

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b6b-e4e9-74af-bb31-30363fae6c89

---------

Co-authored-by: Amp <[email protected]>

* improve(ui): make chat disclosures compact (#124832)

Co-authored-by: RoboClaw <[email protected]>

* fix(gateway): share generated session titles with worktree names and start title work at dispatch (#124787)

Worktree sessions now derive their worktree/branch name from the same
concise generated title the sidebar shows (bounded 8s wait, raw-prompt
slug then crustacean fallback), persisted once as displayName so the
chat-send pass never duplicates the model call. Dashboard title
scheduling moves from the dispatch chain's finally (after the whole
first turn) back to dispatch start, so long or interrupted first turns
no longer leave sessions silently untitled (regression from #122471).
slugifyWorktreeTitle truncates at word boundaries; dead
generatedDisplayName plumbing removed.

* fix(browser): support Chrome Web Store native bootstrap (#124775)

* fix(browser): support Chrome Web Store native bootstrap

* chore: keep browser release note in PR body

* docs(browser): document Store identity trust boundary

* docs(browser): correct Store recovery guidance

* fix(media): bound image-optimize fetch headroom to the image cap (#124838)

When a caller passed an explicit maxBytes with optimizeImages on (the
default), the source-read bound was inflated to max(maxBytes, 100MB
document cap). A channel with a 5MB attachment cap therefore let a
hostile or oversized URL buffer up to 100MB before the final size check
— 20x resource amplification, and the inflation applied before content
classification, so it was not limited to images.

The inflation exists so oversized-but-compressible originals can be
fetched and compressed under the delivery cap. Size that headroom off
the thing that justifies it: 4x the 6MB image cap (24MB), enough for
large phone photos, instead of the document cap.

Accepted tradeoff (named at the constant): originals above 24MB that
would have compressed under the cap now fail; the fetch error names the
bound. Callers without an explicit cap keep per-kind defaults.

Live proof on a real localhost HTTP server (no mocked fetch): an 8.1MB
PNG under a 5MB cap compresses to 3.75MB and delivers; a 30MB-declared
image is rejected at the Content-Length precheck in 7ms with 'content
length 31457280 exceeds maxBytes 25165824'.

Regression: headroom-bound test fails pre-fix (30MB passes the old
100MB bound); companion test proves compression headroom still works.

* fix(channels): route direct DM replies to sender (#124837)

Default direct-message reply context to the authenticated sender address so targetless Reef and Nostr replies do not resolve to the local recipient.

* feat(auto-reply): record message-tool mute outcomes (#124830)

* feat(auto-reply): record message-tool mute outcomes

* fix(auto-reply): require source delivery evidence

* test(infra): preserve historical agent schema fixtures

* fix(agent): preserve implicit roster in configless exec (#124805)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b7c-b9f0-73d5-8fb7-e619e8e458e1

Co-authored-by: Amp <[email protected]>

* fix(delivery): unify terminal settlement ownership (#124825)

* fix(delivery): unify terminal settlement ownership

Treat identityless adapter returns as potentially visible across channel, queue, and cron paths. Let recovery own terminal completion so ambiguity persists as notice debt instead of being double-settled or silently suppressed.

Co-authored-by: ruel225 <[email protected]>

* refactor(delivery): narrow terminal internals

Remove now-unused internal exports after terminal-settlement ownership was consolidated.

* test(tts): preserve message runtime exports

Import and spread the actual message runtime so the focused mock retains every runtime binding while overriding only the durable send core.

---------

Co-authored-by: ruel225 <[email protected]>

* fix(ui): give queued-outbox badges their own outbox icon (#124842)

The sidebar queued-message badge and the composer queue reused the clock
glyph that also marks attached automations, so a session with both showed
two identical clocks distinguishable only by tooltip. Add an outbox tray
icon (Lucide inbox with the roof swapped for a rising arrow) and use it
for queued-to-send surfaces; the clock stays automation/cron-only. The
mock dev fixture now flags one session with hasAutomation so the badge
renders in mocked-dashboard proofs.

* refactor(plugin-sdk): extract stream and SecretRef primitives (#124835)

* refactor(ui): derive cron types from gateway protocol (#124827)

* refactor(ui): derive cron types from gateway protocol

* fix(protocol): preserve cron session target type

* fix(ui): keep sent images visible through history handoff (#124839)

* fix(memory): report indexed SQLite sessions (#124834)

* fix(memory): report indexed SQLite sessions

* refactor(memory): remove unused state path export

* refactor(validation): consolidate boundary guards into schemas (#124820)

* refactor(validation): consolidate boundary guards into schemas — pilot lane B

* fix(meetings): reject non-object browser status

* perf(test): remove Gmail watcher shutdown wait (#124851)

* refactor(types): discriminated unions for internal contracts — pilot lane A (#124845)

* refactor(slack): mark approval headers with typed block ids (#124841)

* feat(ui): add steer-now composer shortcut (#124826)

* fix(slack): drop the tool-call receipt from finished progress cards (#123851)

The Block Kit session card terminalized into a '🛠️ N tool calls · ⏱️ Ns'
footer, leaving a per-turn receipt in the Slack transcript on the default
progress path. PR #122976 deleted the same receipt from the native progress
surface but left this sibling rendering it.

Finished cards now keep only the durable diff stat and the session link;
tool-call and elapsed counters stay live working state. Also corrects the
documented channels.slack.streaming.mode default, stale since #122552.

* fix(agents): keep queued followups from missing post-compaction context (#124850)

* fix(auto-reply): order post-compaction context before followups

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b6b-e4e9-74af-bb31-30363fae6c89

* test(auto-reply): clean compaction workspace fixture

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b6b-e4e9-74af-bb31-30363fae6c89

---------

Co-authored-by: Amp <[email protected]>

* fix(test): propagate parent heavy-check ownership (#124859)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b7c-b9f0-73d5-8fb7-e619e8e458e1

Co-authored-by: Amp <[email protected]>

* fix(cli): emit one JSON failure contract for --json invocations (#124849)

* fix(cli): unify JSON failure output

* test(cli): update skills verify failure envelope

* fix(gateway): preserve prepared plugin metadata under load (#124844)

* fix(gateway): preserve prepared plugin metadata under load

* fix(gateway): project metadata before catalog preparation

* test(agents): assert projected startup metadata

* test(gateway): bind load probes to each finalization wave

* docs(ci): record artifact checkout experiment

* perf(test): reuse postpublish file-cap fixture (#124871)

* fix(protocol): model cron run delivery trace (#124856)

* fix(protocol): model cron run delivery trace

* chore(protocol): refresh generated cron run model

* test: replace assertion chains with typed fixture builders — wave 2 (#124865)

* refactor(security): consolidate path containment onto canonical fs-safe guard (#124870)

* refactor(security): expose canonical path containment modes

* refactor(agents): use canonical path containment guard

* refactor(security): consolidate core path containment sites

* refactor(plugins): consolidate path containment sites

* test(security): cover canonical path containment behavior

* fix(gateway): persist agent turns before acknowledgement (#124857)

* fix(gateway): persist agent turns before acknowledgement

* fix(gateway): revalidate exec approval handoffs

* docs(gateway): clarify durable session ownership

* fix(gateway): reject stale transcript admission targets

* fix(ui): show recovery when Control UI does not render (#124861)

* fix(ui): retire bootstrap fallback after render

* test(ui): avoid returning from Promise executor

* fix(qa): recover repeated gateway restarts through channel ingress (#124746)

* fix(qa): repair repeated gateway restart recovery

* test(qa): satisfy restart recovery checks

* fix(audit): rekey repeated recovery identity

* fix(plugin-sdk): expose authored context cap

* test(android): synchronize process tree readiness

* fix(ui): restore task count badge (#124840)

* fix(ui): align update status card spacing (#124878)

* fix(browser): cancel node discovery with tool runs (#124880)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b6b-e4e9-74af-bb31-30363fae6c89

Co-authored-by: Amp <[email protected]>

* perf(webui): render cached model catalog while the chat pane refreshes (#124868)

* perf(webui): render cached model catalog while the chat pane refreshes

* test(webui): fix seed-test types and shrink assertion baseline

* fix(state): report v9 registry migration row decisions (#124862)

* fix(state): report v9 registry migration row decisions in doctor and logs

* fix(state): consume registry migration summary type

* fix(state): avoid registry path observer import cycle

* fix(workboard): include actual length in bounded-string error

The shared normalizeBoundedString helper in extensions/workboard/src
threw an opaque error like 'comment body must be 2000 characters or
fewer.' whenever an oversize string hit any bounded field. Agents that
posted a long run summary or oversized link URL had no way to tell
how far over the limit they were, so they could not retry with a
trimmed payload.

Include the actual length in the error so the message tells the agent
exactly what to do next:

  comment body must be 2000 characters or fewer (got 3502).

The format applies uniformly to every bounded field routed through
this helper (labels, link URL, link title, link target, comment
body, title, notes, worker log message, session key, run id,
protocol violation detail, etc.) since the helper is the single
canonical owner of the message.

Cover the new format with a focused unit test that pins the regex
for the comment-body repro from #118845 and exercises the six other
bounded fields listed in the issue. Update the existing
gateway.test.ts assertion to allow both the old and new format so
the format change is a forward-compatible improvement.

* test(workboard): align matrix with real normalizeBoundedString consumers

ClawSweeper flagged that the prior matrix at line 31-48 tested
labels/title/notes by manually invoking normalizeBoundedString, even
though those fields use the independent normalizeTitle, normalizeNotes,
and normalizeLabels functions (each with its own generic message).
A regression that drops the (got N) suffix from normalizeBoundedString
would not be caught for those three surfaces — operators would still
see the old opaque error.

This commit narrows the matrix to only the consumers of the shared
helper (comment body, link title, link target, link URL, card id) and
restores the exact labels gateway assertion that should match the
unchanged normalizeLabels error.

Verification: 9/9 inline Node 18 AST harness (node /tmp/verify-pr-118888-v77.mjs);
parent-commit proof-gate (pre-PR helper without the got suffix) fails
4/9 of the post-fix expected messages.

Closes ClawSweeper review on PR #118888 (P2 + P3).

* test: cover Workboard length errors at gateway boundary

* docs: note length-aware Workboard errors (#118888)

* perf(ci): split Windows CI two ways instead of one serial lane

`checks-windows-node-test` ran the whole 222-266s Windows body in a single
Blacksmith lane, so every run that scheduled it finished at 287-334s against a
~180s plateau. Measured across 45 canonical main runs it was the wall in all
seven runs that triggered it (324-519s vs a 210s median elsewhere).

Blacksmith's Windows class admits exactly 2 concurrent jobs (run 31865243804),
which is why the earlier 3-part split failed: its tail queued 211s behind a
finished part. Pin the split width to that measured capacity instead. The two
parts are balanced by measured per-project wall time -- part 1 keeps the old
list 1 plus list 2's non-infra projects (~108s), part 2 takes list 2's infra
project plus the old list 3 (~112s) -- so both land near 113s and the lane
stops setting the wall.

One canonical partition now serves every backend; the github-mode/dispatch
3-part variant and its separate file inventory are gone, along with the
single-lane `task: test` case and the per-row `matrix.runner` the collapsed
lane needed. The complete 65-file Windows inventory is preserved exactly, and
the guards pin the width on both sides (mutation-checked: restoring 3 parts
fails the matrix guard).

* fix: stop forked commands after Gateway timeouts (#124081)

* fix: stop service child trees before timeout completion

* fix: preserve service child root results during cleanup

* test: isolate relay selection from linux spawn wrapping

* refactor: keep service anchor payload internal

* test: validate lifecycle probe pid output

* fix: close service child adversarial races

* fix: preserve service startup failures

* fix(process): flush service output before root result

* fix(process): bound cleanup on held output

* chore(process): satisfy promise executor lint

* fix(process): finish cleanup after lineage loss

* fix(process): retain relay output before subscription

* fix(ci): register service child runtime entries

* fix(ci): expose relay safety invariants

* fix(process): preserve service cancellation grace

* test(process): prove service grace on macOS

* fix: prevent clipped session selections and Code Mode timer crashes (#124879)

* fix(agents): support timers in code mode

* fix(ui): keep selected sessions clear of scrollbars

* fix(agents): propagate timer cancellation after resume

---------

Co-authored-by: RoboClaw <[email protected]>

* fix(ui): reveal clipped session history (#124866)

* fix(ui): reveal clipped session history

Show a persistent earlier-history action for paginated sessions and reveal loaded content without chaining observer fetches.

Related: #110771

* refactor(ui): split chat history support

* fix(cli): keep internal error causes out of operator output (#124887)

* fix(skills): expand explicit references on agent turns (#124784)

* fix(skills): expand explicit references on agent turns

Route generic Gateway, CLI, webhook, and local agent turns through the same explicit skill-reference renderer as channel auto-replies. Keep original transcript text, preserve unknown slash behavior, and fail visibly for allowlist-hidden skills.

Maintainer review: scoped Option 1 — generic agent turns expand both $skill-name and leading /skill-name args through shared skill rendering; they do not run the channel command dispatcher, and all other slash commands retain their existing behavior.

* fix(skills): bound explicit reference prompts

* fix(skills): prefer allowed reference collisions

* fix(skills): preserve command invocation boundaries

* fix(skills): reject hidden channel slash commands

* perf(skills): skip literal dollar discovery

* fix(ui): replace the broken terminal tab underline (#124875)

* fix(ui): redesign dock panel tabs

* fix(ui): remove stale terminal tab overrides

---------

Co-authored-by: RoboClaw <[email protected]>

* fix(tui): close selection overlays and report rejected handlers (#124876)

openSelector's onSelect fired the async handler with void and only
closed the overlay after a successful await. A rejecting handler (e.g.
setAgent -> setSession against a failing gateway) left the selector
stranded open with an unhandled rejection: the TUI froze on the picker
with no visible cause — a silent dead-end.

Root cause: failure path missing from the overlay lifecycle. The
handler now catches, surfaces the cause via chatLog, and always closes
the overlay.

Regression: /agent selection with a rejecting setSession asserts the
overlay closes and the cause reaches the chat log — fails pre-fix.

* fix(ui): make terminal open failures retryable (#124890)

* fix(sandbox): surface list probe failures instead of empty results (#124881)

sandboxListCommand and fetchAndFilterContainers swallowed backend and
registry probe failures with catch(() => []). A broken Docker daemon or
corrupt registry rendered as 'No sandbox runtimes found.' — and in
recreate, filtered an entire fleet down to nothing — indistinguishable
from a clean empty state. --json emitted a success envelope for a
failed probe.

Root cause: failure collapsed into the empty success shape at the
consumer. The listers now propagate; the sandbox CLI runner already
owns the error path (message + exit 1), and the new --json failure
contract (8d5823e7313) emits the JSON error envelope.

Regression: replaced the test that enshrined the masking ('handle
errors gracefully' asserting the empty-state message) with the
propagation contract — fails pre-fix.

* fix(tui): report the first last-session write failure (#124886)

* fix(tui): report the first last-session write failure

rememberCurrentSessionKey swallowed writeTuiLastSessionKey failures
with catch(() => undefined). A corrupt or locked state DB silently
disabled session restore: the operator only discovers it on next
launch, landing in the wrong session with no clue why.

Root cause: fire-and-forget with no recorded failure. The write wrapper
moved to its owner (tui-last-session.ts) as
createRememberSessionKeyWriter, which surfaces the first failure via
the chat log ('session memory write failed: ...') and stays silent on
repeats — one line per TUI run, not one per session switch. Empty and
'unknown' keys still skip without touching the writer.

Regression: colocated tests prove first-failure-once reporting and the
skip path — fail pre-fix (factory did not exist; failure was
swallowed at the call site).

* chore(tui): make the last-session write dependency explicit

deadcode:exports rejects writeTuiLastSessionKey as unused when only the
factory default referenced it; tui.ts now passes it explicitly.

* fix: remove delivery markers from historical sessions (#124888)

* fix(sessions): migrate historical transcript directives

* fix(infra): complete directive migration on pre-archives-schema databases

session_transcript_archives is a lazy additive v17 surface; valid databases
may omit it. The archives phase now treats the missing table as empty and
completes the cursor instead of warning-skipping the whole database forever.
Verified against a real long-lived agent DB: previously stuck cursor
completes with zero warnings in ~100ms.

* chore(ci): allow directive migration SQLite access

* fix(sessions): report self-archive before stopping the turn (#124896)

* feat(agents): record agent creation provenance and add roster tree listing (#124828)

Adds an additive agent_provenance table (shared state DB, schema v8) owned
by src/state/agent-provenance.ts. createAgent() records operator/agent
provenance after commit, the system-agent create-agent operation passes its
own id as creator, and Claw installs record created-via claw at their roster
commit point. Agent deletion removes the agent's own row inside the deletion
journal transaction; children keep dangling creator ids as historical fact.
openclaw agents list gains --tree (provenance hierarchy) and JSON provenance
fields.

* fix(ui): keep message presentation stable when expanded (#124898)

* fix(gateway): stop a plugin dangerous flag from revoking desktop computer.act (#124863)

* fix(gateway): stop a plugin dangerous flag from revoking desktop computer.act

`resolveNodeCommandAllowlistInternal` subtracted every plugin-declared
dangerous command from the composed allowlist, including core's own
`PLATFORM_DEFAULTS` entries and including the pairing allowlist, where core's
dangerous defaults are exempted. `computer.act` is both a desktop platform
default (grant = node-local enablement + pairing approval) and a command that
`registerComputerUseProvider` marks dangerous. Since `cua-computer` became
enabled-by-default on darwin, every macOS-hosted Gateway stripped `computer.act`
from both allowlists, so `normalizeDeclaredNodeCommands` dropped it from the
node's declaration with no pairing upgrade, no prompt, and no record. The
`computer` capability survived because caps were never allowlist-filtered, and
the `computerUse` descriptor was then dropped for the missing command.

Scope the plugin-dangerous subtraction to commands outside the platform-default
base: the flag still keeps a plugin's own surface behind an explicit allow and
still forces a registered invoke policy, but it no longer revokes a command core
declares itself.

Also make cap-without-command unrepresentable. `retainFulfilledNodeCapabilities`
drops a capability when policy withheld commands from its family and admitted
none, and the reconciler records the withheld commands so a refused declaration
is never silent.

* test(gateway): type the computer-use fixture against its contract

* fix(doctor): partition retired session stores (#124846)

Recover owner-qualified rows from the retired top-level session store into each configured agent database without guessing ambiguous ownership. Relocate stale transcript paths, tolerate historical Unicode IDs when an explicit transcript exists, and avoid double-counting physical SQLite databases in migration totals.


Amp-Thread-ID: https://ampcode.com/threads/T-01a00a6a-b64e-74a5-8b15-2d3b966a468d

Co-authored-by: Amp <[email protected]>
Co-authored-by: Josh Lehman <[email protected]>

* perf(ci): price agents-core-models from its measured hybrid wall

`agentic-agents-core-models` carried the 36s scaled estimate while measuring
56.3s (n=6, p90 58.6s) across 260 compact jobs on 2026-08-16. Packed beside
`agentic-agents-core-runtime-hosted-1` (60.4s) it built the only bin running
>=1.25x its prediction: compact-large-19 ran 122s of work priced at 88s, which
made it the most frequent slowest job in the workflow.

Add the measured value to the hybrid hint map, which already exists for exactly
these Blacksmith-specific observations. The packer then separates the two, and
the tallest actual compact bin drops 122s -> 109s with no bin above 1.25x and
no change to row counts (48 push / 56 pull-request), so this costs no extra
runner registrations.

Two things deliberately left alone. The `agentic-gateway-core-3` 140s pin looks
like a 2x over-prediction against its 68.5s median, but run 31938297538 really
did take 138.0s (109.03s + 28.98s across its two configs) on a run whose fleet
slowdown factor was 0.98 -- a genuine tail on a healthy run, so unpinning it
would rebuild a >200s bin whenever the tail lands. Every other bin already sits
within 1.24x of its prediction.

The replaced guard pinned one bin arrangement (`runtime-hosted-1` not sharing a
job with `agents-core-tools`) with no stated failure mode, so any honest refit
broke it. It now asserts the property that comment was reaching for -- both
weight sources survive rebalancing under the body ceiling -- plus the specific
regression this fixes. Mutation-checked: dropping the hint fails the new guard.

Measurement note for the next refit: sum a shard's per-config Duration lines
before taking a median. Pooling them reads as a large over-prediction that is
not there.

* fix(codex): prevent app-server leaks after desktop fallback (#124885)

* fix(codex): reuse app server after managed fallback

* test(codex): opt relay fixtures into loop detection

* fix(ui): add spacing between suggested task actions (#124900)

* fix(ui): separate suggested task card actions

* test(ui): keep task suggestion spacing check lint-safe

* fix(ui): drop duplicate plan card summary (#124895)

* fix(backup): give backup create actionable output errors (#124894)

* fix(backup): give backup create actionable output errors

* fix(backup): preserve output errors for debug

* fix(test): create sessions in default Control UI mock (#124912)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00b6b-e4e9-74af-bb31-30363fae6c89

Co-authored-by: Amp <[email protected]>

* fix(plugins): adopt root context engines on caller-owned handles (#122457)

Keep caller-owned agent runtime registries in discovery mode so full-only
plugins cannot replace process-global sandbox backends. Copy runtime
context-engine factories from the composition-root registry instead.

Co-authored-by: Josh Lehman <[email protected]>

* docs(codex): clarify loop relay behavior (#124918)

* fix(gateway): terminalize stale worker dispatches (#124920)

* refactor(ui): simplify chat history pagination (#124921)

* test(gateway): make archive lifecycle waits deterministic (#124923)

* fix(android): remove completed plan strikethrough (#124916)

* fix(plugins): restore caller-owned workspace plugin-root projection

#124844 made resolvePluginMetadataSnapshot synthesize workspacePluginRootPresent
itself with a process-memoized fs.existsSync probe whenever a caller did not
supply it. That fact is owned by the prepared-model-runtime lease, which resolves
it only for real agent runs (resolveWorkspacePluginRootPresence) and passes it
explicitly, so the probe silently turned an opt-in fast path into the default for
unrelated control-plane callers.

Gateway startup config validation is one of them. It never asserts the fact, so it
began projecting the published lifecycle graph instead of loading a fresh one, and
the projection derives configFingerprint from that graph rather than a real load.
Startup convergence rewrites the persisted plugin index between the two reads that
form the migration checkpoint identity, so the pre-convergence read projected while
the post-convergence read loaded. The two pluginMigrationFingerprint values differed
and the gateway refused readiness with "OpenClaw plugin migration inputs changed
during startup convergence", failing every config-patch restart.

Deleting the probe restores one owner for the fact and a net-negative production
diff. The agent-side hunks of #124844 are untouched: they still pass the fact
explicitly from the lease.

Root cause: admission fact manufactured outside its lifecycle owner.
Owner boundary: src/agents/prepared-model-runtime-lease.ts owns workspace
plugin-root presence; src/plugins/plugin-metadata-snapshot.ts only consumes it.
Production LOC: -18.

Fixes red main ci-gate: QA Smoke memory-dreaming-sweep, matrix-restart-resume,
matrix-post-restart-room-continue.

* fix(doctor): preserve migrated session owner (#124928)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00a6a-b64e-74a5-8b15-2d3b966a468d

Co-authored-by: Amp <[email protected]>

* refactor(webui): read slash commands through the chat metadata store (#124931)

* fix(doctor): stop reporting phantom shared auth migrations (#124929)

* fix(cron): stop advertising inactive JSON defaults (#124903)

* fix(cron): make --json help match behavior

* fix(cron): preserve scratch write JSON output

* test(cli): classify cron JSON result commands

* fix(ui): remove dashboard card text underlines (#124939)

* fix(agents): refuse add when prompts cannot run (#124940)

* test(ui): assert steer order by rendered position (#124905)

* fix(plugins): keep migration metadata authoritative (#124924)

Restrict exact config identity trust to prepared runtime generations and force startup convergence to verify against a fresh authoritative plugin snapshot.

* test(mistral): wait on delivered transcripts after reconnect (#124935)

* test(mistral): wait on delivered transcripts after reconnect

* test(nvidia): assert the remaining catalog fetch budget as a bound

* fix(cli): show actionable guidance for mistyped commands (#124892)

* fix(cli): render unknown commands as guidance

* fix(cli): keep parse JSON terminal-neutral

* refactor(sdk): source wire models from gateway-protocol schemas (#124943)

* test(ui): split chat follow-up E2E suite (#124938)

* fix: honor provider timeouts during stuck-session recovery (#123877)

* fix(diagnostics): respect active model request timeouts

* chore(diagnostics): keep recovery activity internal

* test(diagnostics): await stream wrapper results

* fix(diagnostics): harden provider timeout recovery

* fix(diagnostics): track compaction model calls

* test: prove provider timeout recovery boundary

* fix(config): reject scalar config roots instead of loading defaults (#124945)

A config file whose JSON5 root parsed to a scalar (null, a number, a
bare string — the classic truncated/clobbered file) hit a special case
in loadConfigFromContext that returned {} with a snapshot marked
valid: true. Three failures in one: the process silently ran with
defaults while the operator's real config (channels, auth, allowlists)
disappeared; the valid snapshot could promote the corrupt file's
fingerprint as lastKnownGood, poisoning the clobber-recovery machinery
that exists to catch exactly this; and the load path contradicted the
snapshot path, which correctly reported the same bytes invalid.

Root cause: an early-return that collapsed invalid input into the
empty-config success shape. Deleted; a scalar root now flows into
validateConfigObjectWithPlugins, fails schema validation, records a
valid:false snapshot, and throws INVALID_CONFIG — same as an array
root, same as the snapshot path, handled by doctor's invalid-config
recovery.

Regression: new io.scalar-root.test.ts (null/number/string roots all
throw INVALID_CONFIG; snapshot agrees invalid) — all 3 fail pre-fix.
Updated the compat warning-fingerprint test that relied on null-root
loading as defaults.

* fix(security): prevent approved scripts from changing before execution (#124858)

* fix(security): bind exec approvals to mutable operands

* test: align approval fixtures with operand binding

* fix(security): close durable operand binding gaps

* fix(security): preserve independent exec policy grants

* improve(ui): simplify widget preview chrome (#124883)

Co-authored-by: RoboClaw <[email protected]>

* fix: deliver requested image artifacts across agent runtimes (#124910)

* fix: distinguish image inspection from delivery

Clarify that image-reading tools only load private model context, prefer native Codex image inspection when available, and preserve explicit outbound tool media across Claude CLI loopback runs.

Co-authored-by: pash <[email protected]>

* fix: propagate CLI vision capability

* chore: refresh CI after main fix

---------

Co-authored-by: pash <[email protected]>

* fix(ci): derive plugin SDK boundary cache inputs (#124897)

* feat: add cloud worker profiles and machine selection (#124864)

* feat(workers): add per-dispatch machine classes

* feat(ui): add cloud worker machine picker

* feat(tts): add structured reply speech fields (#124913)

* feat(tts): add structured reply speech fields

* fix(tts): keep transcript directive parser acyclic

* fix(tts): drop unused directive fact export

* fix(outbound): preserve reply-payload metadata through response prefixes

The response-prefix rebuild spread the payload without its metadata carrier,
dropping structured speech facts (and any other payload metadata) whenever a
channel responsePrefix applied. Rebuild via copyReplyPayloadMetadata.

* fix(tts): keep voice-only sends visible when the speech runtime is cold

A structured voiceText-only send with no visible text returned unchanged from
the cold-runtime guard, so delivery normalized the empty payload to null and
the send silently vanished. The cold exit now applies the same visible
fallback as synthesis failure: explicit spoken text materializes as payload
text when no other content exists.

* fix(qa): isolate capture store startup (#124949)

* refactor(channels): align approval reaction bindings (#124942)

Split Signal approval routing into its concept-owned module and call the shared SDK binding helpers directly.

Reject persisted reaction targets when any allowed decision is invalid or duplicated, rather than retaining a valid subset from a corrupt transient record.

* docs(agents): harden live-test and capture-inspection requirements

Live verification of user-facing behavior is the default before landing,
with skips requiring a stated infeasibility in the PR; captured
screenshots/videos count as evidence only after the agent inspects them
in frame.

* refactor(ui): define sidebar panel contract (#124950)

* improve(ui): move session status to second row (#124960)

* improve(ui): move session status to second row

* test(ui): align session row layout expectations

---------

Co-authored-by: RoboClaw <[email protected]>

* docs: clarify model switching guidance (#124889)

* docs: clarify model switching guidance

* docs: warn that reasoning changes invalidate cache reuse

---------

Co-authored-by: RoboClaw <[email protected]>

* fix(ui): stop duplicate dashboard session queries (#124968)

* fix(doctor): surface legacy-config copy failures (#124948)

* fix(doctor): surface legacy-config copy failures

maybeMigrateLegacyConfig swallowed every copyFile error with a bare
catch whose comment claimed EEXIST-only. EACCES, ENOSPC, and
cross-device failures were silently ignored: the operator's
~/.clawdbot/clawdbot.json exists, migration was attempted and failed,
and doctor proceeded as a clean fresh install with no config, no change
note, and no warning.

Root cause: failure collapsed into the skip-silently success shape. The
catch now rethrows anything other than EEXIST with the source/target
paths in the message; EEXIST (config already at the target) keeps its
skip semantics.

Regression: read-only target dir makes the preflight reject with
'Failed to migrate legacy config' — fails pre-fix (resolved as a clean
run); companion test proves the successful copy path still migrates.

* chore(doctor): annotate the errno assertion for the safety ratchet

* refactor(doctor): narrow the copy error without a type assertion

The assertion-safety ratchet flagged the errno cast; property narrowing
removes the assertion instead of annotating it.

* fix(android): show plan status and explanation (#124958)

* fix: scale Gateway RSS diagnostics to runtime limits (#124914)

* fix(logging): scale RSS pressure to runtime limits

Derive Gateway RSS warning and critical thresholds from the smaller of the effective V8 heap and OS process limit. This preserves heap and rapid-growth pressure detection while avoiding routine false alerts on large heaps.

* test(logging): narrow optional heap fixture

* fix(logging): bound process memory sentinels

* test(logging): pin Bun physical memory fixture

* refactor(channels): delete the per-turn progress receipt line (#124972)

The finished-turn digest ('🧠 N thoughts · 💬 N notes · 🛠️ N tool calls ·
⏱️ Ns') was synthesized onto three surfaces: Slack's Block Kit card footer
(removed in #123851), Discord's final-answer subtext, and a duplicate Telegram
implementation added to match Discord.

Nothing gated it — no config key for the receipt has ever existed on any
channel — so PR #122976, which deleted it from Slack's native progress surface,
could only ever be a partial removal. Finish it: live progress surfaces keep
their in-flight indicators, and a finished turn leaves the answer with nothing
synthesized appended.

Telegram's window collapsed *into* the digest, so it now retires like every
other surface; Discord already discarded its draft after the final landed. The
core tracker keeps only the live counters Slack's working footer reads.

* feat(agents): preserve create request provenance (#124963)

* refactor(types): discriminated unions for internal contracts — wave 2 (#124959)

* fix(gateway): surface blocking startup progress (#124309)

Keep Gateway admission sidecar-gated while surfacing retryable startup progress in TUI and Control UI.

Unify deferred startup ownership and shutdown draining so late workers, plugin services, and sidecars cannot outlive transport teardown.

Co-authored-by: RoboClaw <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>

* test(node-host): own proxy tunnel lifecycle

* fix(codex): preserve resumed session usage (#124969)

* fix(doctor): report malformed final JSONL records (#124977)

Co-authored-by: Amp <[email protected]>

* feat(agents): show creation hierarchy in Control UI (#124967)

* feat(agents): show creation hierarchy in Control UI

* chore(protocol): regenerate Swift agent model

* refactor: consolidate record guards (#124970)

* fix: plugin tools disappear from Codex and restricted profiles (#124947)

* fix(memory): make standing intents reachable

* fix(agents): dedupe macOS read path variants

* docs(plugins): document profile tool metadata

* test(codex): complete prepared runtime fixtures

* fix(agents): preserve prepared tool boundaries

* fix(cli): prevent node/device RPCs from corrupting shared state (#123674)

* fix(cli): prevent node/device RPCs from corrupting shared state

* fix(cli): keep gateway RPC transport state read-only

* fix(cli): preserve doctor lint config isolation

* fix(cli): keep gateway RPC transport state read-only

* fix(gateway): keep auth preflight state read-only

* fix(cli): preserve SQLite artifacts in read-only RPCs

* fix(infra): remove stale identity store import

---------

Co-authored-by: VACInc <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>

* fix(codex): reject malformed native tool arguments (#124649)

* fix(codex): reject invalid native tool arguments

* fix(codex): preserve raw argument preparation

Signed-off-by: sallyom <[email protected]>

---------

Signed-off-by: sallyom <[email protected]>
Co-authored-by: sallyom <[email protected]>

* feat: main-session agent-wide visibility + session.groupScope routing (#124965)

* feat: add main session group routing

* docs: explain main session routing scopes

* fix: align memory session visibility

* test(qa): cover main-scoped group bindings

* fix(sessions): preserve binding-scoped outbound routes

* fix(routing): preserve explicit outbound owners

* fix(sessions): recognize global main visibility

* chore(ci): prune assertion safety baseline

* fix(installer): finalize deferred PATH installs successfully (#124678)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00ae0-190d-718b-8a76-b75f3e8d1fae

Co-authored-by: Amp <[email protected]>

* fix(cli): align agent exec with system owner (#124697)

* fix(onboard): run channel hooks after config commit (#124736)

Amp-Thread-ID: https://ampcode.com/threads/T-01a00ae0-190d-718b-8a76-b75f3e8d1fae

Co-authored-by: Amp <[email protected]>

* fix(ui): hide mobile transcript metadata until tap (#124936)

* fix(ui): reveal mobile message metadata on tap

* fix(ui): centralize mobile transcript disclosure

Co-authored-by: Vyctor H. Brzezowski <[email protected]>

---------

Co-authored-by: RoboClaw <[email protected]…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes gateway Gateway runtime merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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.

2 participants