Repository navigation
feat(plugin-sdk): awaited session persistence; deprecate sync transcript writes - #163264
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
|
Codex review: blocked before merge. Reviewed October 2, 2026, 9:46 AM ET / 13:46 UTC (Revision 17). ClawSweeper reviewWhat this changesAdds awaited session persistence APIs, migrates bundled callers to worker-backed writes, and deprecates retained synchronous plugin APIs. Merge readiness⛔ Blocked before merge - 2 items remain This PR remains useful: current main still routes some awaited message writes through synchronous persistence. No actionable correctness or security finding was established, and the prior generic upgrade blocker is covered by the accepted SDK direction and retained compatibility contracts. Priority: P2 Review scores
Verification
How this fits togetherSession persistence stores agent conversation history and plugin metadata in SQLite. Agent runs, extensions, and provider replay hooks submit mutations; committed receipts update the loaded conversation and notify downstream consumers. flowchart TD
A[Agent runs and plugins] --> B[Awaited session APIs]
B --> C[FIFO write admission]
C --> D[Live authority checks]
D --> E[SQLite worker commit]
E --> F[Committed receipt]
F --> G[Conversation view and notifications]
A --> H[Deprecated synchronous adapters]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Use the existing worker writer for bundled persistence while preserving shipped synchronous plugin contracts through their documented SDK-major migration window. Do we have a high-confidence way to reproduce the issue? Not applicable as an SDK feature review; current-main source confirms the synchronous fallback that motivates the cutover, and recorded worker regressions exercise the affected boundary. Is this the best way to solve the issue? Yes. Extending the existing persistence owner and migrating bundled callers together avoids competing writers while retaining third-party compatibility. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e8570948dad0. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (16 earlier review cycles; latest 8 shown)
|
Preserve main's awaited custom-entry and projection behavior, integrate transcript maintenance into the hydration worker owner, and keep all bundled callers on awaited persistence. SDK-owner direction: add awaited calls while retaining deprecated synchronous adapters.
Model the retarget as an independent operation so the fixture reaches post-commit publication validation. Keep the committed receipt, accounting, and replacement-transcript assertions intact.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…ipt writes (openclaw#163264) * feat(plugin-sdk): await session persistence and deprecate sync writes * test(sessions): fix awaited persistence fixture types * fix(sessions): preserve binding and delivery publication * test(sessions): isolate compaction retarget authority Model the retarget as an independent operation so the fixture reaches post-commit publication validation. Keep the committed receipt, accounting, and replacement-transcript assertions intact. * fix(ci): remove duplicate database-worker test routing Main already routes attempt-phase-lifecycle.test.ts through the database-worker owner. Remove the duplicate introduced by the SDK branch. Exact-head preflight and the native local manifest both reproduced the failure; the corrected manifest passes with 69 selected Node rows. Unique test coverage and the duplicate guard stay intact. Formatting and P2 review pass. * fix(sessions): keep maintenance projections with the host owner Return committed projection-rebuild facts from maintenance workers and schedule them through the existing host owner. Preserve custody, rollback, and synchronous compatibility. Update async fixtures and host-broker test routing, restore the native wrapper import inventory, and route memory visibility declarations through their existing producer. Focused Linux proof passed342 tests across17 suites; old-code controls fail at pending projections. SDK declarations retain legacy signatures with four additive exports. Types, lint, T1, Madge, focused routing checks, and P2 review pass. * test(cli): await blocked-run hook entry without polling Await the existing hook-entry gate instead of racing awaited transcript persistence against vi.waitFor's one-second default. Preserve the early-settlement failure and the assertion that agent_end must finish before the CLI run settles. The two focused cases pass in 155.98s including preparation; their test bodies take 3.656s and 1.804s. Fresh P2 review is clean. * test(cli): use the deferred helper default type * test(gateway): keep worktree fixture on the shared state root Use the nested fixture only for workspace and device files. Activating its environment switches process state roots underneath the shared Gateway, whose projection retains its startup environment. Preserve the registry witness guard and every cwd, transcript, initial-run, and follow-up assertion. CI observed AgentDatabaseRegistryChangedError during creation. The exact callback interleaving was not captured, and unmodified main passed the whole file in 172.229s; that is non-reproduction, not inherited-failure qualification. The corrected fixture passes all 10 cases in original order in 164.077s. Semantic lint, formatting, and fresh P2 review pass. * refactor(sessions): separate hydration types and CLI hook fixtures Keep transcript hydration results beside their request contracts and retain aggregate exports. Move the CLI hook fixture owner into test support without changing coverage. This removes both line-cap increases after main integration; 112 composition tests and all 52 reliability tests pass.
…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
…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
What Problem This Solves
Session transcript persistence has an incomplete awaited SDK: bundled callers still use synchronous writes, and some async message calls silently fall back to caller-thread SQLite.
User Impact
Plugins can await transcript mutations, extension session changes, and provider replay metadata until the existing SQLite writer commits. The synchronous APIs retain their current behavior as deprecated third-party compatibility adapters until the next Plugin SDK major, with one warning per method per process.
Incognito remains with its existing host-owned store until its worker migration activates. Native compaction retains its existing synchronous source-authority row check for callbacks that must fail immediately; transcript persistence is awaited through the writer. Transcript formats, schemas, retention, and update/Doctor behavior are unchanged; no data conversion is required.
Why This Change Was Made
SDK-owner direction: Peter Steinberger explicitly requested this public SDK evolution on October 1, 2026: “i rather have us build better SDK calls now and deprecate sync stuff.” This is the owner-directed addition of awaited calls and deprecation of retained synchronous adapters; it does not shorten their compatibility window.
Complete the existing SessionManager async family and move bundled callers onto it. Keep FIFO admission, input custody, live authority, atomic compaction accounting, branch/leaf semantics, and committed view publication with their existing owners. A known commit that cannot be published is reported without replaying the write.
This is one PR because separating provider replay into a follow-up would leave bundled Google and ClawRouter replay calling the deprecated synchronous path in the SessionManager PR. The API replacements and their consumers need to move together.
API migration
SessionManager.appendMessageappendMessageAsyncappendMessageWithTranscriptAnchorappendMessageWithTranscriptAnchorAsyncappendCompactionappendCompactionAsyncappendResetBoundaryappendResetBoundaryAsyncappendCustomEntryappendCustomEntryAsyncappendSessionInfoappendSessionInfoAsyncappendCustomMessageEntryappendCustomMessageEntryAsyncappendLeafControlappendLeafControlAsyncappendLabelChangeappendLabelChangeAsyncbranchbranchAsyncbranchWithSummarybranchWithSummaryAsyncremoveTrailingEntriesremoveTrailingEntriesAsyncpersistpersistAsyncprepareTranscriptRewriteprepareTranscriptRewriteAsync, then await itscommitSessionManager.appendMessageToTranscriptSessionManager.appendMessageToTranscriptAsyncSessionManager.open/openBoundedopenAsync/openBoundedAsyncSessionManager.openDetachedBounded/openModelContextopenDetachedBoundedAsync/openModelContextAsyncsetSessionTarget/reloadPersistedTranscriptsetSessionTargetAsync/reloadPersistedTranscriptAsyncExtensionAPI.appendEntryappendEntryAsyncExtensionAPI.setSessionName/setLabelsetSessionNameAsync/setLabelAsyncAgentSession.setSessionNamesetSessionNameAsyncProviderReplaySessionState.appendCustomEntryProviderReplaySessionStateV2.appendCustomEntryAsyncProviderPlugin.sanitizeReplayHistorysanitizeReplayHistoryAsyncwith the V2 contextsanitizeGoogleGeminiReplayHistorysanitizeGoogleGeminiReplayHistoryAsyncAwaited methods preserve the corresponding entry ID/result.
persistAsyncremains a raw write and does not add an entry to the loaded tree.resetLeafAsyncadds ordered in-memory navigation; synchronousresetLeafremains supported. Existing promise-returning model/thinking changes andcreateBranchedSessionkeep their names.Compatibility records in
src/plugins/compat/session-persistence-records.ts, aggregated byregistry-records.ts, aresession-manager-sync-persistence,extension-session-sync-persistence, andprovider-replay-sync-persistence. All useremovalGate: "next-plugin-sdk-major"; none has a calendar removal deadline. The retained adapters are the deprecated SessionManager methods, their synchronous guard bindings, legacy ExtensionAPI/AgentSession bindings, and the legacy provider replay hook/state/helper. They remain solely for third-party compatibility.Bundled migrations cover session runtime and replay, compaction and cleanup, worker/Gateway transcript commits, CLI transcripts, and Google-family, ClawRouter, and GitHub Copilot provider hooks. Runtime fixture helpers also use awaited setup; compatibility suites retain coverage of synchronous behavior. Caller audits use
git grepplus an untracked-file check. The remaining direct synchronous calls outside SessionManager are the named ExtensionAPI entry/label adapter,AgentSession.setSessionNameadapter, and legacy provider replay state adapter; active bundled flows use their awaited replacements.Tracked bundled-caller audit command
Matches were inspected for receiver ownership; only the named compatibility adapters, SessionManager forwarding methods, supported local-only
resetLeaf, and unrelated APIs remain. A separatepersist/ExtensionAPI/provider-hook search and anrgpass including new files completed the audit. Awaited writes return into their existing settlement owners; worker notifications enqueue synchronously and are drained before completion.Landing validation
Current head:
ffcc2e9aac2b7e7d70503be44a073091cb7698cd. Exact-head CI run 37011923214 completed attempt 2 with 142 jobs settled: Windows passed its authorized single-job rerun; only the independently main-reproduced Linux assertion and its aggregate CI gate remain failed. ClawSweeper completed the exact-head review with no actionable correctness or security findings. The Windows failure was investigated under coordinator direction and passed its one authorized single-job rerun. The remaining inherited Linux failure follows the approved native admin route. The prior heada3638e99da6b455eb520b28b6c4bb7af8da4cfc5passed CI run 37007596489, with 141 jobs settled and zero failures, and completed ClawSweeper review with no actionable correctness or security findings. That is retained prior-head evidence, not current-head CI.Main subsequently conflicted in the assertion baseline. Merge commit
11756b4feb5260ff8397799a6dd0071741f908b6incorporates main96c556f653817b24bb95ee6e7c4e464562dffabb, preserving main's obsolete-row removal and this PR's shrink-only assertion counts. The awaited compaction boundaries, prompt-history tracking, and both transcript-worker operation families remain intact. No newly landed active bundled calls to deprecated persistence APIs were found.The merged composition passed all 112 tests across eight session-boundary, compaction, async-message, maintenance, model-context, generation-readiness, and artifact-planning files (437.17s wall including source verification). Core types, SDK surface/exports, formatting, assertion safety, and the exact-parent database-worker ratchet pass; T1 does not increase. Commit
ffcc2e9aac2b7fixes two line-cap increases by moving hydration result types beside request types and extracting the CLI hook fixture. It preserves aggregate type exports and every test assertion. The full CLI reliability file passes 52/52 tests (88.129s); targeted semantic lint, core types, line-cap and suppression ratchets, and Madge (zero cycles) pass.check-changedthen reaches an independently reproduced main failure: 477 environment names against budget 476. Clean exact main96c556ffails the same guard with the identical name set. Main commitcee0906f3877c436725a079d4e41537fc204f75cintroducedOPENCLAW_PROMPT_CACHE_ASSERTinsrc/agents/embedded-agent-runner/prompt-cache-observability.tswithout changing the budget. This PR adds or removes zero counted names, and the budget is unchanged. Current-head CI will determine whether an inherited-failure exception is needed.Windows failure investigation and authorized rerun: job
110853876349failedextensions/acpx/src/runtime-argv.process.test.tsinpreserves ACP argv through real processes and reconnect (leased=true, command=path)withACP_SESSION_INIT_FAILEDafter 5000ms. The coordinator authorized one single-job rerun after ruling out PR causation. The fixture calls ACPXensureSessionand its unchanged startup client. Its before/after-spawn lease callbacks useprocessLeaseStore.save→PluginStateKeyedStore.register→ the shared plugin-state worker. They do not execute this PR's SessionManager async methods, deprecated sync wrappers, transcript writes, or session-history worker routing. The ACP reply-dispatch path is lazy and is not invoked by this fixture. The generated wrapper imports only Node built-ins; the synthetic peer imports Node built-ins and the ACP SDK. Protocol traffic uses stdout and diagnostics use stderr, and the log contains no persistence-deprecation warnings or JSON parse failures.The 5000ms budget also covers wrapper/child startup and Windows descendant discovery after the initialize handshake. The exact slow phase is unknown. Compared with successful prior-head run
37007596489, the native Windows shard increased from 355.25s to 463.54s (+30.5%). Its Windows process group rose from 108.06s to 159.57s and its ACP group from 35.37s to 81.62s; together they account for about 90% of the increase. Unleased ACP cases and unrelated native/node/npm-shim CLI launches were substantially slower too. Worker compilation was faster and median matched passing-test time was unchanged, so this was broader process-startup slowdown, not uniform shard slowness. There is no CPU/load telemetry establishing the underlying cause.The seven completed scheduled-main runs inspected from workflow
209874334all passed Windows job 1; the newest scheduled run was queued. The bounded sample of recent failed PR runs likewise found passing applicable Windows rows, not the same timeout. Historical passes do not prove a flake. The reachability evidence independently satisfies the coordinator's condition for one targeted retry; no code, timeout, baseline, or assertion was changed. The one Windows-only rerun completed successfully as job110861721133, attempt 2, at 13:52:16 UTC. No additional rerun was submitted. This passing retry is not presented as a code fix or proof of the original timing cause.The other failed root, Linux job
110853879915, is independently proven inherited: untouchedembedded-agent-runner.guard.test.tsstill expects “missing tool result,” while main commitcee0906fintentionally changed the default interruption guidance. The full file on clean main96c556freproduces the identical failure (15 passed, 1 failed, 116.002s). All nine causal files match CI mainfc17c21; the failing assertion, fixtures and text producer also match tested merge292df717db8d3fda8610ff098018029274394935. The latest hourly main run predates the introducing commit; subsequent push runs are security-only. This qualified failure does not qualify the separate Windows timeout. The inherited Linux result remains failed evidence. Native admin evidence binds attempt 2, current failed job110861730317, aggregate gate110866559677, the exact tested merge, unchanged causal files, and the independent clean-main reproduction. All 142 jobs are terminal with no cancellations; security checks passed.The important integration repairs keep an already-published newer native view when an older worker receipt arrives and move maintenance projection reconciliation to the host owner after worker commit. Previously a transient worker scheduled work the host could not observe, leaving bounded reads in
rebuilding. Committed reconciliation facts now return to the existing host owner with the captured source/new-branch identity. Existing authority, custody, and settlement guards remain intact; schemas and public return types are unchanged.Focused proof: the repair-tree Linux Testbox campaign passed 342 tests across 17 suites, with one existing platform skip (306.16s); both final projection regressions fail old production with
SessionTranscriptProjectionUnavailableError: rebuilding(49.38s). Subsequent merged-composition proof passed 19 read-worker/session tests (156.78s), 12 recovery-report tests (213.96s including cache preparation), and all 66 memory-host, startup-WebChat, and terminal-failure tests after main's fixes (258.27s). These retain earlier proof for unchanged inputs; they are not a claim of green current-head GitHub CI.Core production and affected test types, targeted lint/formatting, SDK export/surface checks, Madge (zero cycles), and the worker ratchet pass. The current candidate has no T1 growth against incorporated main
96c556f. The previous integration's native CI manifest passed with 73 selected rows. The selected shared-SDK package boundary and memory-wiki consumer compile also pass. Earliercheck-changedreached the known 11 overdue compatibility records, independently reproduced on its base; this PR adds no date-eligible retirement record, and that guard was not weakened.SDK compatibility: generated comparison on repair tree
fa6e9d23da21against2ab22d8772fbpassed in 297.308s: four added direct exports, no removed exports/entrypoints or changed direct signatures. Reachable declarations have 25 additions, 54 changes, and no whole removals; inheritance-aware inspection finds no missing public/protected members. Legacy extension/replay contracts remain compatible and new runtime hooks are optional. The introduced delta across session classes, provider owners, and the four SDK barrels is still byte-identical after the latest merge (324,272 bytes; SHA-256aa2419e2d1c433dba0ce59f0c86de404b1ffa3d271c2318618f130ef88b57c9b). This reuses generated proof with source verification; it is not a freshly generated final-head global declaration digest.Review: the full merged candidate completed both P2 review passes. One queued-rename finding was rejected against the actual owner:
appendSessionInfoAsynccallsappendEntryAsyncandwithSessionManagerWritesynchronously; the latter captures the original target before enqueueing, then rejects a changed target before invoking the write callback. The post-commit publication check protects the separate continuation boundary. The four-file extraction then completed fresh P2 review with no accepted/actionable findings. The earlier workspace-conflict retry finding was rejected after tracing typed recovery and atomic transcript deduplication; the 12-case recovery suite passes. Exact-head ClawSweeper completed successfully in workflow 37012006262 at 13:22 UTC with no correctness or security findings. Its generic compatibility checklist is covered by the recorded owner direction and unchanged stored formats.CI failure handling: run 36986586871 exposed duplicate test routing;
cef4b507b16aremoves it. Run 36987779764 exposed the projection bug, asynchronous fixtures/mocks, host-broker routing, wrapper import closure, selected SDK producer alias, and formatting gaps;a35e3fb1ce8arepairs those owners. The inherited Codex request-array expectations were aligned with main's intended model-list lookup. These were investigated from exact logs and repaired without weakened guards.Later CI exposed a one-second polling assumption before the blocked CLI run reached
agent_end.10739ebc4874awaits the existing hook-entry signal while preserving early-settlement failure and hook-release assertions; two focused cases pass in 155.98s wall (3.656s and 1.804s test bodies).9f891ab73d04removes a redundant default type argument caught by semantic lint; targeted lint and fresh P2 review pass.Run 36999794713 also observed a registry-generation race in managed-worktree session creation. The test activated a second process state root while retaining a suite Gateway whose projection keeps its startup environment.
1ee4acf32b15uses that nested fixture only for filesystem paths (applyEnv: false), preserving all cwd, transcript-header, initial-run, follow-up, and registry-authority assertions. Unmodified main passed all ten cases in original order (172.229s), and the repaired candidate passed all ten (164.077s), with semantic lint and P2 review clean. The exact original callback interleaving was not captured; the main replay is non-reproduction, not qualification for an inherited-failure exception. No passing replay is presented as proof that the original race disappeared.Run 37002321028 on
55dd92cc4929finished with four failed root jobs: ten known roster/copy failure contexts. The latest main merge incorporates the landed memory-host, startup-WebChat, and authentication-copy repairs. Earlier independent main proof reproduced 14 exact failures across eight files, and a separate clean-main memory-host run reproduced its sole retired-default failure (34 pass/1 fail; 103.573s). The interrupted Workshop preparation and unrun later baseline cases remain unclaimed. No admin exception has yet been used; any remaining failure must qualify against the exact final CI head and tested merge.Final prior run 37004843534 on
b801345200071finished with only two failed root jobs: six plugin session-read fixtures and one orphaned-recovery fixture still used retired roster shapes. Their exact failures were independently reproduced on main, but before using an exception we found both fixes landed inef27c1fc2be3. The candidate now incorporates those fixes and the accompanying stronger session-owner/sharing admission guards. All 33 focused Gateway metadata-admission, SDK metadata-admission, plugin session-read, and orphaned-recovery tests pass in 292.53s. Both full-candidate P2 review passes are clean, and core types, SDK surface/export checks, formatting, and the exact-parent T1 ratchet pass. The historical inherited-failure draft is superseded; no admin exception has been used.The native tooling dependency changed on main from fs-safe 0.22.0 to 0.23.0. A new clean trusted-main tooling checkout was created with frozen dependencies; the shared tooling root was not edited. The product merge uses main's committed lockfile, with no dependency override.
Measured changed-test costs use the native test wrappers with
--maxWorkers=1; no timers, assertions, or baselines were relaxed. Earlier per-file repair command walls: AgentsAPI instructions 22.787s, environment 23.014s, Codex context-overflow 26.321s, subscription 27.385s, attempt-session-boundary 30.956s, transcript rewrite 53.221s, maintenance 37.795s. The planner run had 113 passes and one inventory-order failure in 69.855s; the corrected ownership/sorting assertion passed in 14.37s. Current-head CI timings will be recorded from its actual run.Evidence before main integration
T1: 1,548 → 1,548 sites, 328 → 328 files (delta 0).
pnpm check:database-worker-ratchet --base b156ca03970ceadb1600b1ef9479734d3cdf4ea6passes (1.927s). New writes execute in workers; retained compatibility methods reuse existing synchronous kernels. The readers insession-accessor.sqlite-suffix-read.tsandsession-transcript-maintenance-read.tsreceive an already-admitted database; durable acquisition stays in the worker dispatcher, and incognito uses its captured native owner. No inventory classifications or T1 budgets increased.Final-head runtime proof: 32/32 tests pass on Testbox: SDK metadata admission 12/12, 32.653s and worker transcript commits 20/20, 51.585s. This includes post-commit session retargeting and persisted/published assistant delivery facts. Negative controls on exact preceding commit
31f378dfd6267fail for the intended defects: name publication resolves and emits the replacement name (23.747s); delivery persistence retains raw directives and lacks delivery facts (32.395s). Final types, lint, caps, T1 ratchet, Madge, and the SDK declaration comparison pass. The complete native proof invocation exited 0 with no failed gates; the two expected negative-control failures were separately verified.Earlier focused Testbox proof: 266 selected tests passed. Proof is the native command result; the lease carrier workflow can show cancelled after cleanup. Individual suites used
pnpm test <file> --maxWorkers=1; the grouped run used the repository test wrapper.These cover returned IDs, FIFO ordering, worker commit and publication ordering, rejected writes, user/custom message worker custody, live authority, branch/leaf state, immutable rewrite publication, and once-per-method deprecation warnings. Earlier focused proof also passed static transcript notes, compaction boundaries/persistence, and provider replay runtime. Base negative controls failed for the intended defects: caller-thread message transaction (23.658s) and compaction publication before awaited authority (23.622s).
A broader 101-file / 1,666-test caller/sibling sweep took 26m34.116s, including 12m50.7s build preparation. It initially had 37 failures in 10 files; all 10 were repaired and passed focused follow-up. Neighbor fixture failures found during follow-up were also repaired and passed in the final run. The broad sweep was not repeated just to replace its recorded result.
node scripts/check-changed.mjs --base b156ca03970ceadb1600b1ef9479734d3cdf4ea6reaches an inherited compatibility-policy failure (63.957s): 11 old records are already eligible for removal. An independently installed exact-base checkout reports the same 11. Base has 22 deprecated records; this branch has 25, with zero new removal-eligible records. The unrelated public contracts and guard were left intact; remaining selected gates were run through their native owners.Core production types (42.894s), extension production types (49.221s), extension test types (76.554s), scripts types (40.683s), dead-export scans (76.499s), lint, formatting, file caps, and the selected schema/storage/import guards pass. All 27 core test-type graphs pass using retained unaffected results plus targeted repairs: the first five took 188.6s, 21 other successful Testbox graphs took 740.058s, and the repaired session graph passed locally in 9.930s. On the final head, both affected graphs passed again: sessions 37.768s, gateway 34.838s. The 22-graph continuation took 776.687s including its one subsequently repaired fixture failure. Final-head lint passed in 10.014s; both file-cap gates passed (10.015s, 0.503s).
Madge: 0 cycles, 25.238s. Full
pnpm build: pass, 641.435s, including all 154 public SDK subpaths, 96 plugin distributions, and bootstrap/UI gates; subsequent changes were covered by focused runtime/type/declaration checks.Canonical generated SDK API/declaration comparison against the pinned base passes (238.443s): 4 added direct exports, 0 removed exports, 0 removed entrypoints, and 0 changed direct-export signatures. The additions are the two V2 replay types on
coreandplugin-entry. The final digest matches the prior audited result; the declaration detail has 25 additions and 51 changed declarations, with no whole-declaration removals. The inheritance-aware reachable declaration audit found 0 missing public/protected class members; legacy replay state/context and ExtensionActions remain source-compatible. Reachable changes add async methods, V2 types, and optional hooks, alongside internal worker/helper moves. Raw emitted file text also reflects internal type/module moves, so it is not literally an insert-only text diff.The SDK surface policy grows by exactly four exports for those requested V2 types; entrypoint and callable ceilings stay unchanged. Canonical surface check passes. Assertion baseline edits only remove obsolete assertions.
git grepand an untracked-file audit found no active bundled production calls to deprecated persistence APIs; all remaining calls are the named third-party adapters above. New persistence promises are awaited or returned to their settlement owner.Diff size: +3,181 net production lines (+5,067/−1,886), +2,197 tests/support, +188 docs, and 0 net tooling/policy. This includes all new files. The larger implementation preserves pending-input custody, worker authority and settlement, atomic compaction accounting, and committed-view publication across the complete caller cutover. The deslop pass removed duplicated adapters and narrating comments; retained adapters have named public compatibility records. Independent Codex branch autoreview is clean through P2 on final head
461a575ed3266(two complete passes, zero actionable findings). Session-name publication revalidates its binding after commit, and worker batches preserve assistant delivery facts. Both final regressions pass and their exact preceding-commit controls fail at the intended assertions. PR CI timings were not yet available at creation; runtime-suite times above are measured Testbox command walls. The 9.930s fixture type repair and its 26.182s lint check ran locally.