Repository navigation
Conversation
Report bounded in-progress JavaScript stall evidence from the observer worker and consume persisted orphan run identities through the existing restart-resume decision. Preserve graceful restart eligibility and avoid duplicate continuations when a shutdown marker also exists.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
November 2, 2026 07:53
Contributor
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
steipete
enabled auto-merge (squash)
November 2, 2026 08:23
steipete
deleted the
steipete/perf-micro-main-thread-wedge-evidence-and-kill-resume-20260919
branch
November 2, 2026 08:24
Contributor
Author
|
Merged via squash auto-merge.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 3, 2026
…claw#190964) * fix: diagnose wedged gateways and resume sessions after SIGKILL Report bounded in-progress JavaScript stall evidence from the observer worker and consume persisted orphan run identities through the existing restart-resume decision. Preserve graceful restart eligibility and avoid duplicate continuations when a shutdown marker also exists. * test: consume restart provider gates between continuations
This was referenced Nov 4, 2026
steipete
added a commit
that referenced
this pull request
Nov 5, 2026
Keep completed command input out of the running lifecycle projection instead of trying to clear it with a synthetic end event. Persist queued runtime starts through the existing lifecycle owner before lazy chat mapping checks. Preserve writer and revision guards, existing run timing, and prediction anchors. Add prior-session, reset, and queued-start regressions. Allocate 104 test lines for these distinct persistence and event-ordering contracts. Related: #193508, #190964
steipete
added a commit
that referenced
this pull request
Nov 5, 2026
* fix: keep completed chat commands from resuming after crashes * fix(gateway): preserve crash recovery across chat commands Keep completed command input out of the running lifecycle projection instead of trying to clear it with a synthetic end event. Persist queued runtime starts through the existing lifecycle owner before lazy chat mapping checks. Preserve writer and revision guards, existing run timing, and prediction anchors. Add prior-session, reset, and queued-start regressions. Allocate 104 test lines for these distinct persistence and event-ordering contracts. Related: #193508, #190964 * fix(gateway): let runtime events own running markers Capability commands can commit input before producing their reply, so a fallback persistence override is too late. Keep all input transcript commits activity-only and let the existing lifecycle owner persist actual runtime starts. Remove the fallback override plumbing and cover an early approved input commit. The complete change is production-line neutral. Allocate 116 net regression test lines for prior turns, reset revisions, early input commits, and queued starts. * fix(gateway): recover accepted input before runtime start Commit plain-input recovery and writer identity with the transcript, leaving command persistence activity-only. Preserve ordered runtime starts and settle setup failures against the accepted writer. Document hook-ended and command-to-run recovery limits. * test(gateway): align settled fallback writer identity Use the admitted run identity throughout the existing fallback delivery fixture. Preserve the replacement-writer rejection case while reflecting atomic input ownership.
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 6, 2026
…#193558) * fix: keep completed chat commands from resuming after crashes * fix(gateway): preserve crash recovery across chat commands Keep completed command input out of the running lifecycle projection instead of trying to clear it with a synthetic end event. Persist queued runtime starts through the existing lifecycle owner before lazy chat mapping checks. Preserve writer and revision guards, existing run timing, and prediction anchors. Add prior-session, reset, and queued-start regressions. Allocate 104 test lines for these distinct persistence and event-ordering contracts. Related: openclaw#193508, openclaw#190964 * fix(gateway): let runtime events own running markers Capability commands can commit input before producing their reply, so a fallback persistence override is too late. Keep all input transcript commits activity-only and let the existing lifecycle owner persist actual runtime starts. Remove the fallback override plumbing and cover an early approved input commit. The complete change is production-line neutral. Allocate 116 net regression test lines for prior turns, reset revisions, early input commits, and queued starts. * fix(gateway): recover accepted input before runtime start Commit plain-input recovery and writer identity with the transcript, leaving command persistence activity-only. Preserve ordered runtime starts and settle setup failures against the accepted writer. Document hook-ended and command-to-run recovery limits. * test(gateway): align settled fallback writer identity Use the admitted run identity throughout the existing fallback delivery fixture. Preserve the replacement-writer rejection case while reflecting atomic input ownership.
wangmiao0668000666
pushed a commit
to wangmiao0668000666/openclaw
that referenced
this pull request
Nov 6, 2026
…#193558) * fix: keep completed chat commands from resuming after crashes * fix(gateway): preserve crash recovery across chat commands Keep completed command input out of the running lifecycle projection instead of trying to clear it with a synthetic end event. Persist queued runtime starts through the existing lifecycle owner before lazy chat mapping checks. Preserve writer and revision guards, existing run timing, and prediction anchors. Add prior-session, reset, and queued-start regressions. Allocate 104 test lines for these distinct persistence and event-ordering contracts. Related: openclaw#193508, openclaw#190964 * fix(gateway): let runtime events own running markers Capability commands can commit input before producing their reply, so a fallback persistence override is too late. Keep all input transcript commits activity-only and let the existing lifecycle owner persist actual runtime starts. Remove the fallback override plumbing and cover an early approved input commit. The complete change is production-line neutral. Allocate 116 net regression test lines for prior turns, reset revisions, early input commits, and queued starts. * fix(gateway): recover accepted input before runtime start Commit plain-input recovery and writer identity with the transcript, leaving command persistence activity-only. Preserve ordered runtime starts and settle setup failures against the accepted writer. Document hook-ended and command-to-run recovery limits. * test(gateway): align settled fallback writer identity Use the admitted run identity throughout the existing fallback delivery fixture. Preserve the replacement-writer rejection case while reflecting atomic input ownership.
github-actions Bot
pushed a commit
to clawhaven/openclaw
that referenced
this pull request
Nov 23, 2026
…#193558) * fix: keep completed chat commands from resuming after crashes * fix(gateway): preserve crash recovery across chat commands Keep completed command input out of the running lifecycle projection instead of trying to clear it with a synthetic end event. Persist queued runtime starts through the existing lifecycle owner before lazy chat mapping checks. Preserve writer and revision guards, existing run timing, and prediction anchors. Add prior-session, reset, and queued-start regressions. Allocate 104 test lines for these distinct persistence and event-ordering contracts. Related: openclaw#193508, openclaw#190964 * fix(gateway): let runtime events own running markers Capability commands can commit input before producing their reply, so a fallback persistence override is too late. Keep all input transcript commits activity-only and let the existing lifecycle owner persist actual runtime starts. Remove the fallback override plumbing and cover an early approved input commit. The complete change is production-line neutral. Allocate 116 net regression test lines for prior turns, reset revisions, early input commits, and queued starts. * fix(gateway): recover accepted input before runtime start Commit plain-input recovery and writer identity with the transcript, leaving command persistence activity-only. Preserve ordered runtime starts and settle setup failures against the accepted writer. Document hook-ended and command-to-run recovery limits. * test(gateway): align settled fallback writer identity Use the admitted run identity throughout the existing fallback delivery fixture. Preserve the replacement-writer rejection case while reflecting atomic input ownership. Source: d4e2ec8 Release adaptation: Selected eight runtime owners plus five focused lifecycle/regression files applied cleanly. Accepted plain input commits writer/recovery marker atomically before optional dispatch; commands remain activity-only and queued starts persist before lazy mapping. Existing transcript persistence consumes supplied lifecycle overrides; no schema bump. Source companion followups are later recovery extensions, not prerequisites. Format/diff checks pass; crash/restart runtime proof remains unavailable in shared setup. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 3bddffae7abd8c48cfeae5c6433ca91c0335200c)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Fixes missing diagnostics during an unbounded Gateway JavaScript spin and missing automatic continuation after SIGKILL interrupts a main-session turn.
User Impact
A supported Node Gateway writes a bounded, in-progress stall profile to stderr after 30 seconds, repeating at most once per minute. Interrupted root sessions receive one ordinary resume input after an unclean restart, using the same eligibility and admission path as graceful restart markers. No configuration or schema migration is required; prompt and tool definitions stay unchanged.
The existing consume-before-admit startup interruption window remains. Resume asks the agent to inspect current state before repeating work; it does not guarantee external tool effects exactly once. Native waits that cannot service inspector interrupts can still prevent a JS profile.
Why This Change Was Made
The existing recorder could report only after the main event loop returned. Its observer now interrupts only to rotate the existing bounded native recording, then formats and writes directly from the worker. Starting a new inspector profiler during a spin can miss the active leaf, so this preserves the existing sampler and code map. The old inline worker source is replaced, and profile formatting is shared rather than duplicated.
Turn admission already persists a nonterminal run identity and terminal settlement clears it. Startup consumes orphaned identities and shutdown markers in one decision, with existing owner/eligibility checks and no extra scan, checkpoint, or recovery store. Production delta is +143 lines, including only +11 for resume; tests +221, performance tooling +232. The observer is the necessary new capability behind the growth.
Also removes one unused type export introduced by #190318. The exact main parent reproduces that dead-export regression; the same production scan passes after the correction.
Evidence
stallProbeSpin, within the 2 KiB profile budget. Native snapshot rotation was 0.1 ms; this excludes inspector serialization. Exact-base negative control emits no report.pnpm buildpasses.pnpm check:changedwas run; its four failed gates were repaired and rerun successfully (core/script lint, assertion comments, and the inherited dead export). Remaining gates, including typechecks and formatting, passed on the initial run. No changed module is imported by the Control UI.796b14713458, covering the complete local patch at P0–P2: scoped-clean, no actionable findings.Synthetic measurement uses a 35.13 GiB agent database, 10,000 sessions, one million inline transcript rows, and 62,000 workspace files / 1.116 GB on APFS. Five counterbalanced batches of ten preparations per arm, separate A/A and A/B timing/allocation passes. No production data was used.
Mean changes are -0.31% wall, -1.31% main CPU, +2.18% process CPU (A/A +4.08%), and -0.33% sampled allocation. These are neutral results within controls/spread, not claimed savings. Five-batch p95 is the maximum. The measurement excludes model admission, cold integrity scans, worker/native allocation, and btrfs. Reproduce with
scripts/perf/restart-resume-measure.tsand the existingsession-read-transactions-fixture.mjs.Actual Node Gateway E2E: all three tests pass, including SIGKILL mid-turn, exactly one continuation, a further idle restart without duplication, and both graceful-restart variants. A separate real-model proof (Node 26.12.1, OpenAI gpt-4.1-mini) killed the Gateway during an actual exec checkpoint: one original user turn produced exactly one restart input, one final completion, and one resumed file effect, completing 14.250 s after SIGKILL. A further idle graceful restart produced no duplicate continuation or effect. The actual Node 26.12.1 dev Gateway, with SIGUSR1 debugging disabled, timed out on readiness while spinning yet emitted named in-progress profiles at 30.039 s and 90.174 s (854 and 1,077-byte lines, native rotation 0.5/0.1 ms), before its deliberate SIGKILL. Healthy observer A/A–A/B results remain pending and will be recorded before landing.
Healthy observer measurement (macOS, packaged worker; synthetic retained 10,800 sessions and 62,000 file paths): five paired 3.6-second steady windows plus A/A controls. Total CPU median/p95 is 8.002/8.409 → 10.518/10.952 ms; mean 8.030 → 10.513 ms (+30.9% relative, +0.069 percentage points of one CPU core). Main CPU is 3.744 → 5.228 ms mean (+0.041 points). Native sample/report mean is 0.245 → 0.370 ms, candidate maximum 0.504 ms. Added worker heap is 4.71 MiB and process RSS 7.90 MiB. Combined sampled main/worker allocation is 595,294 → 541,443 B/window, but A/A variability precludes an allocation-saving claim. This is an explicit small absolute CPU/memory tradeoff for off-main evidence, not a zero-cost or performance-improvement claim. macOS adds one observer; Linux already had that worker, and no Linux overhead extrapolation is claimed. Healthy operation starts no extra profiler or inspector session.
The initial CI run exposed a fixture race in the extended graceful-restart test: its second continuation reused an already-resolved provider gate. The fixture now consumes that gate when releasing its held response. The same failed case passes locally after the repair (1 passed, 2 unselected), and refreshed Codex P0–P2 review is scoped-clean.
A separate CI failure is inherited:
test/extension-test-boundary.test.tsrejects the private import intest/decision-baseten-admission.integration.test.ts. The same selected test fails on exact parent796b14713458a20de36316eff479603dd84c7225with that sole offender. Direct main commit91f4975d99f9df8939d84729a4927ed427384de4introduced the import. This main regression was subsequently repaired by #190958 (50f868506375); the boundary job passes in the refreshed exact-head CI merge. No CI bypass is needed for it.