Skip to content

fix: transcript reads fail after concurrent database preparation - #188055

Merged
jalehman merged 2 commits into
mainfrom
fix/guest-stack-reader-admission-20261030
Nov 2, 2026
Merged

jalehman merged 2 commits into
mainfrom
fix/guest-stack-reader-admission-20261030

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • On Node 24.22.1, the original filtered-sharing file passed 10/10 in three separate runs on each side (30/30 on a17fcb3, 30/30 on main 8da85be); those passing replays alone did not establish a fix.
  • A deterministic owner-bound regression warms a real worker, holds the next admission, renews the same file's writer validation and releases the read. It fails on main with the exact CI error, 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.
  • Node 24 owner, schema-freshness and original filtered-sharing suites passed 27/27. Core and affected test typechecks, targeted type-aware lint, formatting and diff checks passed. SQLite T1 calls remain 168 → 168. Main's test ceiling is unchanged: 6,283,332 lines against 6,329,653 allowed.
  • Combined scoped wall time was 129.98 s, including compiler preparation and real-worker lifecycle. The new owner case took 25.719 s; it boots/joins the real native worker to prove receipt transfer, which a mocked result cannot establish. Hosted CI timing remains pending.
  • Independent AutoReview (Codex GPT-6.1 Sol, P0–P2, full changed modules plus admission/physical-owner context) reported scoped-clean. It did not execute tests. Simplification retained the existing admission owner and moved the existing capture; production net growth is one line, with one 51-line boundary regression and no new state or helper API.
  • No CI rerun or dispatch was requested. The historical CI attempt was not instrumented, so the controlled reproduction proves this pre-existing mechanism, not the exact scheduling of that attempt.

CI typecheck correction

The first head's CI caught a missing databaseAgentId in 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 owning tsconfig.core.test.agents-sessions.json leaf, 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 bf14009ac769a40b83f2c785361d4084fe239fb6 has 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 in scripts/write-cli-startup-metadata.ts. This leaves openclaw/ci-gate red.

One bounded local pnpm build at 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.

  • Main: 0 matching timeout hits / 24 readable log misses; 23 target jobs succeeded and one was cancelled after metadata completed.
  • Other PRs: 0 hits / 3 readable executed-job misses; 33 skipped target jobs do not count as executions.
  • No unresolved read gaps. Initial job-list 502s were recovered through the attempt jobs API, reconciling both pages against total counts.
  • Successful main metadata phases: 23 samples, min 2.95 s / median 3.75 s / max 6.59 s. Other-PR phases: 3 samples, 3.23–3.79 s. These enclosing-phase durations are not individual-child measurements and do not justify increasing its deadline.

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
Cohort / run build-artifacts job Outcome
main-scheduled / 40997733930 123874872830 success; no matching timeout
main-scheduled / 40992093318 123856995707 success; no matching timeout
main-scheduled / 40985958957 123837278037 success; no matching timeout
main-scheduled / 40982166234 123824920903 success; no matching timeout
main-scheduled / 40973122464 123794871764 success; no matching timeout
main-scheduled / 40965892209 123770578134 success; no matching timeout
main-scheduled / 40957785816 123742805945 success; no matching timeout
main-scheduled / 40949256481 123713207522 success; no matching timeout
main-scheduled / 40940009104 123681118975 success; no matching timeout
main-scheduled / 40931480407 123651383060 success; no matching timeout
main-scheduled / 40921349250 123615410445 success; no matching timeout
main-scheduled / 40912040701 123582934332 success; no matching timeout
main-scheduled / 40901849221 123546531858 cancelled; no matching timeout
main-scheduled / 40891926036 123511308943 success; no matching timeout
main-scheduled / 40882248313 123477179200 success; no matching timeout
main-scheduled / 40874401697 123449813469 success; no matching timeout
main-scheduled / 40865396368 123419193189 success; no matching timeout
main-scheduled / 40857679672 123393053218 success; no matching timeout
main-scheduled / 40849962678 123367113257 success; no matching timeout
main-scheduled / 40842646494 123342881756 success; no matching timeout
main-scheduled / 40835705267 123320201302 success; no matching timeout
main-scheduled / 40830344215 123303163486 success; no matching timeout
main-scheduled / 40823520485 123281314624 success; no matching timeout
main-scheduled / 40818038863 123263982821 success; no matching timeout
other-pr / 40947402311 123707223698 success; no matching timeout
other-pr / 40909326796 123573859156 success; no matching timeout
other-pr / 40841045923 123337823786 success; no matching timeout

Contributor credit

Requested by @jalehman while landing the guest-access stack originally contributed by @vincentkoc.

Work sessions

@clawsweeper

clawsweeper Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 30, 2026 02:56
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Capture 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.

  • Before: The worker receives the revoked receipt and rejects with “Session reader validation does not match its current physical owner”.
  • After: The admitted read captures the successor receipt and returns the existing session entry.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported repair with a meaningful real-worker regression; supplied validation remains integration-test evidence and broad exact-head CI is unfinished.
Proof confidence 🦐 gold shrimp (3/6) This collaborator-authored PR is outside the ordinary contributor proof gate; its supplied evidence reports a real-worker admission regression, not a shipped Gateway demonstration.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Transcript reads can fail after another database operation renews validation while the read awaits admission.
Reason: The maintainer-authored direction repairs a concrete shared-runtime failure without introducing configuration, permissions, or persisted-format changes.

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
Reviewed head: bf14009ac769a40b83f2c785361d4084fe239fb6

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Reader validation handoff and admission ordering keeps the original intent (ad3c930: The inspected patch added physical validation handoff to preserve reader and entry-source ownership; subsequent consolidation retained that responsibility.)
  • Artifact-preserving inspection reads keeps the original intent (e242709: Publication-readiness work retained original-source inspection and skipped ordinary validation capture for artifact-preserving reads.)
  • Foreground reader cleanup coverage keeps the original intent (dbfa55e: Foreground workers must release native readers during explicit database cleanup and reject revoked queued reads.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 64ab4e1 adds src/config/sessions/session-transcript-worker-runtime.ts:244 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 64ab4e1cc63e; files: src/config/sessions/session-transcript-worker-runtime.ts)
  • Vincent Koc: Raw commit eea1c93 adds src/config/sessions/session-transcript-worker-runtime.ts:136 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: eea1c93a1d1c; files: src/config/sessions/session-transcript-worker-runtime.ts)

PR surface

Source +1, Tests +51. Total +52 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 11 10 +1
Tests 1 51 0 +51
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 62 10 +52

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The repair prevents a concrete concurrent-preparation failure in transcript reads, with limited scope and no evidence of widespread outage.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-30T03:01:45.335Z sha 6c62e05 :: needs maintainer review before merge. :: none

Reviewed October 29, 2026, 11:43 PM ET / October 30, 2026, 03:43 UTC (Revision 2).

@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 30, 2026
@jalehman
jalehman merged commit e3064bf into main Nov 2, 2026
211 of 213 checks passed
@jalehman
jalehman deleted the fix/guest-stack-reader-admission-20261030 branch November 2, 2026 05:30
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 3, 2026
…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]>
RomneyDa added a commit that referenced this pull request Nov 15, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants