Repository navigation
fix(code-mode): keep waiting results durable across retries - #119055
vincentkoc wants to merge 27 commits into
Conversation
|
Codex review: blocked before merge. Reviewed October 1, 2026, 12:07 PM ET / 16:07 UTC (Revision 56). ClawSweeper reviewWhat this changesThe branch repairs session transcript publication, pending-input settlement, SQLite worker ownership, and native compiler cleanup so retained work preserves its original authority and commits at most once. Merge readiness⛔ Blocked before merge - 2 items remain The session and worker ownership repair remains distinct from current main and has meaningful final-effect evidence. No actionable defect was found in the reviewed boundaries; the member-authored, protected PR remains eligible for continued review. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw's session persistence layer receives agent messages and admitted user inputs, then coordinates SQLite workers and session views. Its ownership checks determine whether delayed work may commit and when callers can observe the result. flowchart TD
A[Agent messages and user inputs] --> B[Session admission]
B --> C[Captured live owner]
C --> D[SQLite worker]
D --> E{Authority still current}
E -->|Yes| F[Commit and publish session view]
E -->|No| G[Refuse without durable changes]
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: Keep transcript writes, pending-input custody, and publication under the original live session/database owner while preserving existing SDK behavior and released transcript bytes. Do we have a high-confidence way to reproduce the issue? Unclear for current main: retained-owner and publication scenarios are concrete and have after-fix native evidence, but this review did not establish a fresh failing current-main execution. Is this the best way to solve the issue? Yes for the inspected boundaries: extending the existing session and SQLite owners preserves authority and publication ordering without introducing a competing persistence owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 01e328528a48. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (55 earlier review cycles; latest 8 shown)
|
af4622a to
611aaaf
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
611aaaf to
3bdc62f
Compare
…tion Retain the frozen state-owner environment from each physical agent database open. Pin reconciliation paths before adopting a cached handle's owner so append and history-read workers use the same shared-state lease registry as the connection. Drain scheduled workers by recorded owner, including custom database paths, and join reconciliation before message-cut fixture teardown. Cover cache reuse, environment mutation, worker lease release, native exit, and incognito sibling behavior. Release note: Fix transcript reconciliation using the wrong state directory when a cached agent database is accessed with another environment or an independent database path. Validation: targeted formatting, staged whitespace, and scoped privacy checks passed. Runtime qualification remains pending.
Keep nested activity tied to its captured turn while accepting same-turn delivery mirrors. Reject later user turns and preserve writer and lifecycle admission.
Carry the originating assistant through result emission and preserve its observed append receipt across awaited hooks.
Bind every persistent mutation-boundary fixture to its temporary state owner before the first database open. Reuse that environment for direct database access and assert retained ownership without changing production behavior or weakening mutation assertions.
Keep persisted transcript replay idempotent under the original transaction and lifecycle owner. Preserve native failure identity, atomic publication, physical database ownership, and drainage of admitted work. Keep private provider-transcript-prefix capability deferred. Punchcard-Session: quiet-workshop-willow-y6
Backport the compiler-owned TypeScript 7.1 boundary from 813169e, duplicate-transform removal from 614aa3a, and canonical SDK mutation fixture correction from 2b2ae31. Preserve the retained Code Mode candidate and its ancestry. Co-authored-by: Peter Steinberger <[email protected]> Punchcard-Session: quiet-workshop-willow-y6
Use the existing failure-trailer boundary around the complete extension compiler entry so diagnostic failures preserve exit status while native child handles drain. Include the helper in generator input identity and assert real failing workers settle under strict process-tree supervision without publishing output or receipts. Punchcard-Session: quiet-workshop-willow-y6
Punchcard-Session: quiet-workshop-willow-y6
Punchcard-Session: quiet-workshop-willow-y6
Punchcard-Session: quiet-workshop-willow-y6
Move synchronous session description into the existing materialization owner, preserving owner context, exact refresh, archive handling and generation checks. This resolves the inherited max-lines failure without changing lint limits or row behavior. Adapt the structural extraction from 124ddc0 (#161124), without the later repository-workspace changes. Existing resident and incognito tests pass before and after (16 cases); both touched files pass the original syntax lint rules. Co-authored-by: Peter Steinberger <[email protected]>
Merge frozen main ab1b932 while preserving ready worker settlement, retained host authority, and exact transcript publication ownership. Retire removed task/coordinator paths and compose the canonical maintenance, snapshot, sharing-acquisition, and follow-up owners. Qualify released agent transcript format through the source-equivalent v2026.9.7 writer/index contract, and expose the isolated child fixture dependency to the native test planner. Focused Linux proof: hydration 35/35 and admission 18/18 on tree ad5d02e; unchanged planner 28/28 on tree b82637cd14d1ba6eba848c09758e0a6945188d1a. Full candidate gates remain pending.
Derive canonical worker descriptors from consumed literal source URLs so static test planning follows executable children without evaluating them. Preserve all 59 registry descriptors and source, packaged, explicit-root and sealed resolution behavior. Verify the descriptor and real planner contracts plus native transport drain and verifier lifecycle: 72 focused remote cases pass on the exact committed tree. Keep the full native gate and earlier session proof separately attributed.
Keep worker title reads behind their admitted lazy operation while removing ineffective host imports. Consume deferred ACP row publication before publishing committed identity maps, matching the canonical lifecycle owner.
Capture registered worker source bytes without interpreting runtime-only imports as declaration-generator dependencies. Complete the native wrapper archive and copied-worker fixture for the extracted SQLite transport owner. Verify the full eager/bootstrap suite and strict generator boundary regression (18 tests), plus both complete declaration input scans.
Consolidate admitted transcript query and transaction owners, preserve the first rollback failure during poisoned connection cleanup, and split oversized owner modules without dropping tests. Restore real worker lifetime observations and move timeout waits to test-owned cancellation with joined cleanup. Preserve the rollback-error ownership from #162139 while retaining unconditional cache and native cleanup. No schema, protocol, or Code Mode capability expansion.
Remove the identical helper copy introduced by main integration. Keep the canonical frozen-main implementation, exports, fixture lifecycle and all queued/killed history assertions.
Keep captured authority callbacks receiver-independent at their owning contracts, preserve both operation and release failures, and join admitted cleanup before fixture teardown. Resolve the remaining core lint findings without changing rules or resource limits.
|
Current maintainer disposition (2026-10-29): archive/defer this candidate while preserving This is not a claim that the candidate was merged, fully qualified, or wholly superseded. Its historical proof status remains pending as recorded in the original PR body. Later scoped fixes were qualified separately; they do not establish whole-stack equivalence. Any residual work needs a separately selected scope against current main. This clarification does not resume #135969, FULL-B, compatibility, local-model, or other paused tracks, and does not establish resource clearance. It records today's disposition, not a reconstructed explanation for the earlier closure. The existing body, source, and history remain unchanged. |
Summary
Repair the session and SQLite ownership boundaries used by OpenClaw Code Mode continuation and ordinary admitted input persistence. Retained execution must keep the original authority, commit at most once, and refuse stale or foreign ownership without changing durable rows. This is correctness work, not a Code Mode efficiency or Beta claim.
Current signed head:
8837ca59748e195b0517b791c576924a089d9f3b; tree:ec53c8d3ccf154183088fdbd53df59c5a3dbb7e2. Its ancestry preserves merged272c07aedfba39cf7cea56f3a938741a8cbe0a7, frozen mainab1b93295ad0f0c093563585bbc76f2e6ce39686, and prior candidate9b8401c7cb4f4e6b5984f349798c6e8f302b0af5. This is not a claim to track later moving main. The PR remains draft; protected build/check/selected-test proof, attached CI and exact-head review are pending.Root Cause And Canonical Repair
Asynchronous preparation, native worker execution, and synchronous SDK publication must share one captured database/session owner. Reconstructing authority after an await, treating a received result as joined cleanup, or publishing against a changed transcript identity can admit stale work, duplicate a durable result, or release custody too early.
new URL(..., import.meta.url)dependency, so the trusted test planner selects its runnable parent rather than atest-supporthelper. The strict gate validator is unchanged.The projection-file extraction first adapted from PR 161124 is already in the frozen main integration; its canonical implementation and contributor credit are retained.
Current Evidence
8837ca59/ec53c8d38837ca598837ca59, first native full attempt8837ca59, same attemptab1; the remaining unit-src run was canceled through the native supervisor and joined. No full-suite pass.8837ca59, later native attempt8837ca598837ca59againstab1b9329pnpm testequivalence.8837ca59Current focused proof used trusted source, qualified task-owned frozen dependencies, Node 26.7.0 / ABI 147 and pnpm 12.5.1 on Darwin, through the native one-worker runner. Both full files ran in one invocation; source identity was preserved and cleanup joined. Local full proof was a documented fallback after remote capacity refusal. No resource, timeout or rule allowance was increased.
Historical Linux proof at
9268833cremains 72/72, not current-head evidence. It used a fresh task-owned frozen install and verified base-plus-delta source before execution:Run receipt:
run_9ae4e6dbb1df20f1cda81926050fdd56. Retained private console SHA-256:49843ee3c15deb5a7222ea10feea93b5175ea77a6f274f3ab5bfa09948eec7e9; public output above omits private paths and infrastructure addresses. The earlier 53-case runrun_aca80e042dfe09a06347d9736e7d00e2and its console prefix5a5ec63b2f1ee14132390452246719d8060c16b5dd732e75e44acc8591126bd4remain bound tod272c07a; its fixture and lease cleanup also completed.Authority And Existing-State Outcomes
The current admission file passed 18/18 at
8837ca59. It exercises retained manager-host work committing once, closed continuation refusal, foreign-manager capture refusal, and nested maintenance authority invalidated before a child grant. It checks final SQLite effects before maintenance disposal and joins cleanup. It preserves legitimate captured authority rather than rejecting a continuation merely because ambient context differs.The hydration and extracted release-format tests cover fresh state, synchronous SDK/worker coexistence and custom database ownership. The released-format case starts with a source-equivalent v2026.9.7 agent transcript, pinned to release source
c074824a27c96d3983043f9eeb33823cd1772d8c: exact released agent DDL, agent schema 24, header v4, original identity payload bytes and the byte-identical released transactional index/active/FTS producer. It immediately reopens through the public SDK, performs SDK then worker appends, checks idempotent replay and reopens again without changing the original bytes, identities or generation. This is not packaged-release execution or shared-state schema 19-to-20 upgrade proof.The first new fixture attempt omitted authoritative index/active/FTS rows and correctly failed bounded-open readiness. The fixture was completed through the released-equivalent producer, not a handcrafted ready stamp, retry, sleep or production fallback. On that earlier tree
b82637cd14d1ba6eba848c09758e0a6945188d1a, planner 28/28 passed, hydration was 34/35 and admission did not run. Those outcomes remain separately attributed; none is added to the current 72 or called a current-head full gate.Retained worker-input/lifecycle, rollback, durable-initialization, transformed/native module-identity and custom-path reconciliation tests remain part of the implementation. Earlier focused proof includes 413 passed plus one existing skip across 26 files in separately attributed continuations, not one final-head run. Later 27-case, 26-case and current 25-case corrections retain their own identities. None replaces the current protected profile or attached CI.
Review Dispositions And Limits
d272c07a, subsequent owner-specific regression proof, and current 18-case admission proof. Wider final-head native gates remain pending. No unrelated provider/chat campaign is substituted for this boundary proof.commitProviderTranscriptPrefix, private Code Mode transcript-authority issuance/binding and associated types/docs/manually seeded tests are absent. There is no capability-free substitute or plugin-exposed issuer. FULL-B, restart/execution rehydration and any future host capability remain held; the old capability-bearing release prerequisite is not represented as shipped or implemented here.Scope And Release Note
Against frozen
ab1b9329, exact no-rename accounting is production +20,904/-6,154 across 215 files (net +14,750); tests/support +22,463/-1,321 across 126 files (net +21,142); metadata +10/-3 across three files. Most growth is the retained candidate: its prior production delta against its original base was net +14,365. Growth implements explicit database/session admission, asynchronous worker custody, identity-safe publication and lifecycle settlement. The latest lifetime-owner extraction is production +187/-182 (net +5), tests +6/-8 (net -2); moved owner bodies are byte-identical. Tests/support include released DDL provenance; archive and ratchet metadata are separate.Release-note context: prevent stale/foreign retained session work from committing or releasing a successor's custody; preserve committed transcript identity and synchronous SDK behavior across worker execution. Normal repair policy leaves the release-owned changelog untouched.
Historical Evidence And Beta Boundary
Historical failures stay failures: publisher 36834021617 failed before allocation on an isolated helper; publisher 36885564005 failed before allocation on a production worker. Both descriptor-edge gaps were repaired at consumed source declarations; the strict validator remains unchanged. The current protected publisher owns the new exact plan, whose routing inventory can differ from older local previews. Publisher 36888381210 subsequently failed strict build; its lease cleanup was separately verified complete. Prior
0661cea8built successfully with UI gzip warnings but core lint timed out at 900 seconds. One separate Linux frozen-baseline run found the inherited max-lines defect; it did not establish Darwin timeout causation. No historical failure is waived by later focused proof.Earlier stack proof, including 47/48, clean lifecycle proof, 206/207 integration and its 29/29 focused correction, remains bound to the source heads in those runs. None is current-head or downstream-stack approval.
Frontier efficacy: INCONCLUSIVE. Frontier Beta: NO-GO. Historical reported accuracy was direct 7/30 versus Code Mode 6/30; visible calls fell 44.4%, but underlying total calls rose 29.9%, prompt tokens 11.6%, agent time 6.8% and wall latency 3.3%. Correctness proof cannot establish an efficiency win. ShellBench remains parked and untouched. Local-model preservation PR 115869 remains separate, non-Beta work; this PR does not discard or qualify it.