Repository navigation
fix: transcript reads fail after concurrent database preparation - #188055
Conversation
Co-authored-by: jalehman <[email protected]> Co-authored-by: vincentkoc <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesCapture transcript-reader validation after database read admission so queued reads receive the current physical database receipt. Example: A queued read for agent main follows a writer that renews validation for the same database.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current-main transcript-reader race with a focused change and no actionable correctness findings; exact-head CI remains pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe transcript runtime admits database reads, prepares requests for native worker pools, and returns session data after the worker validates the database owner. flowchart LR
A[Session history caller] --> B[Transcript runtime]
B --> C[Database read admission]
C --> D[Capture current validation]
D --> E[Native reader worker]
E --> F[Physical owner checks]
F --> G[Session data]
Technical reviewBest possible solution: Keep validation capture inside the existing admitted operation while retaining worker-side identity checks and resource revocation. Do we have a high-confidence way to reproduce the issue? The admission, receipt invalidation, and worker-adoption source establish the failure path; the PR reports a deterministic base-failing regression, which this read-only review did not execute. Is this the best way to solve the issue? This is the smallest complete repair for the demonstrated admission race: move the existing capture rather than retrying failed reads or weakening physical-owner checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 06cd3e0f306b. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1, Tests +51. Total +52 across 2 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 29, 2026, 11:43 PM ET / October 30, 2026, 03:43 UTC (Revision 2). |
Co-authored-by: jalehman <[email protected]> Co-authored-by: vincentkoc <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…nclaw#188055) * fix: transcript reads fail after concurrent database preparation Co-authored-by: jalehman <[email protected]> Co-authored-by: vincentkoc <[email protected]> * fix(test): bind reader regression to its database agent Co-authored-by: jalehman <[email protected]> Co-authored-by: vincentkoc <[email protected]> --------- Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: jalehman <[email protected]> Co-authored-by: vincentkoc <[email protected]>
Preserve the existing 2026.11.5 beta line and its pending test repairs. Repair transcript admission, terminal SQLite iterators, binary attachment classification, detached lifecycle calls, cron late wakes and reload handover. Carry the explicitly requested Bonjour package-integrity fix and release guidance. Selected backports: #188055, #198309, #190242, #198860, #198011, #197658, #197484, #197606. #198011 is the operator-required open PR head, not a merged-main claim. Cron tests are adapted to the existing beta runtime. (cherry picked from commit e3064bf) (cherry picked from commit afa871c) (cherry picked from commit 2c0ab86) (cherry picked from commit fee19a9) (cherry picked from commit dbb6f39) (cherry picked from commit 4d9f782) (cherry picked from commit 87c10f5) (cherry picked from commit ce76ed2) Proof: frozen parent suite passed all 7 shards (265 tests) in 274.45s. Separate unchanged-production baseline reproduced transcript/lifecycle, late-wake and live-receipt failures. SQLite already passed on Node 26.12.1. Independent review found no actionable P0/P1 defects in this snapshot. The complete beta.4 candidate and stable-profile FRV remain pending. Co-authored-by: jalehman <[email protected]> Co-authored-by: vincentkoc <[email protected]> Co-authored-by: Yun. <[email protected]> Co-authored-by: ava-perry <[email protected]> Co-authored-by: Alfred J Berchtold <[email protected]> Co-authored-by: Stronggenetics <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]> Co-authored-by: RomneyDa <[email protected]>
Related: #184511.
What Problem This Solves
Fixes transcript reads failing with a physical-owner validation error when database preparation completes ahead of a queued read.
User Impact
Queued reads use the current validation receipt for the same physical database. Revocation and foreign-file checks remain in force; no retry, schema, configuration or permission change is introduced.
Why This Change Was Made
The history worker captured a validation receipt before awaiting read admission. A preceding writer can renew that receipt during the wait, leaving the real worker with revoked proof. Capture now occurs inside the existing admitted operation, after its predecessors settle. The owner is byte-identical on guest-stack head a17fcb3 and main base 8da85be, establishing an inherited race rather than a membership change.
Evidence
Session reader validation does not match its current physical owner, and passes with this repair. The test does not replace worker execution or returned data.CI typecheck correction
The first head's CI caught a missing
databaseAgentIdin the new regression input. The follow-up binds the request to the fixture's actual database agent; production behavior and the demonstrated admission repair are unchanged. Node 24 reader tests passed 7/7 after this correction, and the actual owningtsconfig.core.test.agents-sessions.jsonleaf, targeted lint, formatting and diff checks passed. Prior 27-test and independent source-review evidence remains scoped to the original production move; one exact-head re-review is requested for the corrected head. No test deadline, check or ceiling was relaxed.Current exact-head build gate — 2026-10-30
The corrected head
bf14009ac769a40b83f2c785361d4084fe239fb6has clean exact-head ClawSweeper review, with no Before-merge items or findings, and its typecheck failure is cleared. CI run 40998529819 is blocked by build-artifacts: the bundled root-help renderer timed out after 120,000 ms inscripts/write-cli-startup-metadata.ts. This leavesopenclaw/ci-gatered.One bounded local
pnpm buildat this exact head passed under verified Node 24.22.1, with isolated HOME/config/state: total build phases 3m 30s, startup metadata 4.22s. The previous 6c62e05e build also passed; the only source delta to the corrected head is the regression input binding, not production code. The later main build passed too, and no intervening repair in the helper or root-help owner was found. These passing controls do not establish a causal fix for the failed hosted build. The timeout remains unattributed / unreproduced locally, not waived or labeled green. No CI rerun, dispatch, no-op push or timeout increase was used. The PR remains unmerged under the requested green-only gate.Bounded root-help timeout audit — 2026-10-30
The failed bundled root-help child reached its 120,000 ms budget, 120,008 ms elapsed, on Node 24.22.1. The hang remains unattributed, not established as inherited or a shared flake.
Read-only run-creation window: 2026-10-29 04:18:24Z through 2026-10-30 04:18:24Z. Logs were observed October 30 at 04:22:31Z–04:29:38Z, not backdated to the creation cutoff. All 24 completed scheduled-main runs returned in that window were inspected. The other-PR sample selected the latest six completed non-cancelled distinct branches per four-hour bin, from at most 100 returned candidates per bin, excluding the guest stack and its two repairs. This is a bounded sample, not an exhaustive incident-rate estimate.
The failed job actually built synthetic merge c87bcb9ca45e19b2f986840c500a471837028fbb, with main parent acb102d and PR parent bf14009. The previous and corrected PR heads had different hosted integration bases. The prior passing local build was the raw PR head, not this synthetic merge; it cannot exclude a base/composition effect. This audit did not replay the exact synthetic merge locally.
At that executed merge, renderBundledRootHelpText imports the root-help bundle and calls outputRootHelp with fresh isolated HOME/state/workspace and a fixed synthetic config. Root help assembles command descriptors rather than registering live command runtimes. The repository-owned runtime-emitted import graph, erasing type-only imports, visited 1,582 eager source modules without reaching either changed file. The dynamic legacy-plugin loader requires a nonempty external-plugin list; the isolated render uses bundled assets, not user-installed legacy plugins. Resolution gaps were confined to external fs-safe/proc-safe packages, whose boundaries were inspected; this is not a complete native/bundled runtime trace. The production delta adds no imports or top-level initialization: it moves validation capture inside an already-invoked admitted reader operation. No causal path from this repair to the help hang was found.
Existing #147932 states a live-config fast-path scope; #187644 explicitly changes exit-code diagnostics, not timeouts. Neither provides a proven repair for this hang. With no matching comparison timeout, no reproduced original hang and no demonstrated cause, no speculative owner patch, timeout increase, rerun/dispatch, empty push or chase rebase was made. The requested green-only landing remains blocked and is escalated to the requesting maintainer.
Compared executed job logs
Contributor credit
Requested by @jalehman while landing the guest-access stack originally contributed by @vincentkoc.
Work sessions