Repository navigation
fix: keep Gateway responsive during restart checkpoint scans - #158680
fuller-stack-dev wants to merge 1 commit into
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: needs real behavior proof before merge. Reviewed September 28, 2026, 9:01 AM ET / 13:01 UTC (Revision 8). ClawSweeper reviewWhat this changesThe branch moves durable restart-checkpoint classification into the session-history reader worker, keeps incognito reads process-held, and adds tests and worker-access documentation. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 9 items remain Current main still has the restart-scan responsiveness gap. The pinned PR head remains useful, but it is not ready to land: its new classifier omits a recovery authority rule already fixed on main, and the described correction is not published. Priority: P2 Review scores
Verification
How this fits togetherAfter a Gateway restart, recovery reads a session transcript to decide whether an interrupted turn may resume. The proposed worker read returns checkpoint and input-source facts to the recovery store, which resumes or tombstones the turn. flowchart LR
A[Gateway restart] --> B[Session transcript]
B --> C{History location}
C -->|Durable| D[History reader worker]
C -->|Incognito| E[Process reader]
D --> F[Checkpoint and source]
E --> F
F --> G{Recovery allowed}
G --> H[Resume or tombstone]
Before merge
Findings
Agent review detailsSecurityNeeds attention: The published reader can classify unverified input as eligible for internal restart recovery. PR surfaceSource +52, Tests +178, Docs +6. Total +236 across 10 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Carry current main's verified external-user rule into the worker classifier, then validate allowed and forbidden recovery outcomes on the integrated head while retaining the measured responsiveness improvement. Do we have a high-confidence way to reproduce the issue? Yes. Current main still scans the active transcript on the recovery caller, and the PR records a synthetic 256 MiB before/after timing; this reviewer did not execute that fixture. Is this the best way to solve the issue? Yes, the existing admitted history reader is the appropriate owner for the durable scan. The published classifier must first preserve current main's provenance decision. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6d6ea35f7616. LabelsLabel changes: No label changes. Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
|
Closing as superseded by #163053, merged as b7cf8fa. Current main at 9c199dc routes readMainSessionRecoveryCheckpoint through readSessionTranscriptSummaryAsync with the recovery-checkpoint selector. Durable transcript reads then dispatch to the existing history worker. The caller no longer scans durable transcript SQL on the Gateway thread. Process-held/incognito reads keep their separate owner. The merged implementation records a 1,204-message regression covering checkpoint, usage and MCP facts without host transcript SQL. Its historical checkpoint benchmark reduced the largest event-loop gap from 193.0 ms to 4.1 ms. Those are the merged PR's recorded measurements, not a new benchmark from this reconciliation. The intended recovery-checkpoint repair is now on main. The unpublished correction branch is preserved while its unrelated accumulated changes are reconciled. |
What Problem This Solves
Fixes Gateway pauses during restart recovery when a session has a large active history.
User Impact
Other Gateway work can continue while recovery classifies a durable session's checkpoint. Recovery decisions, transcript bytes and incognito behavior stay unchanged. No migration or operator action is required.
Why This Change Was Made
The restart checkpoint scan still decoded durable transcript rows on the caller after the bounded display-history read had moved to a worker. Route this classifier through the existing admitted history worker and share its incremental reducer with the process-held incognito reader. The result still comes from one active-history snapshot, including checkpoints outside the display tail.
The tradeoff is worker overhead: this improves caller responsiveness, not total cold-read throughput.
Evidence
Published head remains
a441eb6e1ae8f6684a88b05b00657bdd19db758d. Local correction5536ab0aae84926dd3c734d03256d72fdb6239dacontains canonicala58d7709797ae6a9816576f86987af68b0b1ef99through an ancestry-preserving merge. Its native correction review validates READY. The latest gate passed build in 7m5s and full check, then failed during full tests. It ended with exit 130 after the native backup-shard watchdog fired and the failed invocation was interrupted. The log has 175 completed groups and 107,061 reported passing tests. Finalized groups contain one Telegram timeout and two restart-fixture assertion failures; backup and worker-profile failures were also observed in unfinished groups. Cancelled groups are not passing coverage. Two residual process entries still prevent native lock recovery. No replacement broad run has started. Correction publication, exact-candidate gates, hosted CI and fresh ClawSweeper review remain pending.Separate fixture repair
04413f10f6b30fe7ea02606741687cb599bb45e1is committed and reviewed but not yet integrated into this held candidate. The restart fixture replaced isolated state resolution with a fixed shared temporary path. A transparent guard reproduced five attempted admissions to that path while refusing access before SQLite opened; the two original signal assertions also failed. Binding each case to private state and restoring the real path resolver passes the same 16 cases in a reported 11.40s. Infra types, scoped lint and formatting pass. Independent API review found no P0-P2 findings, confidence 0.91. Source-blind validation passed all 16 cases with spaces and Unicode in the temporary path and verified cleanup. The whole test file was audited; no assertion, deadline, retry or skip was weakened. This proves fixture isolation, not the original shared path's contents or exact error.Bounded, phase-only diagnostics passed the original two Telegram cases, all 125 backup cases and all 80 worker-runtime cases. These are non-reproductions, not established fixes for the original timeouts or missing marker. Three attempts to isolate a separate Telegram loader-fixture problem ended at the unchanged no-output guard without a test verdict, so no speculative patch was kept. Diagnostic source was restored exactly and private outputs were removed. The full UI group passed all 22,249 tests; the earlier watcher and hot-reload reply cases also passed. The historical process crash and unsettled exit remain unattributed.
The integrated checkpoint and history-worker suites passed 57 cases. Independent source-blind validation passed 25 varied durable/incognito cases, including 19 durable reads with zero caller-thread transcript statements and corruption/refusal/recovery controls. The latest scoped same-fixture responsiveness check passed with a 1.864167 ms maximum caller gap for the large fixture, zero caller transcript statements and the unchanged 250 ms limit. Independent API review of the integrated branch found no actionable P0–P2 findings. Canonical archive-presence handling uses a separate worker request; current full-gate coverage remains required.
The Slack fixture now enters the cold resolver on real clocks before testing the existing policy boundaries. All 135 cases pass, and an overlong-cleanup negative control still fails the unchanged 500 ms limit. The MCP retention fixture now follows the native isolated-memory and shared-requester owners; its 21-case command passes with original execution counts and order. This does not establish the cause of the historical 180-second wrapper timeout. The latest prerequisite only moves an unchanged roster type into a type-only leaf: scoped lint fails before and passes after, UI types and formatting pass, and all 59 existing cases in four UI suites pass. Independent API review found no actionable P0–P2 findings. No assertion, retry, timeout or skip was weakened.
Historical full-gate failures remain disclosed. The prior
3d2ab027run passed build but failed the roster line limit before tests; the type-only prerequisite repairs that failure. The earliera8f387cdrun passed build and check, then recorded a watcher assertion failure, an agent-admission fixture failure and a unit-src SIGSEGV. The watcher passed one unchanged focused replay, which is inconclusive. Canonicald923cd08repairs the admission fixture routing. The SIGSEGV has no matching crash stack or established cause. Those runs settled and their exact native locks were recovered. The measurements below retain their original candidate identities.c6da2a9with a 390.154 ms maximum caller gap and two caller transcript statements. The same fixture on2094ed23passed with a 3.745 ms maximum gap, zero caller transcript statements and the unchanged classification. Total checkpoint time was 352.523 ms. Its small control also passes. Both cases took 41.85 s including compilation and fixture lifetime. The 250 ms assertion is unchanged.The previous
e1ac2ef3native build passed in 11m0.4s, then its check failed the UI line limit before full tests began. That exact failure is now repaired by the reviewed extraction; no old gate stamp is carried forward.The original live 7.111 s history log has no caller stack. This repairs a reproducible restart-checkpoint stall, without attributing that specific incident. Worker overhead remains, so this is a caller-responsiveness claim rather than a cold-read throughput claim. All fixtures were private and synthetic; no live Gateway was used.
Historical proof downloads were hash-verified. Their links expire after seven days; the measured results remain recorded here.
Shared gate prerequisite repair
The earlier native run at
2094ed23a9ef196db43a86aaa29583cff849dad9passed build and check, then exposed shared fixture failures. That run has stopped and its native recovery is complete. The following reviewed repairs are integrated locally and remain absent from the published head. Their original focused results remain identified below. Later native fixture routing and the unresolved historical timeout attribution are described above.fc47343a5198574003ff7a806c774bf6034535ae: isolate the MCP command fixture's global runtime manager. An ordered fresh-main reproduction showed that a preceding file's retained factory bypassed the transport mock and started a real process. The full command fixture passes all 20 cases; both permanent ordered-pair regressions pass, including all four transport-settlement paths.0fa080f71eb40c9eb1f5a3b6b7c97f6dafc448d5: remove incomplete lifecycle-error mocks and restore timers during teardown. Both original and reversed file orders reproduce the missing export on unmodified main. The repaired lease and adjacent maintenance suites pass all 27 cases.b464a9a55d1bbe07c457d3be131ff4bcb83b1a51: keep GitHub item icons with the first label line. Fitting chips remain on one line; oversized labels wrap without clipping or icon overlap in both directions. All seven browser tests and six independent source-blind clauses across 80 combinations pass.All five touched test files were audited in full. Distinct regressions, failure paths and cleanup checks remain; no tests were removed or skipped, and no timeout or retry was increased. The UI test now distinguishes fitting from oversized labels and checks clipping and overlap. A new RTL guard rejected the first padding draft. Scoped types, lint, formatting, styles and changed-plan guards pass. Final independent API review found no actionable P0–P2 issue, confidence 0.93. These are focused results, not a completed full-gate claim.
The before/after captures use the same synthetic component fixture, Chromium renderer and 200/208-pixel columns. Base:
1fe560c198c2917154e2e1b130b0df3352ac5114. Head:b464a9a55d1bbe07c457d3be131ff4bcb83b1a51. This proves component layout, not a full Gateway workflow or every browser engine.Before video:
https://91b59577e757131d68d55a471fe32aca.r2.cloudflarestorage.com/openclaw-crabbox-artifacts/crabbox-artifacts/v2/org/b3BlbmNsYXc/owner/Z2l0aHViOjI2MzA2MDIwMg/pr-158680/publish/20260928-061345-944996000/before.mp4?X-Amz-Expires=604800&X-Amz-Date=20260928T061345Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=a677a1e59413a4e54bcc2da5fec6164a%2F20260928%2Fauto%2Fs3%2Faws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=7e738bc0a2aaf033c3881374b5d220d472c0fd32ed2f6df84af0a21ee47a6ef1
After video:
https://91b59577e757131d68d55a471fe32aca.r2.cloudflarestorage.com/openclaw-crabbox-artifacts/crabbox-artifacts/v2/org/b3BlbmNsYXc/owner/Z2l0aHViOjI2MzA2MDIwMg/pr-158680/publish/20260928-061345-944996000/after.mp4?X-Amz-Expires=604800&X-Amz-Date=20260928T061345Z&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=a677a1e59413a4e54bcc2da5fec6164a%2F20260928%2Fauto%2Fs3%2Faws4_request&X-Amz-SignedHeaders=host&X-Amz-Signature=a95c81c2122825713eddf588b9638379ea62a6816c358381340a468443784943
Contract · Raw before · Raw after · Artifact manifest
All published files were downloaded and hash-verified. Links expire on October 5, 2026.