Skip to content

feat(doctor): relocate shared auth store into state DB - #123349

Merged
steipete merged 6 commits into
mainfrom
claude/shared-auth-relocate
Aug 14, 2026
Merged

steipete merged 6 commits into
mainfrom
claude/shared-auth-relocate

Conversation

@steipete

@steipete steipete commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Shared inherited auth profiles still lived in agents/main/agent/openclaw-agent.sqlite, so the special main-agent lifecycle also owned fleet-wide credentials. Deleting that agent could therefore delete credentials inherited by every agent. H2.1 made the ownership explicit; this change implements the reserved state-db world and moves the shared base to shared state SQLite.

Why This Change Was Made

The shared state schema already declares keyed auth_profile_stores and auth_profile_state tables. This change adds shared-state-specific Kysely adapters over those existing tables with store_key = "shared"; per-agent stores keep their existing tables, keys, and transaction owner. There is no schema-version bump, new table, dual-write, or fallback reader.

openclaw doctor --fix is the single relocation owner. Because WAL cannot make cross-database commits atomic, the handoff is deliberately staged and retryable: Doctor durably copies and byte-verifies rows in the state DB, durably flips auth.sharedStore in a separate state-DB transaction, then deletes the legacy agent rows as repeatable cleanup and finalizes the ledger. Reruns converge from copied-not-flipped, target-only/source-empty, flipped-not-cleaned, and cleaned-not-finalized states. Only ENOENT means the source is absent; permission, corruption, or dangling-symlink failures abort with a typed Doctor diagnostic. Ordinary non-Doctor detection returns before inspecting the source or cleanup ledger.

Secrets audit/apply now carry a closed shared-versus-agent target variant through discovery, projection, snapshot capture, commit, and rollback. Shared targets retain their exact scoped environment and canonical database path, preventing an explicitly routed installation from reading or mutating ambient credentials. Legacy auth-JSON migration receipts are rewritten during relocation to the shared state database/table/key so archived Codex profile-ID recovery continues to work.

User Impact

Doctor reports the legacy-main ownership state and directs operators to openclaw doctor --fix. Effective multi-agent auth stores remain byte-identical across relocation. Once Doctor completes the cutover, the dynamic ownership guard permits normal deletion-journal and purge handling for main, because shared credentials now live independently in state/openclaw.sqlite.

Evidence

  • Exact-head CI is green for 4c42fec117ce9fc29104491d110b13f935423ef5: https://github.com/openclaw/openclaw/actions/runs/31757469609
  • Real SQLite migration fixtures prove copy/readback equality and convergence after every durable stage boundary: copied-not-flipped, copied/source-empty/not-flipped, flipped-not-cleaned, and flipped/cleaned/not-finalized.
  • A multi-agent fixture proves effective credential and auth-state bytes are identical before and after relocation.
  • Receipt recovery proves an archived pre-relocation Codex profile mapping remains usable after the receipt is chained to auth_profile_stores, store_key = "shared", and the shared state database.
  • Two-root secrets tests prove audit/apply use the explicitly scoped shared target and do not inspect or mutate the ambient installation.
  • Main-agent deletion is covered through the normal deletion journal and purge path after relocation.
  • Unfiltered focused suites passed, including 7 shared-auth migration tests and 96 Doctor state-migration tests; auth-profile suites passed 28 files / 393 tests.
  • pnpm tsgo:core, pnpm tsgo:core:test, pnpm check:test-types, pnpm check:architecture, and Knip dependency/unused-export checks passed.
  • Native state schema remains v7. src/state/openclaw-state-schema.sql and CHANGELOG.md are unchanged.

ClawSweeper Rank-up move applied: the exact-head interrupted-migration and completed-upgrade evidence trail is recorded above.

@clawsweeper

clawsweeper Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime commands Command implementations agents Agent runtime and tooling size: XL labels Aug 13, 2026
@steipete
steipete marked this pull request as ready for review August 13, 2026 22:30
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Aug 13, 2026
@steipete
steipete requested a review from a team as a code owner August 13, 2026 22:30
@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. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 13, 2026
@clawsweeper

clawsweeper Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 13, 2026, 8:32 PM ET / August 14, 2026, 00:32 UTC.

ClawSweeper review

What this changes

This PR moves shared inherited auth profiles and runtime state from the main agent database into shared state SQLite through a Doctor-owned migration.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open for maintainer review: the supplied PR context describes a compatibility-sensitive credential migration, but local read-only inspection failed before the exact head, history, and scoped policy could be verified.

Priority: P2
Reviewed head: 4c42fec117ce9fc29104491d110b13f935423ef5
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The PR context presents substantial validation, but local infrastructure prevented an exact-head implementation review.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied context identifies a member-authored PR; its body reports SQLite fixture and suite evidence, but this reviewer could not inspect the evidence or exact head.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied context identifies a member-authored PR; its body reports SQLite fixture and suite evidence, but this reviewer could not inspect the evidence or exact head.
Evidence reviewed 2 items Inspection infrastructure failure: Read-only shell commands failed before any repository file, history, or scoped policy could be inspected: the sandbox reported a loopback RTM_NEWADDR permission error.
PR-stated migration boundary: The supplied PR context says Doctor copies, verifies, and removes legacy shared-auth rows before recording state-db ownership; this needs exact-head source review because it relocates durable credentials.
Findings None None.
Security Needs attention Verify credential migration failure handling: Shared auth profiles and OAuth state move between durable databases; exact-head inspection is required to confirm failed or interrupted migration never leaves credentials unavailable or inconsistently owned.

How this fits together

Agents combine local credentials with a shared inherited auth base. Doctor migrates legacy durable auth rows, then runtime, secrets tooling, and agent deletion use the shared state database.

flowchart LR
  A[Legacy main-agent auth database] --> B[Doctor migration]
  B --> C[Copy and verify rows]
  C --> D[Shared state SQLite]
  D --> E[Auth and secrets tools]
  E --> F[Agent deletion]
Loading

Decision needed

Question Recommendation
Does the exact-head evidence establish that interrupted and upgraded installations retain shared credentials without fallback or data loss? Review exact-head migration proof: Confirm the source and real SQLite migration evidence preserve credentials before approving the relocation.

Why: This changes persistent authentication ownership and the local review environment could not verify the migration implementation or its claimed validation.

Before merge

  • Resolve security concern: Verify credential migration failure handling - Shared auth profiles and OAuth state move between durable databases; exact-head inspection is required to confirm failed or interrupted migration never leaves credentials unavailable or inconsistently owned.
  • Resolve merge risk (P1) - The migration changes durable credential ownership; without exact-head inspection, its interrupted-copy recovery and upgrade behavior cannot be confirmed.
  • Complete next step (P2) - A protected maintainer PR changing persistent auth state needs exact-head source and upgrade verification before merge.

Findings

  • [medium] Verify credential migration failure handling
Agent review details

Security

Needs attention: The PR relocates durable credentials, but the environment failure prevented review of exact-head persistence, access, and failure-path handling.

PR surface

Source +1169, Tests +650, Docs +3. Total +1822 across 44 files.

View PR surface stats
Area Files Added Removed Net
Source 27 1848 679 +1169
Tests 13 763 113 +650
Docs 4 10 7 +3
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 44 2621 799 +1822

Review metrics

Metric Value Why it matters
Production versus test delta production +887 net; tests +339 net The PR body reports substantial production growth for a persistent-auth migration, so exact-head recovery review matters before merge.

Stored data model

Persistent data-model change detected: migration/backfill/repair: docs/auth-credential-semantics.md, migration/backfill/repair: docs/cli/doctor.md, migration/backfill/repair: src/agents/auth-profiles/path-resolve.ts, migration/backfill/repair: src/commands/doctor-auth-migration-receipts.ts, migration/backfill/repair: src/commands/doctor-auth.hints.test.ts, migration/backfill/repair: src/commands/doctor-auth.ts, and 32 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Verify exact-head upgrade recovery (recommended)
    Require maintainers to confirm that the Doctor migration preserves shared credential availability through interrupted and completed cutovers.
  2. Pause the migration
    Hold the PR if recovery evidence cannot be reproduced against the current head.

