Repository navigation
fix(gateway): resume interrupted turns after workspace preparation - #196423
Merged
steipete merged 2 commits intoNov 10, 2026
Merged
Conversation
Await the existing workspace owner before restart event admission and retain the restart marker until custody transfers. Preserve current setup authority, genuine setup errors, parked waits, and queued-input ordering. Add 252 regression-test lines for real Gateway completion after delayed checkout and marker retention across cancellation or another shutdown. Synthetic-scale owner measurements cover timing, process CPU, allocation, and A/A controls.
Only submit a recovery replacement when lifecycle repair, legacy cleanup, or marker disposition changes the entry. Existing shutdown markers already provide durable custody until the post-admission clear.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
November 10, 2026 03:51
Contributor
Codex Review Summary: ✅ CompletedThis 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
deleted the
steipete/perf-micro-resume-workspace-not-ready-20260919
branch
November 10, 2026 04:09
Contributor
Author
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 10, 2026
…penclaw#196423) * fix(gateway): resume interrupted turns after workspace preparation Await the existing workspace owner before restart event admission and retain the restart marker until custody transfers. Preserve current setup authority, genuine setup errors, parked waits, and queued-input ordering. Add 252 regression-test lines for real Gateway completion after delayed checkout and marker retention across cancellation or another shutdown. Synthetic-scale owner measurements cover timing, process CPU, allocation, and A/A controls. * perf(gateway): avoid rewriting retained restart markers Only submit a recovery replacement when lifecycle repair, legacy cleanup, or marker disposition changes the entry. Existing shutdown markers already provide durable custody until the post-admission clear.
steipete
added a commit
that referenced
this pull request
Nov 10, 2026
#196432) * fix(test): reconcile warm reload and procfs test-line debt Allocate nine missing lines for #196385 and correct #196416 from 33 to its actual 36 test lines. #196423 is already fully allocated. Restore exactly 6615748 lines of ceiling with zero slack; preserve all regression coverage and the shared scalar. * fix(test): account for the latest main test-line offset Main #196305 removed one test line after the first reviewed candidate. Reduce the warm-reload debt allocation from nine to eight so total credit is exactly 11 and the current 6615839-line tree has zero slack.
RomneyDa
pushed a commit
that referenced
this pull request
Nov 10, 2026
#196432) * fix(test): reconcile warm reload and procfs test-line debt Allocate nine missing lines for #196385 and correct #196416 from 33 to its actual 36 test lines. #196423 is already fully allocated. Restore exactly 6615748 lines of ceiling with zero slack; preserve all regression coverage and the shared scalar. * fix(test): account for the latest main test-line offset Main #196305 removed one test line after the first reviewed candidate. Reduce the warm-reload debt allocation from nine to eight so total credit is exactly 11 and the current 6615839-line tree has zero slack. (cherry picked from commit 644ff7d)
RomneyDa
added a commit
that referenced
this pull request
Nov 10, 2026
…esults (#196266) * improve(tool-search): show input signatures for MCP tools in search results tool_search rendered input "unknown" for every MCP tool, so models called tool_describe before almost every MCP call. Render the same bounded, structure-only signature used for OpenClaw tools from the MCP input schema. Client tools keep "unknown" because Code Mode lists them in its system prompt from the same compact entries. Remote schemas can carry huge literals, so string literals longer than the hint budget are rejected before serialization. Code Mode prompt construction skips MCP entries before compaction; it never listed them. Co-authored-by: jalehman <[email protected]> Co-authored-by: GrahamMcBain <[email protected]> * improve(tool-search): show input signatures for MCP tools in search results Worked on by: - @jalehman - @GrahamMcBain Co-authored-by: jalehman <[email protected]> Co-authored-by: GrahamMcBain <[email protected]> OpenClaw-Publication: a0929bba-b988-4c27-b67d-606a685a1e6e * fix(test): restore the main test-line budget after warm reload changes (#196432) * fix(test): reconcile warm reload and procfs test-line debt Allocate nine missing lines for #196385 and correct #196416 from 33 to its actual 36 test lines. #196423 is already fully allocated. Restore exactly 6615748 lines of ceiling with zero slack; preserve all regression coverage and the shared scalar. * fix(test): account for the latest main test-line offset Main #196305 removed one test line after the first reviewed candidate. Reduce the warm-reload debt allocation from nine to eight so total credit is exactly 11 and the current 6615839-line tree has zero slack. (cherry picked from commit 644ff7d) * test(agents): align host-denial proof with immediate failure settlement --------- Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: jalehman <[email protected]> Co-authored-by: GrahamMcBain <[email protected]> Co-authored-by: Dallin Romney <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 11, 2026
openclaw#196432) * fix(test): reconcile warm reload and procfs test-line debt Allocate nine missing lines for openclaw#196385 and correct openclaw#196416 from 33 to its actual 36 test lines. openclaw#196423 is already fully allocated. Restore exactly 6615748 lines of ceiling with zero slack; preserve all regression coverage and the shared scalar. * fix(test): account for the latest main test-line offset Main openclaw#196305 removed one test line after the first reviewed candidate. Reduce the warm-reload debt allocation from nine to eight so total credit is exactly 11 and the current 6615839-line tree has zero slack.
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 11, 2026
…esults (openclaw#196266) * improve(tool-search): show input signatures for MCP tools in search results tool_search rendered input "unknown" for every MCP tool, so models called tool_describe before almost every MCP call. Render the same bounded, structure-only signature used for OpenClaw tools from the MCP input schema. Client tools keep "unknown" because Code Mode lists them in its system prompt from the same compact entries. Remote schemas can carry huge literals, so string literals longer than the hint budget are rejected before serialization. Code Mode prompt construction skips MCP entries before compaction; it never listed them. Co-authored-by: jalehman <[email protected]> Co-authored-by: GrahamMcBain <[email protected]> * improve(tool-search): show input signatures for MCP tools in search results Worked on by: - @jalehman - @GrahamMcBain Co-authored-by: jalehman <[email protected]> Co-authored-by: GrahamMcBain <[email protected]> OpenClaw-Publication: a0929bba-b988-4c27-b67d-606a685a1e6e * fix(test): restore the main test-line budget after warm reload changes (openclaw#196432) * fix(test): reconcile warm reload and procfs test-line debt Allocate nine missing lines for openclaw#196385 and correct openclaw#196416 from 33 to its actual 36 test lines. openclaw#196423 is already fully allocated. Restore exactly 6615748 lines of ceiling with zero slack; preserve all regression coverage and the shared scalar. * fix(test): account for the latest main test-line offset Main openclaw#196305 removed one test line after the first reviewed candidate. Reduce the warm-reload debt allocation from nine to eight so total credit is exactly 11 and the current 6615839-line tree has zero slack. (cherry picked from commit b67d29e) * test(agents): align host-denial proof with immediate failure settlement --------- Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: jalehman <[email protected]> Co-authored-by: GrahamMcBain <[email protected]> Co-authored-by: Dallin Romney <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
RomneyDa
added a commit
that referenced
this pull request
Nov 12, 2026
…196423) Adapt the workspace readiness repair to the release's graceful restart markers. Keep marker custody until ordinary admission or explicit disposition, and preserve the original cancellation reason when another restart interrupts recovery. (cherry picked from commit ea3eb71) Independent local review omitted by release-owner instruction. Validation: 16 passing consumer tests; two existing loopback readiness probes receive proxy HTTP 502. Real workspace recovery reaches accepted admission and agent execution, but provider connection fails; completion remains unqualified. Scoped static gates pass. Retain all failed assertions without weakening. Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]> (cherry picked from commit 6a3cb4d62d59e4a6e615989e9a9912c1f21d21e3)
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 interrupted turns being abandoned after a Gateway restart when their managed workspace is still pending preparation.
User Impact
Restart recovery waits for workspace preparation and resumes the interrupted turn once. Genuine setup errors retain their normal actionable errors. Retained yield waits remain parked, and other recovery classifications and ordering are unchanged.
Why This Change Was Made
A restarted process has lost the previous turn's workspace-readiness scope. Restart admission now re-enters the existing workspace preparation queue before reply admission, using current session and operator authority. The saved restart marker remains durable until admission transfers custody or definitively fails; shutdown draining prevents recovery from erasing the next restart's marker.
No retry loop, config option, cache, or schema change. The production increase is 69 net lines: the existing workspace owner is connected to restart admission, and the existing marker covers the resulting wait. Unchanged retained markers no longer trigger a redundant entry replacement.
Evidence
132 focused tests passed, including the real Gateway regression and existing permission, prompt-stability, worktree, and restart paths. The final 33-test restart run passed after the owner integration. Core/test/script typechecks, affected-file lint, line-cap and import-cycle checks, and
pnpm build:ci-artifactspass.Two Codex autoreviews of the complete local change against
af7fd744c051987b0199dc7427b80c39b877d8bdare scoped-clean through P2, with no accepted/actionable findings. The review included the workspace, source-authority, admission, shutdown, and marker owners. The reviewer inspected source; it did not execute the tests.The full
pnpm check:changedexposed 28 unused-export findings (21 production, 7 full-tree) reproduced byte-for-byte on the exact clean parent. These are existing main defects, with causal attribution reused from prior maintainer proof; no unrelated export cleanup is included. Full-tree introducers: #130634, #190544, #191513, #194455. Production-only introducers additionally include #103537, #151777, #191326, #190205, #132716, #129184, #139911, anda7436c8b4a93bff59d099661d2b206bb0627ac2b.CI run 42752144696, attempt 1 exposes a separate main regression:
ci workflow guards > preserves authenticated toolchain archives during dependency store repairfails withENOENT calls.jsonl. It reproduces on exact clean parentaf7fd744c051987b0199dc7427b80c39b877d8bd. Commite1af43161bd8982f3092c9069cb5c1222d93de31/ #196352 moved pnpm discovery ahead of the Node path prepend, while this older fixture exposes its fake pnpm only throughNODE_BIN. The test, action, and install script are byte-identical between that parent, CI main parenta0ec2b5b4ba6532237705777a470a1d154cd1ccc, and this PR head. This is an unresolved main regression, not a passing check or a restart-recovery defect.An earlier, superseded extraction candidate had one 90-second isolated Gateway timeout under concurrent compiler load; an unchanged traced reproduction passed. The original stall remains unattributed. The final owner implementation passed serially (latest Gateway run: 49.3 seconds) with the timeout and assertions unchanged.
The full Gateway regression fails on the parent with
SessionWorkStartError/workspace_pending. The fixed path waits at a real Git checkout boundary, completes one loopback-provider turn, persists its final transcript, and does not duplicate it on a second recovery pass. Additional admission tests fail on the parent when restart interrupts pending admission; they protect both retained custody and the newer shutdown marker. The test-line allocation covers these regressions (252 added test lines).Synthetic scale proof uses a 35.129 GiB SQLite database with 10,000 sessions and 1,000,000 transcript rows, plus 62,000 workspace files totaling 1.116 GB. Five counterbalanced A/B pairs and A/A controls measure owner wall time, process CPU, and sampled main-isolate allocations. No production data was used. Measurements run on APFS; they do not establish btrfs or remote sandbox performance. The owner benchmark substitutes immediate model completion after real admission; the separate Gateway regression verifies provider execution and the final transcript.
Scale measurements and accepted correctness tradeoff
Final source:
762c82d41df001a4901c9678aafadfa1d84eef0d; exact baseline:af7fd744c051987b0199dc7427b80c39b877d8bd. Acceptance: recover the pending turn exactly once, preserve ready/skipped outcomes and ordering, and disclose cost. Five counterbalanced pairs; separate timing and allocation processes. Ready trials contain ten owner calls (50 measured calls per arm); their values are per-call block averages, and p95 is the maximum of five block averages. Pending trials contain one call. Every sample, including outliers, is retained.Pending: baseline resumes three and rejects one; candidate prepares the workspace and resumes all four. The same eight stale/orphan outcomes and ready sibling order remain. Ready: four resumes per call, all 40 keys per block in ten exact repetitions of the same order, zero warnings. Candidate history-worker tasks remain 18 per call; baseline ranges 18–18.4 due to retained background work. This counter does not measure SQL transactions.
Maintainer tradeoff accepted for this correctness repair: ready median wall time rises 9.4%, process CPU 10.7%, and sampled main-isolate allocation 10.8% (A/A: 2.3%, 2.3%, 0.7%). That is approximately 9.65 ms wall, 15.09 ms process CPU, and 1.38 MiB sampled allocation per four ready resumes. The final current-generation marker retirement protects custody across another restart or session replacement. Redundant unchanged-entry replacement was removed. The larger pending cost includes work the baseline abandons; no speedup is claimed.
A prior candidate's marginal ready CPU median rose 23.3%. Publication was held for simplification and longer samples; that result is superseded, not discarded as noise. Main-thread ready CPU is 26.27→30.35 ms. Process CPU includes Node workers but excludes child Git process CPU. Full-process profiles include loader/bootstrap work and do not isolate database-worker stacks; they do not prove that marker writes alone caused the process-CPU delta. Cold arm timings include asymmetric imports and are not a causal A/B comparison.
Reproduce with the committed
scripts/perf/restart-resume-measure.ts:--resume --markers --workspace --baseline-resumes 3 --iterations 1, supplying synthetic fixture root and frozen baseline/current source files as described in its header. Use--workspace-ready --baseline-resumes 4 --iterations 10for ready paths,--controlfor A/A, and separate--allocationruns. Fixture construction/imports/GC are outside warm timing. Local APFS and sampled main-isolate allocation are explicit limits; no btrfs, remote sandbox, or worker-allocation claim.