Skip to content

chore: prepare extended-stable 2026.8.34 - #160960

Merged
RomneyDa merged 137 commits into
extended-stable/2026.8.33from
release/2026.8.34
Sep 29, 2026
Merged

RomneyDa merged 137 commits into
extended-stable/2026.8.33from
release/2026.8.34

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Resolves a broad set of correctness and upgrade regressions that still affect the 2026.8 extended-stable line across Doctor, authentication, sessions, channels, plugins, sandboxing, filesystem safety, model runtimes, approvals, and release packaging.

Selection and Release-Owner Decision

The release owner explicitly accepted the complete 113-unit proposal, including the browser-installer recovery and the large/mixed-PR slices, and authorized preparation of this non-draft 2026.8.34 PR. That acceptance specifically retains the public system-agent approval SDK variant and the Doctor compatibility repairs in this release; both are intentional 2026.8.33-compatible additions, not accidental surface growth.

Discovery rescanned the complete 999239d745d9cf73b0bf5c8791944565ecd3fcf2..27de2f87db284610f8deb3312318fa9934cb7182 range: 16,094 commits in 161 deterministic batches. That includes the same discovery body from which the 2026.8.33 backports were selected, rather than beginning at the end of that prior selection. Large and mixed-purpose PRs were separately checked for narrow bugfix slices. The complete 2026.7.35 lineage (85 stable commits plus 200 embedded picks) was reconciled; the only still-applicable omission was plugin-inventory parity.

The accepted set contains 60 exact source commits, 25 release-line adaptations, 27 narrow slices from large or mixed-purpose PRs, and one 2026.7.35 parity repair. The branch contains 137 physical commits: 111 selected-unit commits plus 26 release integration, CI, and review-repair commits. Two accepted units were already patch-equivalent on the base and are recorded without duplication.

Compatibility Boundary

  • Exact base: f773aa06a1a93b36b050f1a3f4b57d3d91311541 (extended-stable/2026.8.33).
  • Candidate: 6eb6941db86f666ea50d6f579ae88df5e007e555.
  • Storage/config compatibility stays on the 2026.8.33 boundary: schema version 15 and agent version 19 are unchanged.
  • Newer contracts that do not apply to this release line were omitted rather than introduced speculatively.

Approval-Authority Proof

The final approval repair captures the exact ambient delegated run authority, binds it to the approval record, and separates asynchronous inference validation from the synchronous live-owner guard. Config writes carry that guard through the CLI mutation owner into the config writer. Root-config publication and backup effects remain authority-fenced. The pinned rooted API does not expose a live-authority hook at its final publication boundary, so delegated included-config writes are rejected before backup rotation, runtime preflight, or rooted-writer entry rather than permitting an unfenced final effect. Ordinary included-config writes remain supported with rooted backup rotation. Delegated destructive-write rejections do not create rejected-payload artifacts. Ordinary root-config writes retain the configured permission-error copy fallback. Delegated-authority root writes intentionally fail closed on a permission-error rename rather than attempting an unfenced copy; the CLI reports a redacted file/parent ownership-or-permissions repair and retry path.

A same-hash pending approval is reused only when its exact local or worker authority is still current; a closed or foreign prior-run record is retired before a replacement is created. Native channels now publish applied only from the engine result, so denial, failure, or authority loss publishes not-applied.

Exact-head tests cover the allowed Gateway root-config path, a foreign reviewer denial, native-channel custody, run and worker cancellation, closed-run replacement, denied outcome publication, asynchronous preparation followed by revocation, and real config-file publication attempts whose authority closes after preparation. The production Gateway route proves an operator-approved delegated included-config edit returns not-applied with config and backup bytes unchanged. A direct writer regression proves rejection occurs before backup, runtime preflight, or publication callbacks are entered.

Validation

  • pnpm check — passed, including production typecheck, lint, format, max-lines, and zero runtime import cycles.
  • pnpm check:test-types — passed.
  • pnpm release:prepare --version 2026.8.34 --check — passed.
  • Final-effect authority proof — 469 config, filesystem, CLI, system-agent, and Gateway-method tests passed. A production-route matrix carries allowed root writes, denied decisions, pre-I/O revocation, and rejected delegated include writes from the Gateway queue through ChatTurnRouter and the real config writer, observing config/backup bytes plus unchanged 0755 parent-directory mode. Direct include regressions prove rejection precedes both snapshot and managed runtime preflight owners, backup, caller preflight, and publication; ordinary included-file writes retain rooted backup coverage. Delegated rejected-payload omission and redacted EPERM/EEXIST recovery are covered; the unified reviewer suite separately proves foreign reviewers cannot resolve the approval.
  • Exact-head CI — passed 262/262 checks with zero failures after the unrelated cron shard passed on rerun.
  • Previous exact 2026.8.33 to candidate Package Acceptance — passed package integrity, npm 12 install, frozen-source admission, isolated Docker image construction, and the exact copied-state upgrade/reopen survivor lane. Final exact-candidate Package Acceptance — passed package integrity, npm 12 install, frozen-source admission, isolated Docker image construction, and the exact 2026.8.33 copied-state upgrade/reopen survivor lane for candidate 6eb6941d. Superseded candidate runs were canceled after replacement.
  • Telegram QA attempt — the trusted-workflow identity passed, then provenance failed closed before build because the exact candidate is an open same-repository PR head. This is a workflow policy gate, not a candidate execution failure; canonical release-context Telegram proof remains a post-merge release gate.

The local build reached postbuild, but its final package-resolution step was not used as proof because this worktree had shared workspace links to the primary checkout. Those temporary links were removed. Isolated CI and Package Acceptance are authoritative.

Rollback

Stop the Gateway, snapshot the affected state, reinstall [email protected], and restore the pre-upgrade config/state snapshot if Doctor modified it. Do not reuse partially migrated state without the snapshot.

Physical commit ledger (137 commits)

The first 111 commits implement the accepted release units; the final 26 commits prepare the release and repair exact-candidate integration, CI, and accepted review findings.

  1. 91f6a3f1f55e03 fix(plugins): recover orphan installs without weakening ownership
  2. 1061c7daf7a843 fix(doctor): repair keyed multi-agent rosters without ownership (fix(doctor): repair keyed multi-agent rosters without ownership #134706)
  3. cb99a979c9ccd0 fix: prevent device pairing migration crash on contaminated records
  4. de5501e9940ae1 fix(doctor): preserve per-agent memory search during upgrades
  5. cc5114af2d8d8b fix(doctor): detect shared auth migration by provenance (fix(doctor): detect shared auth migration by provenance #134808)
  6. 8f84a9ff65e595 fix(cron): refuse stale doctor store rewrites
  7. 406386518eecae fix(gateway): refresh model catalog after auth changes (fix(gateway): refresh model catalog after auth changes #134361)
  8. 4b5bea7b9cc21e fix(openai): repair stale doctor route pins
  9. 431f0fb440b0aa fix(auth): verify shared credential migration receipts (fix(auth): recover interrupted shared credential migrations #134952)
  10. 7b98d15685326b fix(cron): keep model aliases scoped to the selected owner (fix: keep scheduled model aliases scoped to the selected agent #135069)
  11. 794121036c5875 fix(memory): resolve profile auth for compatible embeddings (fix(memory): resolve profile auth for compatible embeddings #134744)
  12. c04e983e8e66ae fix(auth): recover credentials stranded by completed migrations (fix(auth): recover credentials stranded by completed migrations #135346)
  13. ae4a3d484aa929 fix(auth): relogin repairs stale profile order after upgrade
  14. b8803e1a8ff7e7 fix(auth): preserve custom provider SecretRefs in Doctor
  15. 50858c89f93a1f fix(docker): install libgomp1 in the runtime image for managed llama.cpp (fix(docker): install libgomp1 in the runtime image for managed llama.cpp #134532)
  16. 520ad3191de242 fix(devices): allow authorized scoped node token management (fix(devices): allow authorized scoped node token management #135617)
  17. 4e25036749eb41 fix(msteams): thread context is dropped when a channel reply has no replyToId (fix(msteams): thread context is dropped when a channel reply has no replyToId #129345)
  18. e7b7da68baa622 fix(ui): ignore tool-only model auth rows (fix(ui): ignore tool-only model auth rows #134218)
  19. 72286d990587f8 fix(cron): kind change fails with "command env must be an object" when env is omitted (fix(cron): kind change fails with "command env must be an object" when env is omitted #134639)
  20. aec6ce08787f80 fix(backup): exclude workspaces before traversal
  21. a5c2a434a1d905 fix(infra): drop empty PATHEXT entries from Windows extension lookup (fix(infra): drop empty PATHEXT entries from Windows extension lookup #135807)
  22. 6b8d85138f0521 fix(anthropic): context usage is lost when a proxy omits message_delta usage (fix(anthropic): context usage is lost when a proxy omits message_delta usage #135467)
  23. 12d8086a9c9839 fix(systemd): protect credentials in managed backups (fix(systemd): stop leaking live gateway tokens through readable .service.bak files #131786)
  24. fc6371c687dd53 fix(agents): preserve requester MCP runtime ownership (fix(agents): avoid evicting MCP runtimes during requester resolution #134819)
  25. 9c5550a0986abe fix(plugins): refresh persisted registry when source mounts change (fix(plugins): refresh persisted registry when source mounts change #136517)
  26. 177f06e1b7745a fix: gateway restart hangs while followup drain retries a draining error (fix: gateway restart hangs while followup drain retries a draining error #136713)
  27. d812fa2bbdaa5e fix(auth): preserve OAuth metadata during session SDK refresh (fix(auth): keep OAuth identity fields across session auth storage refresh #127988)
  28. bf0690657d3daa fix(doctor): recognize configured memory provider secret references (fix(doctor): treat store SecretRef memory provider keys as configured #137782)
  29. 3e99cc6979f3d4 fix(sessions): preserve logical shared-store ownership (fix(sessions): preserve logical shared-store ownership #138380)
  30. 8d6e12a3c3b715 fix: full-access tasks lose tools after Gateway restart (fix: full-access tasks lose tools after Gateway restart #138701)
  31. 264433aa1771ba fix: keep unchanged files out of session diffs (fix: session diff includes unchanged files after large additions #138877)
  32. e1fa4d83921852 fix(auth): recover billing-disabled profiles in minutes instead of hours (fix(auth): recover billing-disabled profiles in minutes instead of hours #136364)
  33. ef0eec33389a2a fix(auth): keep an unset default model unchanged during login (fix(auth): keep an unset default model unchanged during login #139218)
  34. e0fef002e73a6c fix(gateway): avoid crashes when an upgrading client disconnects (fix(gateway): avoid crashes when an upgrading client disconnects #139061)
  35. 78854a5fb739f0 fix(shell-env): preserve CLI terminal ownership during login imports (fix(shell-env): detach the login-shell probe so it cannot stop the CLI with SIGTTOU #139308)
  36. 1d3569f45ab192 fix(auto-reply): fold trailing transcript growth into memory-flush fresh totals (fix(auto-reply): fold trailing transcript growth into memory-flush fresh totals #138928)
  37. fbc91ccbaade84 fix(cron): preserve pending paced checks across restart (fix(cron): preserve paced next-check deadlines across restart #140083)
  38. 53ee15719680f9 fix(daemon): systemd install no longer aborts on "ownership could not be verified" after a clock step (fix(daemon): systemd install no longer aborts on "ownership could not be verified" after a clock step #137253)
  39. 957ff1dda925eb fix(config): apply environment changes after in-process restart (fix(config): apply environment changes after in-process restart #141296)
  40. 52bf5ff3db36b5 fix: pasted text is missing in model-locked Codex sessions (fix: pasted text is missing in model-locked Codex sessions #142021)
  41. d2b0df0799837f fix(docker): restore source builds after dependency ownership guard (fix(docker): restore source builds after dependency ownership guard #142073)
  42. 4957926c374f9a fix(security): preserve existing WhatsApp group allowlists (fix(security): preserve existing WhatsApp group allowlists #142589)
  43. a7618641556b1b fix(doctor): avoid installing unselected search providers (fix(doctor): avoid installing unselected search providers #142640)
  44. 0583623f484bd9 fix(doctor): migrate legacy Codex music model selectors (fix(doctor): migrate legacy Codex music model selectors #143235)
  45. a7b3ea864282dd fix(doctor): preserve selected model metadata in diagnostics (fix(doctor): preserve selected model context in tool diagnostics #144332)
  46. 71a350058177ff fix(discord): report parent channel denies for thread permissions (fix(discord): report parent channel denies for thread permissions #121144)
  47. 77b7e68a2e91f1 fix(config): avoid false model changes when saving settings (fix(config): avoid false model changes when saving settings #144807)
  48. 4f90a3019d7282 fix(doctor): preserve legacy registry files when quarantine fails (fix(doctor): preserve legacy registry files when quarantine fails #144787)
  49. 403f719443ee04 fix: retain route ownership while discovering conversations (fix: retain route ownership while discovering conversations #146927)
  50. 95b97f8c5abcf5 fix(install): preserve runtime links when Node validation fails (fix(install): preserve runtime links when Node validation fails #147221)
  51. 514dfc03b79386 fix: doctor reports missing OAuth dir for channel config with no installed plugin (fix: doctor reports missing OAuth dir for channel config with no installed plugin #147888)
  52. cfc7d052d2b6dc fix(doctor): stopped private inputs replay after session repair (fix(doctor): stopped private inputs replay after session repair #148625)
  53. 05e729e610c971 fix(channels): settle task-scoped context leases once (fix(channels): prevent duplicate cleanup after task completion #148922)
  54. 1a9b07bd77f68d fix(push): normalize malformed proxy auth errors (fix(push): normalize malformed proxy auth errors #149112)
  55. 70d6f75c2b5ffa fix(cron): reject invalid stagger before silent schedule changes (fix(cron): reject invalid stagger before silent schedule changes #151740)
  56. fecb52a8dc24f2 fix(cli): keep model validation out of session execution (perf(agents): keep model lookup off the session runtime #154763)
  57. bb82be18ea4be5 fix(agents): treat empty credential environment variables as unresolved (fix(auth): reject empty environment credentials #155558)
  58. 6e1e737456a5bf fix(doctor): apply ambient-owner fallback to dream diary and all memory target handlers (fix(doctor): apply ambient-owner fallback to dream diary and all memory target handlers #156437)
  59. 6dafa57b68b928 fix(sandbox): unblock scoped recreation across runtime targets (fix(sandbox): unblock scoped recreation across runtime targets #157808)
  60. 49421465289f14 fix(security): parse gpt generation numbers in the audit tier check (fix(security): parse gpt generation numbers in the audit tier check #140012)
  61. ec0aae96ebeb89 fix(doctor): report shared auth health without a default agent (fix(doctor): report shared auth health without a default agent #134902)
  62. 8ed62e1613bf7e fix(doctor): converge redundant shared auth relocation subsets (fix(doctor): converge redundant shared auth relocation subsets #135096)
  63. 552f1fc6d0197b fix(doctor): report retained device-auth files (fix(doctor): report pending device auth migrations #133978)
  64. 85f9f79e493fad fix(update): stop detached updates after chat ownership is revoked (fix(update): stop detached updates after chat ownership is revoked #137312)
  65. 5a7b6e9b15c334 fix(doctor): inspect source auth stores during full lint (fix(doctor): inspect source auth stores during full lint #137610)
  66. 08dc69cf64cf36 fix(gateway): recover queued RPC replies across restart (fix(gateway): preserve queued replies during restart #138565)
  67. 75533caec89f2a fix(doctor): preserve legacy ownership during config repair (fix(doctor): preserve settings when repairing legacy agent rosters #138837)
  68. 5f9337f5a4fb3a fix: prevent browser profile permission hangs in Doctor (fix: prevent browser profile permission hangs in Doctor #139612)
  69. e32f099a0b60c2 fix(gateway): prevent systemd restarts from hanging (fix(gateway): prevent systemd restarts from hanging #140914)
  70. f3d020d93d91eb fix(doctor): recover legacy node tokens with invalid scopes (fix(doctor): recover legacy node tokens with invalid scopes #143599)
  71. f446c0344c7468 fix(skills): refresh session snapshots on gateway restart (fix(skills): refresh session snapshots on gateway restart #122110)
  72. e1b56f146794b4 fix(doctor): session SQLite import drops Codex assistant messages from legacy transcripts (fix(doctor): session SQLite import drops Codex assistant messages from legacy transcripts #140296)
  73. 22b7f05d3efeb1 fix(cron): forward claude-cli auth profile on scheduled runs to prevent OAuth expiration (fix(cron): forward claude-cli auth profile on scheduled runs to prevent OAuth expiration #144266)
  74. 4af659d40a7c11 fix(discord): preserve sender-owned line limits and reply scope (fix(discord): honor configured line limits in durable sends #137969)
  75. baa007e0555db3 fix(install): never replace or break an existing nvm during installation (fix(install): never replace or break an existing nvm during installation #145317)
  76. 74a2ee8abcf7be fix(sessions): recover omitted historical transcripts in Doctor (fix(sessions): recover omitted historical transcripts in Doctor #120781)
  77. 1b00283772b1fe fix(update): recognize custom npm prefix installations (fix(update): recognize custom npm prefix installations #146091)
  78. d5f537770f5e2f fix(context): preserve provider-scoped prompt budgets before reply maintenance (fix(context): preserve provider-scoped prompt budgets before reply maintenance #141052)
  79. 9bad8e8f2b4bd6 fix(sessions): prevent Doctor and startup memory exhaustion (fix(sessions): prevent Doctor and startup memory exhaustion #149704)
  80. 5d90dfaf3c6ca2 fix(daemon): preserve inline auth through service upgrades (fix: retain gateway auth when reinstalling legacy services #149686)
  81. feb9810eb75040 fix(update): verify paired trusted-proxy gateways with service credentials (fix(update): verify paired trusted-proxy gateways with service credentials #153540)
  82. e5607a7844c79a fix: background continuations lose session access and GitHub tools (fix: background continuations lose session access and GitHub tools #141865)
  83. 3e03d8eeeeae46 fix(doctor): decode session headers across read chunk boundaries (fix(doctor): repair stale session files whose header crosses a read chunk boundary #154034)
  84. 4d6903d9158ef1 fix: faulty compaction probe wedges run steering and restart aborts (fix: faulty compaction probe wedges run steering and restart aborts #154868)
  85. c6559b8f2c9853 fix(ui): publish rejected goal operations (chore(deps): refresh dependencies with a seven-day cutoff #156363)
  86. 4d6175908c464e fix(commands): deduplicate session lifecycle keys (refactor(commands): deslop commands #158487)
  87. ede1f020ad59e8 fix(plugins): preserve runtime artifact preference (refactor(commands): deslop commands #158487)
  88. 41f623395f533e fix(agents): strip private skill authoring from public ingress (refactor(agents): deslop agents core third pass #159220)
  89. a5418fa9440963 fix(plugins): preserve include ownership during uninstall (refactor(plugins): deslop plugin runtime fifth pass #159945)
  90. a3a1e6c215ba4e fix(channels): restore system-agent approval reactions (fix(channels): restore system-agent approval reactions #159132)
  91. ed4f1e6910cf33 fix(moonshot): reject inherited thinking-model keys (refactor(providers): deslop small provider plugins #158437)
  92. fb67bc75d276d9 fix(tencent): ignore inherited effort-map keys (refactor(providers): deslop small provider plugins #158437)
  93. eae26a24704ee5 fix(workers): observe already-aborted operation promises (refactor(gateway): deslop gateway #158228)
  94. e5bc86fae526ad fix(gateway): reject non-object Claude history rows (refactor(gateway): deslop gateway #158228)
  95. 9624fb239b1188 fix(copilot): recover pool after synchronous factory failures (refactor(plugins): deslop policy, copilot, xai, ollama and tool plugins #157819)
  96. a38b7cac900198 fix(tlon): preserve IPv6 ship origins (refactor(channels): deslop smaller channel plugins #157825)
  97. 985223adf100c3 fix(sms): clean revoked inbound media (refactor(channels): deslop smaller channel plugins #157825)
  98. deb626afd1080a fix(slack): preserve replacement webhook registrations (refactor(channels): deslop discord and slack second pass #158085)
  99. c88510cdb69180 fix(matrix): accept system-agent approval reactions (refactor(channels): deslop telegram, matrix and feishu second pass #158164)
  100. 0520963e5c4ed5 fix(channels): retain typing tick exclusivity across restart (refactor(channels): deslop channel core second pass #158830)
  101. 9efdab9ad1a15f fix(acp): format unset optional tool arguments (refactor: deslop small core directories #159417)
  102. fb3acf3f628cba fix(meeting): clean up partial audio startup (refactor(runtime): deslop core subsystems #157982)
  103. a59551712257ee fix(exec): retain prepared plugin environment (refactor(agents): deslop agents core second pass #158378)
  104. 32b035ee95253c fix(mxc): clean temp directory after bridge failure (refactor(plugins): deslop memory, migration and utility plugins #158532)
  105. af72c183cbaa4e fix(discord): preserve batched native reply identities (refactor(channels): deslop discord and slack third pass #158886)
  106. 21531d8cd47c3a fix(skills): count omitted dangerous exec aliases once (refactor(core): deslop skills, acp, logging, process, flows and wizard second pass #158906)
  107. ba0753ef965585 fix(sandbox): preserve remote mutation path bytes (refactor(agents): deslop agent subsystems third pass #159346)
  108. 374ceb6883ceee fix(browser): accept standard CDP header containers (refactor(extensions): deslop large channel and browser plugins further #159430)
  109. 3500c34cbb9cd1 fix(plugins): preserve sparse catalog preferences (refactor(plugins): deslop plugin runtime fifth pass #159945)
  110. f207f056ed8aab fix(doctor): preserve complete plugin inventory (chore: prepare extended-stable 2026.7.35 #153901)
  111. 0fcb4735d44737 fix(fs): preserve bounded filesystem correctness (refactor: reuse fs-safe and remove duplicate filesystem code #157524)
  112. 0a43a484399de0 chore: prepare extended-stable 2026.8.34
  113. 4bfcd5eaca2b3c docs: add 2026.8.34 release notes
  114. 329b014b95e4a8 fix(fs): use typed errno checks for JSON symlinks
  115. 85912287adb9ef chore: shrink assertion safety baseline
  116. d938124594dfa4 fix: integrate cumulative 2026.8.34 backports
  117. 175ddfa21034dc fix: integrate release candidate validation repairs
  118. ec443cf31fbfc6 fix: close release review findings
  119. b94b16c909ac8e fix: repair cumulative backport integration
  120. f7ca0646ff2267 fix: preserve system-agent channel custody
  121. 2db4135ad21b28 fix: complete stable backport integration
  122. ab0b0fe4ebb3ae fix: deliver system-agent approvals to native channels
  123. ee1dcfa78ff6b0 fix: align native approval architecture checks
  124. efd75c9159e380 fix: fence delegated approvals at final effect
  125. 6783037041b7f0 fix: close delegated approval final effects
  126. 504051ec2a067c fix: fence delegated config publication
  127. 18b0c77b4866e9 fix: fence delegated config backup effects
  128. 0beac1e72b84d5 test: prove delegated config final effects
  129. 900d83422a1cca test: bound delegated approval proof wait
  130. dc1fc6a1d07e8e fix: fence every delegated config effect
  131. f780a397ee26e6 fix: close delegated config I/O races
  132. 51fc8b42af141d fix: preserve delegated backup boundaries
  133. 9c7ea50c45ac8d fix: keep delegated include writes root-bound
  134. a24d68bda214b7 test: await delegated approval publication
  135. 6f35637cbe33b8 fix: reject unfenced delegated include writes
  136. 7354ecd7782add test: register delegated include todo suppression
  137. 6eb6941db86f66 fix: reject delegated includes before preflight

MoerAI and others added 30 commits September 28, 2026 19:20
Closes #134321

## What Problem This Solves

Operators could not run `openclaw plugins update --all` or uninstall a path-source plugin after both tracked plugin paths disappeared. Registry refresh succeeded but left the durable install record behind, so both commands failed on the same ownership check.

## Why This Change Was Made

Plugin lifecycle ownership now distinguishes an active package from an exact orphan record. Update and uninstall may act on an orphan only after duplicate-path and conflicting-plugin checks pass. Inspection, capability consent, active packages, and restored packages keep strict package ownership.

Post-update reconciliation accepts an unchanged safe orphan while another package updates. If an orphan install record changes, the replacement must restore a strictly valid package before any update can commit.

Uninstall removes owner-keyed plugin and channel policy plus the durable install record. Child policy remains based only on authoritative discovered children.

## User Impact

Operators can update their remaining plugins and remove stale path-source install records without editing OpenClaw state by hand. Ambiguous, conflicting, and invalid replacement packages still fail closed.

## Evidence

Current `main` at `77fee957919f06dbaff09dd5cc7f9664d9655651` failed through the real command-line flow after a local plugin was installed and both tracked paths were moved away:

```text
$ openclaw plugins update --all --dry-run
Plugin "orphan-proof" package owner "orphan-proof" has no authoritative runtime child list.
Exit 1

$ openclaw plugins uninstall orphan-proof --force
Plugin "orphan-proof" package owner "orphan-proof" has no authoritative runtime child list.
Exit 1

$ openclaw plugins registry --refresh
Plugin registry refreshed: 0/0 enabled plugins indexed.
Exit 0

$ openclaw plugins update --all --dry-run
Plugin "orphan-proof" package owner "orphan-proof" has no authoritative runtime child list.
Exit 1
```

Exact head `06de2f66734fd338e457f50a3060e2d625288274` passed the same flow:

```text
$ openclaw plugins update --all --dry-run
Skipping "orphan-proof" (source: path).
Exit 0

$ openclaw plugins uninstall orphan-proof --force
Uninstalled plugin "orphan-proof". Removed: config entry, install record.
Exit 0

$ openclaw plugins update --all --dry-run
No tracked plugins or hook packs to update.
Exit 0
```

The contributor head initially accepted a changed orphan install record with no authoritative children. The new owner-boundary regression failed with `{ ok: true }` before the maintainer repair and passes after it.

Validation:

- `node scripts/run-vitest.mjs src/plugins/manifest-registry-installed.test.ts src/plugins/management-service.uninstall-ownership.test.ts src/plugins/plugin-package-update.test.ts src/cli/plugins-cli.update.test.ts src/cli/plugins-cli.uninstall.test.ts` — 129 passed.
- Targeted Oxfmt and Oxlint — passed.
- Max-lines and assertion-safety ratchets — passed.
- Coercion, deprecated-API, dead-export, native-schema, and import-cycle guards — passed.
- `git diff --check` — passed.
- Local type checking was not run because host policy requires CI for OpenClaw type checks.

The proof fixture, isolated states, removed plugin copies, and proof manifest remain in the durable maintainer worktree.

Co-authored-by: Ayaan Zaidi <[email protected]>
Closes #134340

## What Problem This Solves

Operators upgrading from the retired JSON device-pairing store can have pending requests or malformed values inside `devices/paired.json`. One bad record aborts the full JSON-to-SQLite import, keeps every valid pairing out of SQLite, and repeats the failed migration on each gateway start.

The pairing migration failure is caught and logged. It does not stop gateway startup by itself. The field report also contained a separate legacy session-store blocker.

## Why This Change Was Made

The migration now validates every field that SQLite binds directly. It skips records with invalid required pairing data. When only optional metadata is malformed, it omits that field and preserves the usable pairing. The original legacy store is archived only after the safe import completes.

Validation includes required timestamps, optional `lastSeenAtMs`, and optional text columns. Separate warnings report skipped records and omitted optional fields. The SQLite mapper remains strict, and no schema or fallback path changes.

## User Impact

Valid device pairings survive an upgrade even when the legacy file also contains pending requests or malformed records. The gateway completes the import once and does not retry it after restart.

## Evidence

- Current-main red at `77fee957919f06dbaff09dd5cc7f9664d9655651`: a normal isolated gateway logged `NOT NULL constraint failed: device_pairing_paired.created_at_ms` for a pending-shaped leaf and retained `paired.json`.
- Anti-cheat red: changing the malformed leaf to `lastSeenAtMs: 1e100` logged `cannot store REAL value in INTEGER column device_pairing_paired.last_seen_at_ms`.
- Regression red on contributor head `ee7ea2bfbc5bde3e1b6f90ea58e4d070b7e7ff61`: the expanded boundary test failed with `Provided value cannot be bound to SQLite parameter 47`.
- Fixed-head boundary proof: `node scripts/run-vitest.mjs src/infra/device-pairing-migration.test.ts` passed 7/7; targeted formatting and Oxlint passed.
- Optional-preservation red on `4f47648f1d6bcf279697d4e8ec5044960bb27cf5`: the corrected regression failed because only one row imported instead of preserving three usable pairings.
- Final real gateway proof: startup returned `status=started`, imported three usable pairings, stored malformed optional metadata as `NULL`, skipped one record with invalid required data, archived `paired.json`, and restarted with no migration log.

Co-authored-by: Ayaan Zaidi <[email protected]>
Closes #134256

Reported by @vdruts.

## What Problem This Solves

Fixes an issue where operators running `openclaw doctor --fix` after an upgrade could silently lose every per-agent memory-search override when Doctor converted `agents.list` to keyed `agents.entries` first. This removed settings such as `extraPaths`, `sources`, `experimental.sessionMemory`, and `enabled`.

## Why This Change Was Made

Doctor now visits both keyed agent entries and legacy list entries at the migration owner. It moves `memorySearch` before unknown-key cleanup, preserves explicit canonical values, and applies the existing provider, nested-field, and retired-path migrations to the moved data.

The shared agent-scope traversal replaces two duplicate traversal implementations. The regression was introduced by #112678, which moved roster normalization before the older list-only migration from #111527.

## User Impact

Per-agent memory-search settings now survive `openclaw doctor --fix` and remain attached to the correct agent. Operators no longer lose per-agent retrieval paths silently during this upgrade path.

## Evidence

- Red on current-main baseline `8abb80073c8648e85d11a0e9bd22b09d1d2bfac2`: [Testbox run 33466170600](https://github.com/openclaw/openclaw/actions/runs/33466170600) removed the legacy block and retained only the pre-existing canonical field.
- Green on exact head `983df6b6ddf33ffad80f32874966ffeeaf0a803f`: [Testbox run 33467597600](https://github.com/openclaw/openclaw/actions/runs/33467597600) ran the real CLI, preserved supported fields and canonical precedence, verified the authored input, and produced byte-identical config on a second Doctor run.
- Regression proof: the strengthened Doctor process test fails on the baseline and passes on the head.
- `node scripts/run-vitest.mjs src/commands/doctor-config-preflight.process.test.ts` — 10 passed.
- `node scripts/run-vitest.mjs src/commands/doctor/shared/legacy-config-migrate.test.ts src/commands/doctor/shared/legacy-config-migrations.runtime.retired.memory-qmd.test.ts src/commands/doctor/shared/legacy-config-migrations.runtime.retired.test.ts` — 294 passed.
- Focused format, Oxlint, Doctor registry, coercion helper, max-lines, assertion safety, import-cycle, temp-directory, conflict-marker, and dead-export checks passed.
- Autoreview on the exact local diff: clean, no actionable P0 findings.

Agent task: https://chatgpt.com/codex/tasks/01a040d7-aa3d-7433-83eb-de7f49979443

Co-authored-by: Ayaan Zaidi <[email protected]>
Prevent `openclaw doctor` from replacing cron definitions or runtime-owned state captured before its interactive repair prompt.

Doctor now rechecks a bounded definition-and-order fingerprint inside the SQLite write transaction. Definition changes stop the repair with a retry warning. Runtime columns and current runtime authority remain owned by the Gateway, while repaired authorization-input changes fail closed into recovery.

Preserve old embedded-authority migration and current quarantine recovery.

Co-authored-by: Ayaan Zaidi <[email protected]>
* fix(models): refresh catalog content after credential-identity changes

* refactor(agents): split auth-profile mutation lineage out of runtime-snapshots

Split the max-lines boundary by moving persisted mutation lineage out of runtime snapshots; behavior is unchanged.

* refactor(agents): annotate the moved test-api global assertion for the safety ratchet

* test(agents): type the catalog worker mock and shrink the assertion baseline

* perf(agents): bound auth publication provider facts

* perf(gateway): keep auth status off catalog discovery

* fix(agents): reject retired catalog owners

* test(gateway): resolve the auth-status handler result before racing it

* fix(models): gate catalog refresh by read intent

* test(models): prove deferred catalog reads stay static

* test(models): type the unscoped catalog-refresh row context
Declare canonical OpenAI session-route ownership at the OpenAI plugin manifest boundary.

Clear automatic fallback-origin provenance when Doctor removes the stale model override. Preserve explicit model choices and valid locked harness sessions.

Fixes #101672.

Credit @849261680 for the original report-driven repair.

Co-authored-by: Ayaan Zaidi <[email protected]>
Attach expected credential fingerprints to both credential-store receipt
variants so interrupted shared-store imports use the existing verification
and archive recovery flow. State-only receipts retain their own verification.

Regression coverage interrupts archival and removes the destination before
retrying both legacy auth file formats against both SQLite destinations.
The shared-store cases fail before this change; all 90 focused tests pass.

Related to #134608, reported by @erameson. This preserves the existing
non-replay policy for completed receipts; recovery of already-completed
receipts requires a separate maintainer decision.
Reuse the published model owner metadata for default, agent, subagent, payload, session, and Gmail selections. Consolidate override arguments while retaining agent-specific policy and existing precedence. Six regression cases fail before and pass after; 83 related tests pass. Related: #130324, #130706.
* fix(memory): resolve profile auth for compatible embeddings

* test(memory): close profile fixture SQLite handles

* fix(memory): preserve credential ownership in embedding auth

Resolve saved profile bindings through the canonical terminal auth capability while preserving literal, blank, explicit-header and destination behavior. Retain general model-auth precedence and shared guard policy; exercise real HTTP, SQLite and public CLI indexing/search. Reuse the canonical doctor CI fixture and repair executable-preflight test isolation.

Co-authored-by: 0x-Parzival <[email protected]>

* fix(memory): preserve auth policy for configured embeddings

Carry the selected provider API into the canonical auth-mode check, so direct OpenAI routes reject saved token profiles before embedding HTTP. Check auth migration readiness before classifying provider-entry credentials, including warm snapshots after a legacy credentials file is restored. Keep explicit remote credentials, literal keys, and canonical SQLite profile ownership intact.

Regression coverage exercises provider/API/credential-mode combinations and cold-empty, warm-empty, and populated canonical stores with real embedding HTTP and SQLite.

Co-authored-by: 0xParzival <[email protected]>

* test(pr): reuse landed cross-checkout fixture

Adopt the exact cross-checkout fixture already landed in main by #134740, resolving the overlapping cleanup while preserving the isolated executable command stubs. The embedding and auth implementation is unchanged.

Co-authored-by: 0xParzival <[email protected]>

---------

Co-authored-by: 0x-Parzival <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: 0xParzival <[email protected]>
)

* fix(auth): recover inconsistent completed credential migrations

* test(auth): brace completed receipt recovery branches
Closes #135140

Reported by @mattcbianco.

## What Problem This Solves

Fixes an issue where users who signed in to OpenAI again after shared auth-store relocation could still get `Explicit auth order for openai has no usable profiles.` before a model request started.

## Why This Change Was Made

Login credentials and per-agent profile order have separate SQLite owners after relocation. Profile promotion now reads the effective credential view before it updates the agent-local order, and it preserves the inherited profile ID when it saves that order.

This keeps explicit order fail-closed behavior unchanged. It does not add a dispatch fallback or copy shared OAuth credentials into the agent database.

## User Impact

A successful OpenAI relogin now places the new usable profile before stale entries, so the next `openai/*` model call can start with the login that just succeeded.

## Evidence

- Current-main baseline: `2e3f734017b9b1a5a32ba11d844d1fa7a5141de9`.
- Before: Codex reported a healthy ChatGPT login and OpenClaw listed a healthy OAuth profile, but the selected Codex runtime had no effective profile. Real Luna and Sol turns stopped before provider dispatch with `Explicit auth order for openai has no usable profiles.`
- After: OpenClaw device login stored the fresh OAuth profile, agent-local order became `[fresh, stale]`, and status reported a usable Codex runtime route.
- Live exact-head result: a real `openclaw agent --local` Luna turn returned exactly `ISSUE_135140_EXACT_HEAD_GREEN_2` through provider `openai`.
- Shipped CLI regression: `models auth login --provider openai --agent main` failed on the baseline because local order stayed absent; passed after the fix with `[fresh, stale]`.
- Focused CLI, owner, and sibling tests: 131 passed across login promotion, auth upsert/rollback, shared-store relocation, and runtime auth planning.
- Oxfmt, Oxlint, and `git diff --check`: passed.
- Autoreview P0: clean.

Production delta: `+4/-5` (net `-1`). Test delta: `+108/-0`.

Co-authored-by: Ayaan Zaidi <[email protected]>
Fixes #135079.

Thanks @dannevang for the detailed report and two-provider reproduction.

## Problem

After an upgrade, `openclaw doctor` could treat custom-provider environment references and generated catalog values as plaintext API keys. It persisted them as auth profiles, and those profiles could shadow the provider's direct environment credential.

## Root cause

Config substitution discarded the fact that a resolved string came from an authored environment SecretRef. Doctor then classified model catalog strings without the provider's authored resolution facts. Runtime planning and status also treated stored profiles as usable ahead of an unqualified provider SecretRef.

## Fix

- Record resolved environment SecretRef provenance during config substitution.
- Make Doctor keep an authored provider SecretRef authoritative over root and plugin catalogs.
- Remove only persisted profiles whose values exactly match that provider's reference markers.
- Make runtime planning and model status prefer the authored provider SecretRef.
- Reuse the already loaded authored model config during status readback.

The production delta is +122 lines. The added code carries provider-specific pending/resolved provenance across config and worker boundaries and performs exact-value cleanup at the credential-migration owner. A global marker heuristic or downstream guard would not preserve this ownership or safely repair existing rows.

## Proof

- Baseline main `9d10dcb5d39d09be94f48a1bfce1dbfd7a256903`: Doctor migrated two `${VAR}` references plus stale or bare generated values; model status selected stored profiles over fresh direct environment values.
- Exact head `fc74120ab55d071e7c876b2f00c9db47032b8bb8`: Doctor migrated no model credentials, preserved both authored references, left no `authProfiles.store` row, and status selected two distinct environment credentials with zero profiles.
- Main commits after the baseline did not touch any changed file.
- Regression tests were red before the fix and green at the exact head.
- Focused tests, the remote changed-scope gate, and the exact-head remote build passed. The first PR CI run exposed source-authority and max-lines defects; the exact failing tests now pass locally.

Co-authored-by: Ayaan Zaidi <[email protected]>
…cpp (#134532)

* fix(docker): install libgomp1 in the runtime image for managed llama.cpp

The official ghcr.io/openclaw/openclaw image (bookworm-slim) never
installed libgomp1. The verified llama.cpp release binaries downloaded
by managed local llama-server setup are linked against libgomp, so the
--version preflight probe fails with "libgomp.so.1: cannot open shared
object file", making local embeddings unreachable in the official
Docker image.

Fixes #134439.

* fix(docker): clarify managed llama-server runtime requirement

Keep the mandatory OpenMP runtime in the image and identify its preflight contract in the existing comment and regression test.

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

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: chelsealong <[email protected]>
* fix(cli): allow authorized node token rotation and revocation

* test(cli): keep token scope fixture indices typed

* test(ui): scope catalog marquee assertions to session rows
…eplyToId (#129345)

* fix(msteams): thread context is dropped when a channel reply has no replyToId

Teams channel activities frequently arrive without `replyToId`. Thread context
resolution keyed exclusively off that field, so parent-message and sibling-reply
context silently never loaded for those turns and the agent answered without any
of the thread it was replying in.

Fall back to the thread root already parsed from the conversation id. The Graph
message URL builder in `attachments/graph.ts` resolves the same value this way
via `threadRootMessageId`, and `resolveMSTeamsRouteSessionKey` likewise accepts
both, so this aligns thread context with the two adjacent call sites rather than
introducing a new source of truth.

The self-comparison guard keeps a top-level post from being treated as its own
parent, mirroring the `threadRootMessageId !== messageId` check in graph.ts.

Behaviour is unchanged whenever `replyToId` is present.

* fix(msteams): resolve thread context against the conversation thread root

Review follow-up: the fallback chose `replyToId` ahead of the conversation's
embedded thread root, which contradicts the canonical precedence used elsewhere
in the plugin.

`resolveMSTeamsRouteSessionKey` reads `conversationMessageId ?? replyToId`, and
`attachments/graph.ts` resolves the Graph message URL from `threadRootMessageId`
the same way. On a deep reply, where both identifiers are present and differ, the
previous ordering routed the session to the thread root while fetching parent and
sibling context beneath the nested reply — attaching context from one message to
the session of another.

Take the conversation root first and keep `replyToId` as the fallback for
activities whose conversation id carries no thread suffix. The self-comparison
guard is retained so a top-level post is not treated as its own parent, matching
the `threadRootMessageId !== messageId` check in graph.ts.

Adds a handler-level regression covering both identifiers present and different;
it fails under the previous ordering.

* refactor(msteams): tighten the thread-root invariant comment

Condenses the nine-line block to the three-line form used elsewhere in this file,
keeping the two load-bearing facts: why the conversation root wins over replyToId,
and that replyToId remains the fallback. No behavior change.

* test(msteams): prove channel thread retrieval at the Graph boundary

The existing thread-parent tests stub ../graph-thread.js, so they pin the
selection rule but never reach the retrieval boundary the repair actually moves.
This asserts on the HTTP requests the process issues instead: thread-context.ts,
graph-thread.ts and graph.ts all run unmocked, and the only stub is globalThis.fetch.

The stub has to be a vi.fn(). fetchWithSsrFGuard treats a fetch carrying a .mock
property as a test-installed mock (isMockedFetch) and lets it win; a plain function
is bypassed in favour of undici dispatcher-aware fetch, and records nothing.

For a channel activity with no replyToId the process now issues:
  GET /v1.0/teams/{aad}/channels/{channel}/messages/{root}
  GET /v1.0/teams/{aad}/channels/{channel}/messages/{root}/replies?$top=50
and the retrieved parent reaches the agent. With threadParentId reverted to
activity.replyToId that set is empty, so the first assertion fails on zero requests.

* test(msteams): prove channel thread retrieval through the registered handler

Replaces the direct-invocation variant with one shaped after
approval-control.mock-gateway.test.ts: the activity enters through
registerMSTeamsHandlers and is driven by the registered Bot Framework onMessage
callback, so the inbound path runs as registered rather than a handler factory
being called directly.

The message handler, thread-context.ts, graph-thread.ts and graph.ts all run
unmocked; Graph is observed at the fetch boundary. The stub has to be a vi.fn()
because fetchWithSsrFGuard only lets a fetch carrying a .mock property win over
undici dispatcher-aware fetch (isMockedFetch).

For a channel activity delivered without replyToId the process issues:
  GET /v1.0/teams/{aad}/channels/{channel}/messages/{root}
  GET /v1.0/teams/{aad}/channels/{channel}/messages/{root}/replies?$top=50
and the retrieved parent reaches the agent as a system event. With threadParentId
reverted to activity.replyToId neither request is issued.

* fix(test): restore ambient fetch and correct the mock-gateway proof signatures

Three defects in the proof added by the previous commit, all caught by CI:

- The fetch stub was never restored, so it leaked into sibling suites sharing the
  worker and extensions/msteams/src/qa/bot-framework-server.test.ts began seeing 200
  for requests it expects to reject. An afterEach now restores the ambient fetch.
  The local full-suite run passed only because vitest happened to order the files
  the other way round; running the two files together reproduces it.
- OpenClawConfig was imported from ./runtime-api.js; the module sits one level up.
- The registered onMessage callback takes (context, next, turnAdoptionLifecycle);
  both call sites passed only the context.

* fix(test): drop redundant String() conversions in the mock-gateway proof

typescript(no-unnecessary-type-conversion) flagged both call sites: the optional
chain already yields a string once defaulted, so String() changes neither type nor
value. The rule is type-aware, so a bare oxlint run over the single file did not
surface it; only the project shard does.

---------

Co-authored-by: Alexander Malysh <[email protected]>
Co-authored-by: Alexander Malysh <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
* fix(ui): ignore tool-only model auth rows

* fix(ui): ignore tool-only model auth rows

* fix(ui): ignore tool-only model auth rows

* fix(ui): ignore tool-only model auth rows

* fix(ui): preserve model accounts when filtering tool credentials

Use canonical monitored-auth evidence for Model Providers cards. Preserve
OAuth and non-expiring token profiles, alias logout targets, configured
models and usage while omitting tool-only API-key rows. Remove duplicate
usage-presence bookkeeping.

Refs #134218. Production LOC -3; tests +56.

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

* test(ui): assert usage failures without provider cards

Replace the stale OpenAI-card readiness wait with the visible usage
failure outcome and assert that an unconfigured provider stays absent.
Preserve the RPC assertion and all configured-provider sibling cases.

Refs #134218. Production unchanged; test LOC net zero.

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

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: wantosure <[email protected]>
…n env is omitted (#134639)

* fix(cron): omit undefined payload fields

* fix(cron): preserve valid payload kind conversions

Omit absent optional payload fields at the replacement producer and remove
unreachable same-kind fallback branches. Keep strict validation and cover
actual service persistence, malformed env, and tool restrictions.

Co-authored-by: Solomon Neas <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Solomon Neas <[email protected]>
Carry disabled workspace roots into the shared backup inventory before tar and SQLite traversal. Preserve nested agent state and keep absolute-link rejection for included content.

Fixes #135218. Supersedes #135243 and #133990.

Thanks @jarvismazz and @yubingjiaocn for the reports. Thanks @ericcaiwx-star and @ruel225 for the original repair work.

Co-authored-by: ericcaiwx-star <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
…135807)

* fix(infra): drop empty PATHEXT entries from Windows extension lookup

resolveWindowsExecutableExtensions split PATHEXT on ";" without dropping
empty components. A trailing ";", which is common in real PATHEXT values,
leaves "" in the list, so an extensionless file matches even when the
caller passed includeExtensionless: false. windows-command.ts and tui.ts
both pass false.

The sibling resolveWindowsExecutableExtSet in the same file already
filters, so this was just the one path missing it.

* fix(infra): reuse normalized Windows executable extensions

Keep extensionless command lookup explicit by sharing the existing PATHEXT parser. Remove duplicate parsing and cover empty suffixes, explicit filenames, and the command-resolution caller.

Co-authored-by: Teddy Tennant <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Teddy Tennant <[email protected]>
…a usage (#135467)

* fix(anthropic): keep context usage when message_delta omits usage

The Anthropic SDK lane guarded the shared usage accumulator against an omitted
message_delta usage object; the managed transport lane called it unconditionally,
where the payload ?? {} fallback overwrote the message_start prompt snapshot with
contextUsage: unavailable. Anthropic-compatible routes whose provider is not
"anthropic" are forced onto that transport, so the population the guard was written
for never had it.

Move the presence check into the accumulator that owns the payload contract and drop
the duplicated guard in the SDK lane, so both lanes follow one rule. A present but
empty usage object still resolves to unavailable, matching the previous SDK check.

* test(anthropic): assert delta context usage through the usage object

expect(usage.contextUsage) narrowed to the object literal returned by the local
emptyUsage helper, which does not declare contextUsage, so the core test-types
stripe rejected it. Read it through toMatchObject like the neighboring cases.

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Yigtwxx <[email protected]>
Sanitize and privatize managed unit backups, restore them atomically on publication failure, surface unsafe remnants, and remove them across uninstall paths.

Closes #131781. Supersedes #131784.

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

Worked on by:
- @vyctorbrzezowski
## What Problem This Solves

Requester-scoped MCP resolution can own serialized work for a runtime key while that runtime has no lease. Idle or cap cleanup could dispose the runtime and its transport before the work finished.

## Why This Change Was Made

The lifecycle owner now treats the existing requester work chain as active ownership. Idle cleanup skips that key, and cap cleanup does not queue an eviction behind that work. Required session disposal still drains the same chain.

## User Impact

Requester-scoped MCP transports and sessions now survive resolver work. Normal idle cleanup still removes the runtime after that work drains.

## Evidence

- Current-main loopback reproduction: the production manager returned one idle eviction while requester resolution was held; expected zero.
- Exact candidate loopback proof: the shipped harness runtime retained the same runtime object and MCP session identifier through the protected sweep, then the later idle sweep removed the runtime and closed the session.
- Cap regression: the original PR head disposed the refreshed requester runtime; the repaired head preserved it.
- [Exact-head agent shard](https://github.com/openclaw/openclaw/actions/runs/33675253407/job/100398989009): 89 files and 1,395 tests passed, including the real loopback boundary.
- Formatting and `git diff --check`: passed.
- Exact-head Autoreview P0: clean.

## Proof Boundary

The proof uses the production MCP runtime manager, the pinned MCP SDK 1.30.0 client and server, and a real loopback Streamable HTTP session. It does not claim external MCP service or provider authentication behavior.

Co-authored-by: Ayaan Zaidi <[email protected]>
…136517)

* fix(plugins): retain mounted source ownership through loading and restart

* ci: refresh checks against current main
…ror (#136713)

Closes #136684

## What Problem This Solves

Fixes an issue where operators restarting a Gateway with a queued follow-up could wait several minutes for shutdown. The queued turn retried after restart admission rejected it, so the old Gateway stayed active until its shutdown deadline.

## Why This Change Was Made

The follow-up queue now follows the existing one-way restart signal. When restart drain commits, it retires process-local queue work and its old callback before the Gateway inspects active work. A reversible restart-signal fence still waits for settlement and retries after rollback.

Durable accepted-input recovery remains the restart owner. The old in-memory queue and execution authority do not cross restart, as documented in `docs/gateway/restart-recovery.md`.

## User Impact

A Gateway with a queued follow-up can finish a supervised restart on the normal shutdown path instead of emitting a retry burst until forced termination. If restart signal admission rolls back, the queued follow-up resumes normally.

## Evidence

Current-main red at `3100ba535f1d003d67a6a7536deacf8666367b38`:

- Blacksmith child-Gateway run: https://github.com/openclaw/openclaw/actions/runs/33711422936
- One held model turn, one confirmed queued same-session follow-up, then `SIGTERM`.
- Queued case reached the real follow-up admission path and emitted `7` `followup queue drain failed` events.
- No-queue control emitted `0` drain failures.

Exact repaired tree at `2baff4f9ed3f84dc9493149dcc20fed441c9baea`:

- Blacksmith exact-tree run: https://github.com/openclaw/openclaw/actions/runs/33714572460
- The same child-Gateway scenario emitted no retry burst and exited in `3.465s`.
- `src/auto-reply/reply/queue.drain-restart.test.ts`: `29` passed.
- `test/gateway-queued-session-rotation.e2e.test.ts`: `2` passed.
- Materialized source hashes matched the local commit on https://github.com/openclaw/openclaw/actions/runs/33715159753.
- Type-aware Oxlint passed on all touched files.
- Oxfmt and `git diff --check` passed.

The focused tests also cover:

- a typed draining error while restart admission stays open;
- restart-signal rollback and queue resume;
- restart-signal promotion to one-way drain;
- synchronous retirement of queued turn ownership and stale callbacks.

Production LOC: `+33/-2` (net `+31`). The growth binds queue authority to the existing restart signal and closes the user-visible shutdown lifecycle gap. Tests: `+316/-0`.

## AI Assistance

AI-assisted repair. The contributor's original restart-fence distinction and credit are preserved. Maintainer follow-up added the real Gateway reproduction, lifecycle retirement, and exact-head proof.

Co-authored-by: Cursor <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
The shipped agent sessions SDK replaced a persisted OAuth credential with the provider refresh result. Providers such as Anthropic return only rotated token fields, so the write removed identity and plan metadata.

Merge the locked stored credential beneath the provider result at the session AuthStorage persistence boundary. Rotated tokens still win, while omitted persisted fields survive.

Tests:
- Published `openclaw/plugin-sdk/agent-sessions` path with real SQLite-backed AuthStorage refresh: red on current main, green on the repaired head.
- `node scripts/run-vitest.mjs src/agents/sessions/auth-storage.test.ts`: 23 passed.
- Focused formatting, lint, and diff checks passed.

Co-authored-by: Ayaan Zaidi <[email protected]>
…137782)

Recognize structured provider SecretRefs at Doctor's mapped-provider credential-presence boundary without resolving secret bytes or accepting empty environment markers.

Preserve missing-key warnings for absent credentials and preserve the live Gateway's owner-specific unresolved-secret diagnostics.

Verified with the real doctor command on baseline main and the exact candidate: provider-owned and remote-memory references, absent keys, bare markers, and two live unresolved-reference controls. All 102 focused tests pass. Synthetic credentials were used with container networking disconnected; no provider authentication is claimed.

Closes #137742.

Co-authored-by: Ayaan Zaidi <[email protected]>
* fix: preserve full access when continuing interrupted tasks

* test: exercise full-access continuation across a live restart

* fix: retain replay safety beyond the recent transcript window

* test: make live restart checkpoints suspend explicitly
@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Final evidence is complete for 900d834:

@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa

Copy link
Copy Markdown
Member Author

Release-owner decision for 2026.8.34: retain fail-closed delegated EPERM/EEXIST behavior. Ordinary config writes retain copy fallback; delegated writes require repairing file/parent ownership or permissions and retrying.

@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Revision 18 (dc1fc6a1) fences included-file backup/publication and rejected-payload creation with live delegated authority, rolls back a rejected payload on post-create authority loss, and provides redacted EPERM/EEXIST permission recovery. The production Gateway route now proves allowed and revoked root and included-file final bytes; focused coverage is 467/467. The release-owner fail-closed decision is recorded above. Fresh exact-head CI and exact upgrade proof are running.

@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Revision 19 (f780a397) addresses both revision-18 findings. Included backup operations now finish root-bound path preparation before checking authority immediately adjacent to rename/unlink/chmod, while atomic copies assert at destination publication. Delegated destructive-write rejection no longer creates a .rejected artifact, so cleanup failure cannot leave residue. The production Gateway route now also revokes after included-backup path preparation and verifies final root/include/backup bytes; focused coverage is 468/468. Full checks and release preflight pass; fresh exact-head CI and upgrade proof are running.

@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Revision 20 (51fc8b42) addresses revision-19’s P1. Included backup copy preserves the existing parent-directory mode and performs the complete fs-safe atomic replacement synchronously after the live-authority check, so directory hardening, temp creation, and publication cannot outlive authority in this process. The production Gateway matrix now verifies parent mode remains 0755 for both allowed and revoked included writes, and the existing root-ownership replacement regression proves the confined include path fails closed. Focused coverage is 468/468; full checks and release preflight pass. Fresh exact-head CI and exact upgrade proof are running.

@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa

Copy link
Copy Markdown
Member Author

Release-owner decision for 2026.8.34: delegated writes to included config files intentionally skip backup rotation because the pinned FsSafeRoot API cannot combine a live authority check with its own final rooted backup effect. Ordinary included-file writes retain rooted backup rotation; delegated final publication remains rooted and fails closed. Exact head 9c7ea50c adds a nested-ancestor replacement regression proving neither approved-root nor outside include/backup bytes change and that delegated backup rotation is never entered. Full repository checks, test type-checking, release preflight, and 468 focused tests pass locally.

@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa

Copy link
Copy Markdown
Member Author

Release-owner decision for 2026.8.34: delegated included-config writes are temporarily unavailable. Exact head 6f35637c rejects them before backup rotation, runtime preflight, or rooted-writer entry because pinned FsSafeRoot 0.5.6 cannot enforce live approval authority at final publication. Ordinary included-config writes remain supported with rooted backups; delegated root-config writes remain supported under the existing final-effect fence. The production Gateway route returns not-applied for an operator-approved delegated include edit with config and backup bytes unchanged. Full repository checks, test type-checking, release preflight, and 468 focused tests pass locally.

@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa

Copy link
Copy Markdown
Member Author

Exact head 7354ecd7 registers the required deferred-capability TODO suppression in the repository’s explicit suppression-tail test; eslint-suppressions.json is unchanged. The exact failing CI test now passes locally (4/4), full test type-checking passes, and the production code/evidence are unchanged from the accepted delegated-include rejection.

@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa

Copy link
Copy Markdown
Member Author

Exact-head evidence for 6eb6941db86f666ea50d6f579ae88df5e007e555:

  • ClawSweeper revision 22 finding addressed: delegated included-config writes now fail closed immediately after rooted target selection, before runtime-candidate construction, validation, snapshot preflight, managed-owner preflight, caller preflight, backup rotation, or publication.
  • Direct tests install the real snapshot and managed runtime-preflight owners and assert neither callback runs; config and backup bytes remain unchanged.
  • Local validation passed: pnpm check, pnpm check:test-types, pnpm release:prepare --version 2026.8.34 --check, 469 focused config/Gateway regressions, and the suppression-policy suite.
  • Fresh exact-head CI and 2026.8.33 copied-state Package Acceptance are active.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@RomneyDa

Copy link
Copy Markdown
Member Author

Final exact-head release evidence for 6eb6941db86f666ea50d6f579ae88df5e007e555 is complete:

  • CI passed 262/262 checks; the unrelated cron shard passed on isolated rerun.
  • Package Acceptance passed package integrity, npm 12 install, frozen-source admission, isolated Docker image construction, and the exact 2026.8.33 copied-state upgrade/reopen survivor lane.
  • ClawSweeper revision 23 found no actionable code findings. Telegram candidate execution remains blocked by the documented trusted-workflow provenance gate and is retained as a canonical post-merge release gate; listed secops owner involvement is a human review gate for this now-ready review head.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: macos App: macos app: web-ui App: web-ui channel: a2a channel: buzz channel: discord Channel integration: discord channel: feishu Channel integration: feishu channel: googlechat Channel integration: googlechat channel: imessage Channel integration: imessage channel: irc channel: line Channel integration: line channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: nextcloud-talk Channel integration: nextcloud-talk channel: nostr Channel integration: nostr channel: qa-channel Channel integration: qa-channel channel: raft Channel integration: Raft channel: reef Channel integration: reef channel: signal Channel integration: signal channel: slack Channel integration: slack channel: sms Channel integration: sms channel: synology-chat channel: telegram Channel integration: telegram channel: tlon Channel integration: tlon channel: twitch Channel integration: twitch channel: voice-call Channel integration: voice-call channel: whatsapp-web Channel integration: whatsapp-web channel: zalo Channel integration: zalo channel: zalouser Channel integration: zalouser cli CLI command changes commands Command implementations docker Docker and sandbox tooling docs Improvements or additions to documentation extensions: acpx extensions: admin-http-rpc extensions: anthropic extensions: arcee extensions: baseten Extension: baseten extensions: byteplus extensions: cerebras extensions: clawrouter Extension: clawrouter extensions: clickclack extensions: cloudflare-ai-gateway extensions: cohere extensions: comfy extensions: copilot-proxy Extension: copilot-proxy extensions: crabbox extensions: deepgram extensions: deepinfra extensions: deepseek extensions: diagnostics-otel Extension: diagnostics-otel extensions: diagnostics-prometheus extensions: document-extract extensions: duckduckgo extensions: featherless extensions: fish-audio Extension: fish-audio extensions: gmi extensions: huggingface extensions: image-generation-core extensions: inworld Extension: inworld extensions: kilocode extensions: litellm extensions: llama-cpp extensions: llm-task Extension: llm-task extensions: lmstudio extensions: lobster Extension: lobster extensions: memory-core Extension: memory-core extensions: memory-lancedb Extension: memory-lancedb extensions: memory-wiki extensions: oc-path extensions: onepassword 1Password plugin extensions: openai extensions: policy extensions: qa-lab extensions: stepfun extensions: tencent extensions: tokenjuice Changes to the bundled tokenjuice extension extensions: vault Extension: vault extensions: web-readability gateway Gateway runtime plugin: azure-speech Azure Speech plugin plugin: beam Beam session sharing plugin plugin: bonjour Plugin integration: bonjour plugin: cua-computer plugin: file-transfer plugin: geolocation Geolocation plugin (IP to coarse city) plugin: google-meet plugin: imap plugin: linux-node plugin: logbook Logbook automatic work journal plugin plugin: migrate-claude plugin: migrate-hermes plugin: mxc plugin: pixverse plugin: teams-meetings Teams Meetings plugin plugin: visitor-access plugin: workboard plugin: zoom Zoom plugin scripts Repository scripts

Projects

None yet

Development

Successfully merging this pull request may close these issues.