Technical review

Best possible solution:

Review the exact head’s Doctor migration, rollback/failure behavior, and before/after credential availability before merging.

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

No: the review runner could not execute even read-only repository inspection, so there is no verified current-head migration reproduction.

Is this the best way to solve the issue?

Unclear: the proposed Doctor-owned migration matches the stated ownership goal, but its exact implementation and alternatives could not be inspected.

AGENTS.md: unclear because the file could not be read completely.

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

Labels

Label changes:

  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The supplied context identifies a member-authored PR; its body reports SQLite fixture and suite evidence, but this reviewer could not inspect the evidence or exact head.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P2: This is a significant but non-emergency change to shared credential storage and upgrade behavior.
  • merge-risk: 🚨 compatibility: Existing installations must move persisted shared-auth rows without changing inherited-auth behavior.
  • merge-risk: 🚨 auth-provider: An incomplete or failed migration could leave providers unable to resolve existing credentials.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The supplied context identifies a member-authored PR; its body reports SQLite fixture and suite evidence, but this reviewer could not inspect the evidence or exact head.

Evidence

Security concerns:

  • [medium] Verify credential migration failure handling
    Shared auth profiles and OAuth state move between durable databases; exact-head inspection is required to confirm failed or interrupted migration never leaves credentials unavailable or inconsistently owned.
    Confidence: 0.78

What I checked:

  • Inspection infrastructure failure: Read-only shell commands failed before any repository file, history, or scoped policy could be inspected: the sandbox reported a loopback RTM_NEWADDR permission error.
  • PR-stated migration boundary: The supplied PR context says Doctor copies, verifies, and removes legacy shared-auth rows before recording state-db ownership; this needs exact-head source review because it relocates durable credentials. (src/infra/state-migrations.shared-auth-store.ts, 4c42fec117ce)

Likely related people:

  • steipete: The supplied PR context attributes all six branch commits, including the migration and crash-safety updates, to this contributor; current-main history could not be inspected. (role: proposed migration author; confidence: low; commits: 3c3cfe3352a3, b34ea2b7426b; files: src/infra/state-migrations.shared-auth-store.ts, src/agents/auth-profiles/sqlite.ts)

Rank-up moves

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

  • Provide maintainers an exact-head interrupted-migration and completed-upgrade evidence trail if existing CI does not make it readily inspectable.

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-13T22:35:13.857Z sha 13ba14c82452051567a657cbc240f76671b72d60 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-13T22:40:04.586Z sha 13ba14c82452051567a657cbc240f76671b72d60 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-13T23:20:16.616Z sha 9f5bd21f97e1941d427d76c4a5d048f7ab9dc6c9 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T00:17:57.372Z sha 2fc7d3f :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 13, 2026
@steipete
steipete force-pushed the claude/shared-auth-relocate branch from 83a7626 to c51c5dd Compare August 14, 2026 00:01
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 14, 2026
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 14, 2026
@steipete
steipete merged commit d2dad76 into main Aug 14, 2026
156 checks passed
@steipete
steipete deleted the claude/shared-auth-relocate branch August 14, 2026 00:44
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 14, 2026
* feat(doctor): relocate shared auth store into state DB

* fix(doctor): make shared auth relocation crash-safe

* fix(doctor): skip disabled shared auth inspection

* fix(doctor): break shared auth migration cycle

* fix(doctor): remove unused migration type export

* fix(test): remove duplicate Codex attempt shard
pacocartones added a commit to pacocartones/openclaw that referenced this pull request Aug 28, 2026
`checks-node-compact-large-4` failed in
`test/vitest-projects-config.test.ts > covers each normal full-suite test file
exactly once`, reporting `extensions/codex/src/app-server/run-attempt-state.test.ts`
registered in two lanes. Neither that test nor the vitest configs are touched by
this PR, and the same shard failed identically on an unrelated PR of mine on the
same run. It reproduces locally on a clean checkout of the previous merge base.

