Repository navigation
refactor(gateway): keep worker transcript reads off the Gateway thread - #153335
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 September 22, 2026, 12:01 PM ET / 16:01 UTC (Revision 18). ClawSweeper reviewWhat this changesMoves worker-turn and workspace-result transcript reads onto the existing history worker, with ownership checks after asynchronous reads and regression coverage for cancellation and settlement. Merge readiness⛔ Blocked before merge - 1 item remains This remains useful: current main and the latest release retain the synchronous reads. No actionable introduced defect was found, and the previous migration-proof blocker does not apply to this caller-only change. Priority: P2 Review scores
Verification
How this fits togetherGateway worker coordination prepares conversation history for remote execution and reconciles completed workspace results. Transcript snapshots feed launch preparation and result validation, while existing admission owners retain control over writes. flowchart TD
A[Worker turn or completed result] --> B[Capture transcript identity]
B --> C[History worker reads snapshot]
C --> D{Relevant owner still current?}
D -->|Execution owner| E[Prepare credentials and launch]
D -->|Pending result owner| F[Validate and settle result]
D -->|No| G[Reject stale operation]
F --> H[Existing admitted transcript writer]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +21, Tests +677. Total +698 across 8 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep transcript hydration with the existing history worker and preserve separate execution and pending-result ownership through the established admission boundaries. Do we have a high-confidence way to reproduce the issue? Yes, from source: current-main worker preparation and reconciliation call synchronous transcript readers directly. No runtime latency reproduction was executed during this read-only review. Is this the best way to solve the issue? Yes. Reusing the already-landed asynchronous reader and existing write-admission owner is a focused solution; this delta requires no data migration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ddbbc80aac5a. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (17 earlier review cycles; latest 8 shown)
|
f285b3a to
9954f52
Compare
7d0f8ec to
791ad1d
Compare
9954f52 to
8199034
Compare
791ad1d to
549c034
Compare
8199034 to
cc7ed4a
Compare
549c034 to
b31d2c4
Compare
21fb89d to
7bdafba
Compare
b31d2c4 to
31dd062
Compare
7bdafba to
80145ce
Compare
31dd062 to
9f26b5f
Compare
80145ce to
050320c
Compare
9f26b5f to
eebba35
Compare
c081523 to
cd92e10
Compare
Integrate the reviewed Plain successor based on landed hydration main. All three Recorder feature files and the complete feature patch remain identical. The reached transcript, admission, framing, and worker owners are unchanged. Retain the exact feature review and compiled entry/type evidence by parity, plus the current Plain owning-type proof. Prior Recorder head bc61065 passed hosted CI; the earlier catalog timeout and separate prerequisite readiness failure remain recorded without attributing or claiming fixes here. Source: #153337; depends on #153335.
Absorb the reviewed Plain successor and already-landed archive fixture repair. All three Recorder feature files and the complete feature patch remain exact. No Recorder request, dependency manifest, or ownership contract changed. Retain source-bound feature review and compiled-entry evidence by parity. The prior catalog timeout and subsequent green Recorder CI remain separate observations; no additional product fix is claimed by this composition. Source: #153337; depends on #153335.
Absorb the reviewed Plain successor and already-landed owning type graph fix. All three Recorder feature files and the complete feature patch remain exact. No reached Recorder runtime, admission, session owner, or manifest changed. Retain source-bound feature review and compiled-entry evidence by parity, including green hosted CI for the prior Recorder head. The Plain owner passed its current owning type graph; no duplicate fix or runtime replay is claimed. Source: #153337; depends on #153335.
Absorb the reviewed Plain successor and canonical main fixes. All three Recorder feature files and the complete feature patch remain exact. Retain the Recorder feature review and compiled-entry proof by parity. The Plain owner separately passed seven current ownership/terminal cases and owning types for the shared hydration extraction. The canonical memory repair passed three positive cases and failed both historical blocking controls; its postprocessing limitation and verified cleanup remain recorded. Source: #153337; depends on #153335.
|
Merged via squash.
|
Integrate actual main after the Plain prerequisite landed. The resulting diff against main contains only the exact three reviewed Recorder feature files; there is no remaining hydration or Plain prerequisite delta. Validate the current dependency graph with a normal physical frozen install including fs-safe 0.18.1. All nine selected admitted-history/currentness cases and the owning Gateway type graph passed on the exact composed tree. Retain the prior feature-scoped review by byte-identical patch parity. Source: #153337; builds on merged #153335.
…ges (#153337) * refactor(sessions): reconcile hydration with current worker context * fix(sessions): remove unused hydration worker type export Keep the hydration input private to its shared worker union owner while retaining the externally consumed SQLite target input export. This clears the unused-export finding without changing emitted runtime code. * refactor(gateway): hydrate worker transcript reads asynchronously * fix(gateway): keep worker history at admitted input Wait for canonical recorder persistence before preparing cloud-worker history. Read the exact admitted prefix and use its user entry as the transcript base, so later activity cannot shift or duplicate the current input during replay. Preserve current authority checks, asynchronous credential acknowledgment, and replacement-worker recovery. Validation: current owning Gateway types and 24 admitted-history cases with freshly compiled transcript workers, plus fresh independent P2 review. Exact feature bytes retain prior strict lint, formatting, and 55-case caller proof; the earlier broader run's slow fork-shutdown warning remains documented. Release-note context: cloud-worker launches keep the current user admission out of replay and retain its correct transcript base across persistence races. Source: #153337; depends on #153335. * fix(sessions): stream full hydration within worker memory limits Transfer canonical transcript chunks through the existing history worker while retaining one read-only snapshot and complete caller-side results. Preserve SQLite text encodings, BOM errors, cancellation, current-owner checks, and native cleanup without raising the worker heap limit. * test(sessions): align hydration error controls with streaming Model interactive admission and the canonical streaming result in the existing quarantine error fixture, preserving its cleanup and retirement assertions. Remove a redundant unknown-alias assertion from the reader; emitted production JavaScript is unchanged. The complete 21-case worker error file, assertion ratchet, owning types, scoped lint, and fresh P0-P2 review pass.
openclaw#153335) * refactor(sessions): reconcile hydration with current worker context * fix(sessions): remove unused hydration worker type export Keep the hydration input private to its shared worker union owner while retaining the externally consumed SQLite target input export. This clears the unused-export finding without changing emitted runtime code. * refactor(gateway): hydrate worker transcript reads asynchronously * fix(sessions): stream full hydration within worker memory limits Transfer canonical transcript chunks through the existing history worker while retaining one read-only snapshot and complete caller-side results. Preserve SQLite text encodings, BOM errors, cancellation, current-owner checks, and native cleanup without raising the worker heap limit. * test(sessions): align hydration error controls with streaming Model interactive admission and the canonical streaming result in the existing quarantine error fixture, preserving its cleanup and retirement assertions. Remove a redundant unknown-alias assertion from the reader; emitted production JavaScript is unchanged. The complete 21-case worker error file, assertion ratchet, owning types, scoped lint, and fresh P0-P2 review pass.
…ges (openclaw#153337) * refactor(sessions): reconcile hydration with current worker context * fix(sessions): remove unused hydration worker type export Keep the hydration input private to its shared worker union owner while retaining the externally consumed SQLite target input export. This clears the unused-export finding without changing emitted runtime code. * refactor(gateway): hydrate worker transcript reads asynchronously * fix(gateway): keep worker history at admitted input Wait for canonical recorder persistence before preparing cloud-worker history. Read the exact admitted prefix and use its user entry as the transcript base, so later activity cannot shift or duplicate the current input during replay. Preserve current authority checks, asynchronous credential acknowledgment, and replacement-worker recovery. Validation: current owning Gateway types and 24 admitted-history cases with freshly compiled transcript workers, plus fresh independent P2 review. Exact feature bytes retain prior strict lint, formatting, and 55-case caller proof; the earlier broader run's slow fork-shutdown warning remains documented. Release-note context: cloud-worker launches keep the current user admission out of replay and retain its correct transcript base across persistence races. Source: openclaw#153337; depends on openclaw#153335. * fix(sessions): stream full hydration within worker memory limits Transfer canonical transcript chunks through the existing history worker while retaining one read-only snapshot and complete caller-side results. Preserve SQLite text encodings, BOM errors, cancellation, current-owner checks, and native cleanup without raising the worker heap limit. * test(sessions): align hydration error controls with streaming Model interactive admission and the canonical streaming result in the existing quarantine error fixture, preserving its cleanup and retirement assertions. Remove a redundant unknown-alias assertion from the reader; emitted production JavaScript is unchanged. The complete 21-case worker error file, assertion ratchet, owning types, scoped lint, and fresh P0-P2 review pass.
Built on #153325, now landed on main.
What Problem This Solves
Worker-turn preparation and workspace-result reconciliation load full transcripts synchronously on the Gateway thread.
User Impact
These reads await the existing history worker while preserving admitted history and pending workspace results. Revoked execution owners cannot proceed to credentials or launch after hydration; accepted terminal results can still settle after execution cancellation.
Why This Change Was Made
The callers use the asynchronous session view and recheck their captured transcript target and live placement claim after each new await. Terminal and workspace reads retain pending-result authority, while writes remain with the existing admission owner. Main's credential acknowledgment, reconnect recovery, and canonical cleanup are preserved. Recorder-prefix preparation follows separately.
Views remain finite snapshots, without a new freshness poll or transcript lease through later transport waits. Earlier rejected snapshot-freshness review concerns remain recorded separately from the subsequent clean feature review.
Evidence
On the current main
29e7a6c0composition, seven existing ownership and terminal-settlement cases passed with one worker (48.797 seconds including worker preparation and verification). They exercise the newly shared hydration helper through the real worker entry and preserve accepted terminal settlement after execution cancellation. The owning Gateway type graph passed in 11.525 seconds; source stayed unchanged, and diff checks passed.All eight feature changes and the six caller/test postimages remain identical to the reviewed caller patch; only main's additive routing entries changed. Earlier full-file, compiled Node/Bun, review, and green CI results retain their original source identities. The original failed runs and broad lint timeout remain recorded.
This head carries the canonical archive-fixture and type-partition repairs already landed in #155751 and #155734. It also carries the canonical Memory fixture from #155745 rather than the superseded warmup alternative. That separate Memory proof has three passing canonical cases and two expected failures with the old blocking behavior; its postprocessor error and skipped final hash assertions remain explicitly recorded, with cleanup verified. These component results are not relabeled as new executions of this PR.
Current-head hosted CI and the normal native main-targeted review/landing gates remain required.