The duplicate registration entered with `d9d97024002` (openclaw#123363) and was removed
from `vitest.extension-codex-app-server-attempt-extra.config.ts` in `d2dad76ecde`
(openclaw#123349), which is on main now.

No change to this PR's diff.
pacocartones added a commit to pacocartones/openclaw that referenced this pull request Aug 28, 2026
`checks-node-compact-large-4` failed in
`test/vitest-projects-config.test.ts > covers each normal full-suite test file
exactly once`, reporting `extensions/codex/src/app-server/run-attempt-state.test.ts`
registered in two lanes. Neither that test nor the vitest configs are touched by
this PR, and the same shard failed identically on an unrelated PR of mine on the
same run. It reproduces locally on a clean checkout of the previous merge base.

The duplicate registration entered with `d9d97024002` (openclaw#123363) and was removed
from `vitest.extension-codex-app-server-attempt-extra.config.ts` in `d2dad76ecde`
(openclaw#123349), which is on main now.

No change to this PR's diff.
steipete added a commit that referenced this pull request Oct 15, 2026
…ply text (wave-4 bundle) (#172669)

* refactor(infra): remove redundant replay and freshness machinery

Trust successful migration statements inside their synchronous transactions,
reuse unchanged approval parses, share canonical package-root discovery,
namespace directory caches by plugin identity, and simplify ephemeral presence,
OS facts and suspension timer bookkeeping. Keep source validation, conflicts,
transaction durability, postcommit checks, security authority and write settlement.

Best-effort tradeoffs accepted

- Node-host own-write verification (#108457): no human successful-SQL-loss report; SQL errors still roll back, and independent source retirement checks remain.
- Workspace setup/attestation replay (#109147): no human driver-rewrite report; trust successful writes while retaining fingerprints and later source checks.
- APNs expected-ID replay (#108543): no human silent-insert-loss report; canonical parsing, tombstones and receipts remain.
- Device-auth presence assertion (#112663): no human successful-upsert-loss report; credential validation and transaction failure handling remain.
- Device-identity replay (#110392): no human silent-row-rewrite report; preserve independent post-await verification before source deletion.
- MCP OAuth replay (#161219): no human silent-write-loss report; canonical/source parsing and worker admission remain.
- Exec-approval read/parse/deep-compare replay (#114063): no human successful-driver-rewrite report; malformed policy stays fail-closed and actual authority is unchanged.
- Shared-auth target reread (#123349): no human silent-row-rewrite report; return the known SQL postimage and keep independent copy/flip/cleanup checks.
- Identical authored approval bytes (#168094) reuse the existing parse; changed normalized bytes still parse before publication.
- Plugin metadata fingerprinting (353d778): no human in-place metadata-mutation report; distinct objects remain isolated, and same-object edits use TTL/reset.
- Duplicate asset ancestor search (7224585): no human cached-miss incident; canonical realpath/wrapper discovery remains, while newly appearing packages need owner invalidation/restart.
- Presence logical clock (#134737): provenance is synthetic rollback/suspend tests; clock correction may temporarily retain or hide display rows until full update/reconnect, wall time catches up, or restart. TTL, capacity and connection privacy remain.
- Suspension timer generation (#130003): the removed test directly called a canceled callback; native timer cancellation and current-entry authority remain. An out-of-contract timer implementation could resume a renewed lease early.
- OS tuple-keyed cache (#135911): keep measured probe sharing and sticky labels; hot-patching OS identity needs restart rather than another namespace.
- Presence list type guards (409a160): callers supply validated arrays; existing normalization still owns their values.

Production +40/-228, net -188. Focused migration, asset/cache, presence/caller,
approval-publication and suspension/OS tests pass, as do production and infra-test
types, changed-file lint, assertion and suppression checks, and zero-cycle checks.
Independent final review has no actionable P0-P2 findings. No schema, durability,
retention, indexing, permission, recovery or public SDK change is intended.

Broad changed-check is not claimed green: the original base reproduces the
455-versus-454 environment budget failure. The initial Web Push Doctor timeout
remains unattributed; all Web Push production hunks were dropped and its exact
test passed on restored source. Full build and hosted CI remain unrun.

* refactor(agents): simplify reply preparation and refresh bookkeeping

Share typed actor-store adapters and prepared async auth reads. Reuse the
admitted memory-flush plan, retain last-good catalog views by provider, and
remove unused metadata bookkeeping and config projections. Preserve live
credential/effect authority, FIFO, transcript durability, and ordinary write
settlement. Net production reduction: 303 lines.

Best-effort tradeoffs accepted:
- Plugin-drain successors (#162301, synthetic): wait the current drain once;
  a later reload owns its own publication and recovery.
- A changed memory-flush plan during preparation (#162177/#121157, synthetic):
  finish with the admitted plan; the next turn resolves again.
- Per-row catalog freshness (#158113, synthetic): failed discovery retains
  the provider's last-good configured and supplemental overlays until success.
  Existing auth/profile/source gates and successful-empty replacement remain.
- MCP sibling invalidation during discovery (#138694, synthetic): a listing
  may briefly be stale; the next read observes the invalidation.
- Passive context metadata supersession (#119607, synthetic): late discovered
  metadata may win until refresh. Keep the single current-promise check before
  replacing configured limits, preserving the human capacity fix (#39857).
- Registration-time question answers (#110372/#134003, synthetic): a prompt
  can briefly race the answer; its terminal signal closes delivery.
- Duplicate or never-attached internal question registrations: both real
  producers attach once synchronously. Unsupported misuse loses its extra
  diagnostic/disposal wakeup; ordinary lifecycle rejection remains.
- Cancellation publication once/must-consume flags (#161124, synthetic): the
  sole internal producer invokes once. Keep active-scope/effect authority.
- In-flight placement-service replacement (#164744, synthetic): use the
  captured startup service, with its observation and writer authority intact.
- Compaction callback rebinding (#146732/#163264, synthetic): current work
  retains its captured callbacks and live assertion; later work captures anew.
- Re-entrant logging between synchronous run-owner checks: #162227 removed
  the awaited retry, making the second check redundant. Real post-await and
  mutation-effect checks remain.
- Startup diagnostic admission (#146792): the sole producer checks lifecycle
  immediately before recording. Remove only the recorder's duplicate check;
  preserve the human abort/recovery fix (#146692), reset, and admin redaction.

Release-note context: verbose diagnostics no longer include suppressed reply
text or background bash command contents. Execution and user replies remain
unchanged. Config show uses the same schema-aware redactor without cloning
an already detached result or redacting unused snapshot views.

Validation: touched core, messaging and Gateway-method type graphs passed;
49 changed TypeScript files passed targeted lint/format; runtime and Madge
cycles are both zero. Auth reader, question authority, memory flush, restart
claim, catalog worker, cancellation and compaction boundary proof is recorded
in the lane ledger. Final supplemental run: 392 tests passed, four failed
across 28 files, with final source verification. All 120 agents-support tests
passed, including refresh coalescing, publication, run-wait and compaction.
The four failures were an unchanged 120s ACP reset deadline and three MCP
fixtures settling before child startup markers (empty logs, existing 1-2s
connection/4s catalog deadlines). Narrow failed-case replay passed ACP reset
and two MCP cases; the one-second MCP retirement fixture still failed before
its first child marker. Clean lane-base comparison could not reach assertions:
the temporary checkout lacked workspace-local dependency links for worker
compilation. That case is unresolved, not proven inherited; coordinator-bundle
CI must adjudicate it. No deadline, retry, skip or assertion was weakened.
The final selected real-dispatch suppressed-reply logging regression passed
with completed source verification (one selected case, 202.58s wrapper).

Independent P0-P2 review completed four passes. Declined duplicate findings
about unsupported placement-service hot-swap (real observation/database/writer
authority remains) and alleged run-wait awaits (only synchronous logging lies
between the checks; real mutation and post-await checks remain).

Broad check-changed is NOT green: env-name budget 455/454 also fails on the
unchanged lane-base index, with no added env names; production/full-tree Knip
hit their existing 600s budget; the silent legacy-store scan was interrupted
after 782s. Those two scans are missing proof, not attributed inherited reds.
Hosted coordinator-bundle CI remains the broad gate. Owned mock/type/legacy
fixture findings were corrected and their targeted replays pass.

No changelog, dependency, database schema, durability, retention, permission,
or public API change is included. BELOW-500 branch-only coordinator handoff;
no lane PR or merge.

* chore: shrink stale reply assertion allowance

* test: align catalog publication calls with current contract
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 15, 2026
…ply text (wave-4 bundle) (openclaw#172669)

* refactor(infra): remove redundant replay and freshness machinery

Trust successful migration statements inside their synchronous transactions,
reuse unchanged approval parses, share canonical package-root discovery,
namespace directory caches by plugin identity, and simplify ephemeral presence,
OS facts and suspension timer bookkeeping. Keep source validation, conflicts,
transaction durability, postcommit checks, security authority and write settlement.

Best-effort tradeoffs accepted

- Node-host own-write verification (openclaw#108457): no human successful-SQL-loss report; SQL errors still roll back, and independent source retirement checks remain.
- Workspace setup/attestation replay (openclaw#109147): no human driver-rewrite report; trust successful writes while retaining fingerprints and later source checks.
- APNs expected-ID replay (openclaw#108543): no human silent-insert-loss report; canonical parsing, tombstones and receipts remain.
- Device-auth presence assertion (openclaw#112663): no human successful-upsert-loss report; credential validation and transaction failure handling remain.
- Device-identity replay (openclaw#110392): no human silent-row-rewrite report; preserve independent post-await verification before source deletion.
- MCP OAuth replay (openclaw#161219): no human silent-write-loss report; canonical/source parsing and worker admission remain.
- Exec-approval read/parse/deep-compare replay (openclaw#114063): no human successful-driver-rewrite report; malformed policy stays fail-closed and actual authority is unchanged.
- Shared-auth target reread (openclaw#123349): no human silent-row-rewrite report; return the known SQL postimage and keep independent copy/flip/cleanup checks.
- Identical authored approval bytes (openclaw#168094) reuse the existing parse; changed normalized bytes still parse before publication.
- Plugin metadata fingerprinting (f31bc71): no human in-place metadata-mutation report; distinct objects remain isolated, and same-object edits use TTL/reset.
- Duplicate asset ancestor search (40fb74f): no human cached-miss incident; canonical realpath/wrapper discovery remains, while newly appearing packages need owner invalidation/restart.
- Presence logical clock (openclaw#134737): provenance is synthetic rollback/suspend tests; clock correction may temporarily retain or hide display rows until full update/reconnect, wall time catches up, or restart. TTL, capacity and connection privacy remain.
- Suspension timer generation (openclaw#130003): the removed test directly called a canceled callback; native timer cancellation and current-entry authority remain. An out-of-contract timer implementation could resume a renewed lease early.
- OS tuple-keyed cache (openclaw#135911): keep measured probe sharing and sticky labels; hot-patching OS identity needs restart rather than another namespace.
- Presence list type guards (3965f6b): callers supply validated arrays; existing normalization still owns their values.

Production +40/-228, net -188. Focused migration, asset/cache, presence/caller,
approval-publication and suspension/OS tests pass, as do production and infra-test
types, changed-file lint, assertion and suppression checks, and zero-cycle checks.
Independent final review has no actionable P0-P2 findings. No schema, durability,
retention, indexing, permission, recovery or public SDK change is intended.

Broad changed-check is not claimed green: the original base reproduces the
455-versus-454 environment budget failure. The initial Web Push Doctor timeout
remains unattributed; all Web Push production hunks were dropped and its exact
test passed on restored source. Full build and hosted CI remain unrun.

* refactor(agents): simplify reply preparation and refresh bookkeeping

Share typed actor-store adapters and prepared async auth reads. Reuse the
admitted memory-flush plan, retain last-good catalog views by provider, and
remove unused metadata bookkeeping and config projections. Preserve live
credential/effect authority, FIFO, transcript durability, and ordinary write
settlement. Net production reduction: 303 lines.

Best-effort tradeoffs accepted:
- Plugin-drain successors (openclaw#162301, synthetic): wait the current drain once;
  a later reload owns its own publication and recovery.
- A changed memory-flush plan during preparation (openclaw#162177/openclaw#121157, synthetic):
  finish with the admitted plan; the next turn resolves again.
- Per-row catalog freshness (openclaw#158113, synthetic): failed discovery retains
  the provider's last-good configured and supplemental overlays until success.
  Existing auth/profile/source gates and successful-empty replacement remain.
- MCP sibling invalidation during discovery (openclaw#138694, synthetic): a listing
  may briefly be stale; the next read observes the invalidation.
- Passive context metadata supersession (openclaw#119607, synthetic): late discovered
  metadata may win until refresh. Keep the single current-promise check before
  replacing configured limits, preserving the human capacity fix (openclaw#39857).
- Registration-time question answers (openclaw#110372/openclaw#134003, synthetic): a prompt
  can briefly race the answer; its terminal signal closes delivery.
- Duplicate or never-attached internal question registrations: both real
  producers attach once synchronously. Unsupported misuse loses its extra
  diagnostic/disposal wakeup; ordinary lifecycle rejection remains.
- Cancellation publication once/must-consume flags (openclaw#161124, synthetic): the
  sole internal producer invokes once. Keep active-scope/effect authority.
- In-flight placement-service replacement (openclaw#164744, synthetic): use the
  captured startup service, with its observation and writer authority intact.
- Compaction callback rebinding (openclaw#146732/openclaw#163264, synthetic): current work
  retains its captured callbacks and live assertion; later work captures anew.
- Re-entrant logging between synchronous run-owner checks: openclaw#162227 removed
  the awaited retry, making the second check redundant. Real post-await and
  mutation-effect checks remain.
- Startup diagnostic admission (openclaw#146792): the sole producer checks lifecycle
  immediately before recording. Remove only the recorder's duplicate check;
  preserve the human abort/recovery fix (openclaw#146692), reset, and admin redaction.

Release-note context: verbose diagnostics no longer include suppressed reply
text or background bash command contents. Execution and user replies remain
unchanged. Config show uses the same schema-aware redactor without cloning
an already detached result or redacting unused snapshot views.

Validation: touched core, messaging and Gateway-method type graphs passed;
49 changed TypeScript files passed targeted lint/format; runtime and Madge
cycles are both zero. Auth reader, question authority, memory flush, restart
claim, catalog worker, cancellation and compaction boundary proof is recorded
in the lane ledger. Final supplemental run: 392 tests passed, four failed
across 28 files, with final source verification. All 120 agents-support tests
passed, including refresh coalescing, publication, run-wait and compaction.
The four failures were an unchanged 120s ACP reset deadline and three MCP
fixtures settling before child startup markers (empty logs, existing 1-2s
connection/4s catalog deadlines). Narrow failed-case replay passed ACP reset
and two MCP cases; the one-second MCP retirement fixture still failed before
its first child marker. Clean lane-base comparison could not reach assertions:
the temporary checkout lacked workspace-local dependency links for worker
compilation. That case is unresolved, not proven inherited; coordinator-bundle
CI must adjudicate it. No deadline, retry, skip or assertion was weakened.
The final selected real-dispatch suppressed-reply logging regression passed
with completed source verification (one selected case, 202.58s wrapper).

Independent P0-P2 review completed four passes. Declined duplicate findings
about unsupported placement-service hot-swap (real observation/database/writer
authority remains) and alleged run-wait awaits (only synchronous logging lies
between the checks; real mutation and post-await checks remain).

Broad check-changed is NOT green: env-name budget 455/454 also fails on the
unchanged lane-base index, with no added env names; production/full-tree Knip
hit their existing 600s budget; the silent legacy-store scan was interrupted
after 782s. Those two scans are missing proof, not attributed inherited reds.
Hosted coordinator-bundle CI remains the broad gate. Owned mock/type/legacy
fixture findings were corrected and their targeted replays pass.

No changelog, dependency, database schema, durability, retention, permission,
or public API change is included. BELOW-500 branch-only coordinator handoff;
no lane PR or merge.

* chore: shrink stale reply assertion allowance

* test: align catalog publication calls with current contract
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR 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. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant