Repository navigation
perf(worktrees): start first replies while checkout finishes - #169136
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 maintainer review before merge. What this changesThis PR starts eligible worktree replies during checkout while workspace operations and turn completion await shared readiness. Example: Model-only first reply in the supplied Linux Gateway benchmark with a 52,000-file partial clone.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR provides a measured first-reply improvement and resolves the previous preparation-error finding; no remaining actionable defect was found, while the red CI gate requires the native inherited-failure landing disposition. Priority: P2 Before mergeNone. FindingsNone. Provenance
Agent review detailsHow this fits togetherGateway chat admission prepares committed prompt files in the final worktree directory, starts inference, and carries the same readiness owner into embedded tools, native hooks, plugin factories, attachments, and completion. flowchart TD
A[Gateway chat admission] --> B[Committed prompt preparation]
B --> C[Model inference]
B --> D[Remaining checkout]
D --> E[Workspace readiness]
C --> F[Workspace operations]
E --> F
C --> G[Turn completion]
E --> G
Technical reviewBest possible solution: Retain the shared readiness implementation and finish landing through the native path that preserves enforced reviews and qualifies inherited CI failures. Do we have a high-confidence way to reproduce the issue? Current-main source shows full workspace preparation blocking reply initialization, and the supplied controlled Gateway benchmark measures that delay; no target code was executed during this review. Is this the best way to solve the issue? The patch uses existing checkout, admission, title, and tool owners, preserves complete preparation for unsupported paths, and explains the measured latency tradeoff. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b4063f202d33. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfacePR surface statistics unavailable: the file list is incomplete. LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (14 earlier review cycles; latest 8 shown)
Reviewed October 12, 2026, 5:45 AM ET / 09:45 UTC (Revision 15). |
b45d6e1 to
db70068
Compare
|
Related: #169239 enables source-only filesystem templates through the existing isolated Git policy and adds template-selection diagnostics. It touches |
37df511 to
51a173a
Compare
272fe51 to
c8870dc
Compare
Publish committed prompt inputs at the allocated cwd, then overlap full checkout with inference. Workspace tools and turn completion share the existing pending-workspace owner and retain live authority checks. Keep display-title generation in the background and preserve one actionable preparation failure. Add prompt-equivalence and real Gateway regressions.
Keep sandbox projection behind complete managed-worktree publication and include PDF in the shared workspace tool gate. Cover both with regressions that fail on the earlier readiness behavior. Use the current Code Mode metadata owner after its old predicate was removed on main. Preserve the native control tool exemption without restoring it.
|
Landed the reviewed head CI run 38228919170 completed with 97 successful jobs, 22 skipped jobs, and three failing test jobs plus their aggregate gate. Each failure independently reproduced on its unchanged main parent,
The tested merge is The independent final code review is scoped-clean. The completed hosted review reports no actionable findings on this exact head. GitHub confirms squash commit |
…w#169136) Start eligible first model turns once committed prompt inputs are available, while repository checkout finishes concurrently. Workspace-dependent tools and terminal completion share readiness and revalidate live run ownership. Preserve ready-worktree prompts, legacy plugin construction, local attachment safety, and actionable preparation failures. The 52,000-file partial-clone benchmark improves median first text from 2.188 s to 1.344 s. Exact-head CI has 97 successful jobs; all three failed test jobs reproduce on its unchanged main parent. Independent and hosted code reviews found no remaining actionable issues.
## What Problem This Solves The two background title-recovery cases still expected title generation to wait for reply completion. Commit `82acd0a1c02ab215314a7a45b84589c0677026a9` (#170794) intentionally starts naming alongside worktree and reply preparation, with one retry after the overlapping turn settles. Both cases therefore fail as soon as they observe the legitimate first call. Use the existing title-start signal to verify that first attempt while dispatch remains held. The generator-error fixture now rejects both attempts and expects two calls; the delayed-success fixture still expects one. The assertions for stable worktree branches, no premature display name, late title persistence, and fallback slug remain intact, as do cleanup and timing budgets. This is a test-only correction (+4/−4 lines); production behavior, SQL statements/requests, and main-thread SQLite (T1) are unchanged. ## Evidence Scheduled [run 38371740449, large15 job 115210402491](https://github.com/openclaw/openclaw/actions/runs/38371740449/job/115210402491) failed on head `4dd4b8ef9c8fd0c8dd9286f70f98b0842efca758` at the obsolete zero-call assertion in `src/gateway/server.sessions.create.titles.test.ts:319`: - `sessions.create preserves background title recovery after generator error` — 6.628 s; received one call before dispatch completed. - `sessions.create preserves background title recovery after delayed title` — 5.249 s; same assertion and observed call. The old ordering assertion originated in `325c56d230bcc91a9fe079e31d885c1e3f26cc6e` (#169136). The parent-relative patch for #170794 removes the first-progress/finish gate, schedules naming immediately, and retains the turn promise as the retry signal. The production owner and session documentation agree on this contract; existing dispatch and title-owner tests cover retry-after-turn and exhausted fallback. The failing test and affected owners are unchanged between the failing head and candidate base `c86d3033301f51b7b53637c035e3476faa56fdef`. Changed-file formatting (0.551 s), lint (8.803 s), and `git diff --check` (2.020 s) passed. One Codex review completed with no actionable findings (`scoped-clean`). Normal commit hooks passed. The committed patch is byte-identical to the reviewed patch. [Ordinary PR CI 38375413292](https://github.com/openclaw/openclaw/actions/runs/38375413292/job/115223087521) on candidate `55418e4dd417403d7726fd93531dcc4f2e426c7c` passed all eight tests in `server.sessions.create.titles.test.ts` in 66.96 s (69.19 s command wall time). The original generator-error and delayed-title cases passed in 2.738 s and 2.226 s. All selected type, lint, architecture, ratchet, security, and aggregate gates passed (47 successful checks, 61 unselected/skipped, one neutral advisory result). No local test runtime is claimed. No product checks were removed, no schema or lifecycle code changed, and no SQL/T1 or update-cell measurement is applicable to this test-only change.
## What Problem This Solves The two background title-recovery cases still expected title generation to wait for reply completion. Commit `02a0d2450dc458efd3f80cde982785b5cbd912da` (openclaw#170794) intentionally starts naming alongside worktree and reply preparation, with one retry after the overlapping turn settles. Both cases therefore fail as soon as they observe the legitimate first call. Use the existing title-start signal to verify that first attempt while dispatch remains held. The generator-error fixture now rejects both attempts and expects two calls; the delayed-success fixture still expects one. The assertions for stable worktree branches, no premature display name, late title persistence, and fallback slug remain intact, as do cleanup and timing budgets. This is a test-only correction (+4/−4 lines); production behavior, SQL statements/requests, and main-thread SQLite (T1) are unchanged. ## Evidence Scheduled [run 38371740449, large15 job 115210402491](https://github.com/openclaw/openclaw/actions/runs/38371740449/job/115210402491) failed on head `ef293ea529c1a0c2df2feda94ca8096fb5028218` at the obsolete zero-call assertion in `src/gateway/server.sessions.create.titles.test.ts:319`: - `sessions.create preserves background title recovery after generator error` — 6.628 s; received one call before dispatch completed. - `sessions.create preserves background title recovery after delayed title` — 5.249 s; same assertion and observed call. The old ordering assertion originated in `47690293a683ec6f6b7a8aba94ea6cd368ab56d2` (openclaw#169136). The parent-relative patch for openclaw#170794 removes the first-progress/finish gate, schedules naming immediately, and retains the turn promise as the retry signal. The production owner and session documentation agree on this contract; existing dispatch and title-owner tests cover retry-after-turn and exhausted fallback. The failing test and affected owners are unchanged between the failing head and candidate base `e1d88bce4ac5d2c81ff503871be418f5a1dc42c2`. Changed-file formatting (0.551 s), lint (8.803 s), and `git diff --check` (2.020 s) passed. One Codex review completed with no actionable findings (`scoped-clean`). Normal commit hooks passed. The committed patch is byte-identical to the reviewed patch. [Ordinary PR CI 38375413292](https://github.com/openclaw/openclaw/actions/runs/38375413292/job/115223087521) on candidate `55418e4dd417403d7726fd93531dcc4f2e426c7c` passed all eight tests in `server.sessions.create.titles.test.ts` in 66.96 s (69.19 s command wall time). The original generator-error and delayed-title cases passed in 2.738 s and 2.226 s. All selected type, lint, architecture, ratchet, security, and aggregate gates passed (47 successful checks, 61 unselected/skipped, one neutral advisory result). No local test runtime is claimed. No product checks were removed, no schema or lifecycle code changed, and no SQL/T1 or update-cell measurement is applicable to this test-only change.
…rn ends (#203113) ## Problem In a worktree session, the first turn starts a background exec with an exit wake and calls `sessions_yield`. When the command exits, the wake is refused before it starts with `Session changed while preparing its project; retry the task.` The exec result never reaches the agent. The chat then shows "This turn yielded, but no registered continuation can resume it. The run has ended." The user has to send another message to get the agent going again. Cause: the first turn of a session with a deferred checkout runs inside `runWithAgentWorkspaceReadiness` (#169136). The exec child's exit callback runs in that turn's async context, so it inherits the turn's workspace gate. After the turn yields and ends, the session-event wake reaches `admitReplyTurn`, which captures the inherited gate and calls its `assertCurrent()` in the store-writer phase. The retired run is no longer registered, so the check throws the ownership error, about 10 ms after admission starts. Nothing in the session changed. The production log matches: `lifecycle-admission failed reason=writer`, then the refused wake. Agent runs and follow-ups already clear this gate (#170791). Session-event wakes, queue and mailbox drains, and subagent announce/cleanup did not. ## Fix `runOutsideAdmittedTurnScopes` (renamed from `runOutsideAdmittedGenerationScopes`) is the single entry point for detached work that is re-admitted when it executes. It now also drops the inherited workspace gate, the same way it drops the inherited plugin generations. Every detached re-admission now runs under the gate of the turn it actually starts. The name change touches only its existing callers. A pre-start failure is not retried. A retry would have run in the same leaked context and failed the same way, and with the cause removed this failure no longer happens. A real session change before the wake (deleted chat, reset) keeps its existing behavior. ## Evidence - Regression test (`bash-tools.exec-background-followup.test.ts`): a real background exec started inside a turn's workspace gate. The gate retires before the command exits, and the test asserts that the wake turn runs and its prompt carries the exec output. Red on base with the production error, green with the fix. The rest of that file and the consumer tests (session-event, queue, mailbox, subagent announce, chat-send/agent-run readiness) pass. - Real Gateway, base vs head, from source. Isolated state, real model (OpenAI, embedded OpenClaw runtime). `sessions.create` with `worktree: true` and an initial message, so the checkout is deferred as in the incident. The agent runs `sleep 20; echo <marker>` in the background with an exit wake, then calls `sessions_yield`: - base: the wake fails with `session event execution failed source=exec ... Session changed while preparing its project`, then `completion delivery failed`. The transcript ends with "This turn yielded, but no registered continuation can resume it." - head: the wake turn runs, and the agent replies with the exact marker. No ownership errors. - `tsgo:core`, `check:test-types`, oxlint/oxfmt on the changed files. The `max-lines` finding on `session-event-handoff.ts` is inherited: the file has the same line count as on `main`. ## Merge danger Two-way door: no state, schema, config, or published contract changes, and a revert fully undoes it. Blast radius if wrong: detached wakes (exec, cron, restart, subagent completions) and queued follow-ups no longer see an inherited first-turn workspace gate. They admit against current session state, as agent runs and follow-ups already do. Co-authored-by: Ayaan Zaidi <[email protected]>
…rn ends (openclaw#203113) ## Problem In a worktree session, the first turn starts a background exec with an exit wake and calls `sessions_yield`. When the command exits, the wake is refused before it starts with `Session changed while preparing its project; retry the task.` The exec result never reaches the agent. The chat then shows "This turn yielded, but no registered continuation can resume it. The run has ended." The user has to send another message to get the agent going again. Cause: the first turn of a session with a deferred checkout runs inside `runWithAgentWorkspaceReadiness` (openclaw#169136). The exec child's exit callback runs in that turn's async context, so it inherits the turn's workspace gate. After the turn yields and ends, the session-event wake reaches `admitReplyTurn`, which captures the inherited gate and calls its `assertCurrent()` in the store-writer phase. The retired run is no longer registered, so the check throws the ownership error, about 10 ms after admission starts. Nothing in the session changed. The production log matches: `lifecycle-admission failed reason=writer`, then the refused wake. Agent runs and follow-ups already clear this gate (openclaw#170791). Session-event wakes, queue and mailbox drains, and subagent announce/cleanup did not. ## Fix `runOutsideAdmittedTurnScopes` (renamed from `runOutsideAdmittedGenerationScopes`) is the single entry point for detached work that is re-admitted when it executes. It now also drops the inherited workspace gate, the same way it drops the inherited plugin generations. Every detached re-admission now runs under the gate of the turn it actually starts. The name change touches only its existing callers. A pre-start failure is not retried. A retry would have run in the same leaked context and failed the same way, and with the cause removed this failure no longer happens. A real session change before the wake (deleted chat, reset) keeps its existing behavior. ## Evidence - Regression test (`bash-tools.exec-background-followup.test.ts`): a real background exec started inside a turn's workspace gate. The gate retires before the command exits, and the test asserts that the wake turn runs and its prompt carries the exec output. Red on base with the production error, green with the fix. The rest of that file and the consumer tests (session-event, queue, mailbox, subagent announce, chat-send/agent-run readiness) pass. - Real Gateway, base vs head, from source. Isolated state, real model (OpenAI, embedded OpenClaw runtime). `sessions.create` with `worktree: true` and an initial message, so the checkout is deferred as in the incident. The agent runs `sleep 20; echo <marker>` in the background with an exit wake, then calls `sessions_yield`: - base: the wake fails with `session event execution failed source=exec ... Session changed while preparing its project`, then `completion delivery failed`. The transcript ends with "This turn yielded, but no registered continuation can resume it." - head: the wake turn runs, and the agent replies with the exact marker. No ownership errors. - `tsgo:core`, `check:test-types`, oxlint/oxfmt on the changed files. The `max-lines` finding on `session-event-handoff.ts` is inherited: the file has the same line count as on `main`. ## Merge danger Two-way door: no state, schema, config, or published contract changes, and a revert fully undoes it. Blast radius if wrong: detached wakes (exec, cron, restart, subagent completions) and queued follow-ups no longer see an inherited first-turn workspace gate. They admit against current session state, as agent runs and follow-ups already do. Co-authored-by: Ayaan Zaidi <[email protected]>
…rn ends (#203113) ## Problem In a worktree session, the first turn starts a background exec with an exit wake and calls `sessions_yield`. When the command exits, the wake is refused before it starts with `Session changed while preparing its project; retry the task.` The exec result never reaches the agent. The chat then shows "This turn yielded, but no registered continuation can resume it. The run has ended." The user has to send another message to get the agent going again. Cause: the first turn of a session with a deferred checkout runs inside `runWithAgentWorkspaceReadiness` (#169136). The exec child's exit callback runs in that turn's async context, so it inherits the turn's workspace gate. After the turn yields and ends, the session-event wake reaches `admitReplyTurn`, which captures the inherited gate and calls its `assertCurrent()` in the store-writer phase. The retired run is no longer registered, so the check throws the ownership error, about 10 ms after admission starts. Nothing in the session changed. The production log matches: `lifecycle-admission failed reason=writer`, then the refused wake. Agent runs and follow-ups already clear this gate (#170791). Session-event wakes, queue and mailbox drains, and subagent announce/cleanup did not. ## Fix `runOutsideAdmittedTurnScopes` (renamed from `runOutsideAdmittedGenerationScopes`) is the single entry point for detached work that is re-admitted when it executes. It now also drops the inherited workspace gate, the same way it drops the inherited plugin generations. Every detached re-admission now runs under the gate of the turn it actually starts. The name change touches only its existing callers. A pre-start failure is not retried. A retry would have run in the same leaked context and failed the same way, and with the cause removed this failure no longer happens. A real session change before the wake (deleted chat, reset) keeps its existing behavior. ## Evidence - Regression test (`bash-tools.exec-background-followup.test.ts`): a real background exec started inside a turn's workspace gate. The gate retires before the command exits, and the test asserts that the wake turn runs and its prompt carries the exec output. Red on base with the production error, green with the fix. The rest of that file and the consumer tests (session-event, queue, mailbox, subagent announce, chat-send/agent-run readiness) pass. - Real Gateway, base vs head, from source. Isolated state, real model (OpenAI, embedded OpenClaw runtime). `sessions.create` with `worktree: true` and an initial message, so the checkout is deferred as in the incident. The agent runs `sleep 20; echo <marker>` in the background with an exit wake, then calls `sessions_yield`: - base: the wake fails with `session event execution failed source=exec ... Session changed while preparing its project`, then `completion delivery failed`. The transcript ends with "This turn yielded, but no registered continuation can resume it." - head: the wake turn runs, and the agent replies with the exact marker. No ownership errors. - `tsgo:core`, `check:test-types`, oxlint/oxfmt on the changed files. The `max-lines` finding on `session-event-handoff.ts` is inherited: the file has the same line count as on `main`. ## Merge danger Two-way door: no state, schema, config, or published contract changes, and a revert fully undoes it. Blast radius if wrong: detached wakes (exec, cron, restart, subagent completions) and queued follow-ups no longer see an inherited first-turn workspace gate. They admit against current session state, as agent runs and follow-ups already do. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 582f5d4) Release adaptation: Preserve stable plugin invocation cleanup while also clearing the retired workspace readiness gate. Companion audit: #204249, #204105, #203999, #202513 not applicable (later authority changes); #204260, #204178, #197395, #203156 missing in this lane, not dependencies. Co-authored-by: RomneyDa <[email protected]>
What problem this solves
A new worktree chat waits for repository checkout and foreground naming before its first model request. Start inference once the final directory and committed prompt inputs are available, while checkout finishes concurrently.
Workspace-dependent tools and terminal completion await one readiness owner and recheck live run authority afterward. Network-only tools remain independent. Unsupported Git transformations, setup/bootstrap hooks, sandbox projections, required worker placement, and native runtimes without tool-admission hooks retain complete preparation. Preparation failures preserve their original actionable error and produce one terminal outcome.
The prompt inputs use Git's index/checkout semantics at the selected commit, including personal USER.md files and attribute ancestry. Early and complete preparation preserve prompt bytes and file metadata. Feishu local uploads and Lobster workflow files declare workspace access. Queued follow-ups clear the predecessor's readiness context at the existing independent-admission boundary; this prevents stale authority from spinning queue retries.
Existing title, repository setup, host-tool, and initialization-admission owners absorb the changes; extracted implementations are removed from their old locations. Current main's target-worktree configuration hashing and sparse-template validation are preserved. There is no new configuration option, dependency, schema, or persistent store.
Production/tooling delta: +828 lines (+1237/−409). Growth implements bounded committed prompt materialization, shared native/embedded/plugin readiness, and compatibility-safe asynchronous factory construction. Existing setup/title/admission owners are reused and superseded implementations removed; preserving exact prompts and legacy plugin factory access prevents a net-negative implementation.
Full and plugin-only construction share the same yielding preparation owner. Plugin registration defaults preserve existing behavior: legacy factories wait for a complete workspace; static definitions and audited lazy bundled factories can construct early and wait at execution; explicitly independent tools never await checkout.
defineToolPluginforwards the same declaration. Local message attachments, custom media keys, internal-source delivery, and plugin delivery use the retained execution-workspace capability. Text, remote URLs, and inline media remain independent.Measurement
Real isolated Gateway and synthetic HTTP Responses provider, Linux/Node 24.21, 52,000 tracked files in a verified blobless partial clone. Five model-only and five first-read sessions per revision on the same Hetzner
ccx33lease,cbx_f8f6585bf610, runrun_22a72f56a91281c5a2258704dfed699a. Baseline:042db1e7064930a08c534c4487864d7bfb8c5287; candidate:c8870dc4f5b3ed5f51cf31a488f693cc4c4e9e01plus the reviewed path-normalizer import repair. The subsequent admission extraction preserves this behavior and has separate runtime proof.Median first text improves 1.63× (1.74× for the read task). The tradeoff is more CPU/I/O overlap: first reads are 2% slower and complete model-only turns 13% slower in this instant-response fixture. The benchmark disables template acceleration to exercise native Git fallback and disables bundled plugins; it does not quantify configurations with workspace-reading plugin factories. The four-second cold-start target is missed; five samples do not establish production p99 or production RSS.
Linux template cloning requires Btrfs, and older
template=unavailablediagnostics combine several causes. This change retains main's more specific diagnostics and configuration checks. A separate earlier probe measured only 429 ms outside allocation/checkout, rather than the reported 4.5 s; it measured reply initialization at 599→146 ms cold and 169–409→43–48 ms warm, with a 459 ms diff baseline moved behind readiness. These are separate diagnostic samples. The production filesystem and residual stall remain unverified; no production host was accessed. Prior lanes #167936 and #167944 were inspected.Evidence
cbx_f8f6585bf610,run_22a72f56a91281c5a2258704dfed699a: 123 tests across 12 affected files passed, including sparse/source-only/template behavior, real Gateway overlap and prompt parity, title behavior, pre-start steering, and native-hook fallback. Export collisions and 20 eager-import/PR-wrapper closure cases passed.pnpm buildpassed in 6m32s. Both paired source-flow benchmarks passed.run_4e7c3f151861ce48fd84244c2510aacb: production core typecheck, the 87-case session-initialization suite, 10 Gateway cases including existing-worktree reuse, and 20 closure cases passed after the final admission extraction. An unsupported lint-only CLI flag was a tooling failure, not a passing gate; the size check and exact-head CI complete that validation separately.run_e4991f097cfadb8b5aaed3eac2c2476b: the final line-cap ratchet passes for 57 changed source files. On unchanged042db1e7064930a08c534c4487864d7bfb8c5287, the same browser run reproduces four failures: follow maintenance, two manual history-prepend cases, and the scroll-to-bottom affordance. The other 17 cases pass.Independent Codex reviews completed for conflict integration, admission extraction, and the final compatibility fixes. The final full review is clean, including the plugin-only construction path. Native Codex hooks have focused contract proof; the benchmark uses the built-in runtime. No production host was accessed, and no compiler, baseline, or ignore exceptions were added.
The recurring chat-identity failure also occurs on unchanged main: scheduled run
38176740854, job114580696456, commit0ebcb29890ae287bbe8fcc0189eb5c7fc9a3d897. The relevant test/helper blobs are unchanged at the selected base. Final source:75a30153ac02c54df098006810234a08a8ab21d5. Exact final-head CI and any inherited-only landing disposition are recorded before merge.Historical CI evidence (before conflict rebase)
CI run
38185420852tested head133bb5c2eb2ad40a6b17fc8034192c536a436300merged ontoa9b40cf325e8dfd3540200b6ac95aae740a324b4. Its five red jobs are reproduced on that exact unchanged main parent, with their failing test/owner blobs unchanged by this PR:SourceAccessor<Node[]>versusElement, and missingupdateCompleteonElement.sessions.send-followup-status.test.ts.SessionTranscriptWriterClaimReboundErrorattranscript-write-context.ts:547.Hetzner
cbx_ae9dc6d5e356, runrun_d7922fec8b17ffc0b444fd5fa848b562, reproduced the UI types, session, and UI E2E failures. Runrun_a5cb4cc53592d012a5bceb3fa91e2c34separately rannode scripts/run-vitest.mjs run --config test/vitest/vitest.extension-database-workers.config.ts extensions/codex/src/app-server/settled-turn-finalizer.native.test.ts --maxWorkers=1: the same four failures, five passing cases, 140.24 s Vitest wall. These are failing baseline proofs, not passing validation.Final compatibility proof: Hetzner
cbx_ae9dc6d5e356, runrun_3d5aa73dabec236b2ab7c96a813b2ccd, passed 229 tests across 11 plugin/SDK/agent/bundled-plugin files. Its old-source control fails the three expected legacy/execution ordering cases and passes the independent-tool case. The first attachment run exposed only a synthetic channel fixture missing its outbound surface; that fixture was repaired before the final candidate run.Final runtime proof: Hetzner
cbx_ae9dc6d5e356, runrun_3589bc9198454887d80902ca6351b29c, passed 47 attachment/broadcast/dispatch cases, 4 real-Gateway cases, the export-collision guard, and 20 closure cases. The three new attachment cases fail on old source because local files are accessed before readiness. Its changed gate stopped on the missing runnerrgexecutable, then the lease expired during build; neither is counted as passing gate/build evidence. The replacement lease and exact final CI results are recorded below before landing.Final scoped validation:
cbx_2e287b332dbd,run_857cce20a46748b5038ce3fd80f03d82: canonicalpnpm buildpassed. Its first core type check exposed an overload/mock incompatibility; the final API uses separate synchronous and asynchronous entry points.run_a84a3b369ac1db958990f7079091f92c: core production, all 28 core test type graphs, extension production and extension test types passed. Structural guards passed; the full changed gate stopped on pre-existing unused exports.run_a075c36ecf22ae6fbac8d4a65897d0fd: final plugin-only cutover passed 64 construction/regression cases, core production types, and the four affected agent/plugin test-type graphs; the old plugin-only owner fails the two intended legacy factory cases. Line-cap and export-collision guards passed. Two test-variable shadowing lint findings were then fixed with local renames.run_0d1b51b9bbfd93b883c533b028c648eb: all remaining canonical changed-gate commands passed, including core/extension lint, import cycles, and schema/storage guards. Candidate and unchanged original main base042db1e7064930a08c534c4487864d7bfb8c5287produce identical 144-entry unused-export reports (production plus full-tree views). No ignore entries or baseline allowances were added. The final cleanup removes one obsolete mock-export baseline entry after its mock gained a documented isolation reason.The extended loaded-plugin regression takes approximately 45–49 s Vitest wall per file on this host; most time is compiler/import setup. Existing source-flow proof covers the unchanged overlap path; final full-head CI is recorded before landing.
Final main integration
Conflict rebase uses main
a516e1896458b976f104b5f6d6bc96dc18882ea4, retaining its extracted tool-preparation and checkout-policy owners. The duplicate policy implementation was removed, and Btrfs fallback timing includes prompt materialization. A template-cache fixture uses a fixed clock to keep cache invalidation independent from Btrfs strategy selection; dedicated Btrfs selection tests retain that coverage.Hetzner
cbx_581fcc02d4f7, runrun_9e97ab216b156e50d905c2dd904767b4, passed the real Gateway overlap/prompt-parity/failure flow, bootstrap/sandbox preparation, steering, acceleration and sparse siblings. Runrun_e364bb1aab6c54bc67ae781e3e255ad0passed the remaining 46 tests across five files, including prompt bytes, Btrfs strategy, source-only filters, tool registration, and both plugin construction paths. All 76 candidate file hashes match the committed tree. Full rebased and final integration reviews are clean.The latter command's production typecheck reports only two missing names in the unchanged main file
src/state/openclaw-state-db-schema-additive.ts(getAdmittedSqliteSchemaFacts,parseSqliteTableDefinition). The selected main blob is byte-identical to the candidate. Broad final validation is delegated to exact-head PR CI under the current proof policy. The lease is released. Earlier benchmark numbers remain measurements of the explicitly identified revisions above; the conflict rebase was functionally revalidated, without a new timing campaign.Real run-owner revocation proof
The existing isolated Gateway fixture now runs both
writeand local-attachmentmessagethrough allowed and actualchat.abortcases. Each operation must reach the real workspace-readiness wait before abort. The test joins the admitted execution, verifies a persistent file canary outside checkout rollback, and records actual attachment bytes at a localhost HTTP endpoint. Aborted cases leave no file or delivery; allowed controls require the expected bytes. This replaces injected-authority-only evidence for the requested owner transition. Executed at head998317168b67bffec7a234835eda0c7c5ac49bd6: CI run 38218743688, job 114710079813. The complete real-Gateway case passed in 14.070 s; its group passed 22 files / 213 tests. Sanitized terminal excerpt:The case requires a persistent canary containing
workspace write canaryand one HTTP delivery with the expected attachment bytes for the two allowed controls. After realchat.abort, it joins the admitted run and requires both no canary and zero deliveries. Its assertions execute after checkout is released, so pending work and rollback cannot hide an unauthorized effect. It also proves identical normalized prompt bytes and exactly one actionable checkout-failure terminal. No additional remote leases were created under the updated proof policy.Final CI cleanup
The shared Git materialization operation moves intact from
checkout.tstocheckout-materialize.ts; creation and snapshot restore import the same owner. The wrapper inventory and existing restore-failure spy follow the move. The local line-cap check passes against the selected main base with no new over-cap growth. The real-Gateway proof is assigned to the existing isolated Gateway pool, which keeps real plugin/provider registrations separate from neighboring module mocks. The closed mock's obsolete baseline entry is removed, without adding an exception.Run
38218743688had 91 successful jobs and four root failures. Its mock-export shrink failure is fixed here. Its phone-footer failure is also present on unchanged main c2fe11f7, job 114702188289: the same phone overlap assertion reports19.09375, and this PR changes no UI source. The vanished-incognito test rejected in unchanged request/admission code before this PR's dispatch boundary; a runtime/config snapshot mismatch is suspected, not proven. The built-CLI SQLite deletion proof received an endedAbortErrorwithoutstopReason. The identical failure is independently reproduced by unchanged main 5a1f8c69, job 114717130399. Neither unresolved failure is claimed as a passing check.Local verification under the current light-check policy: changed-file formatting,
git diff --check, and line-cap ratchet pass. A focused Gateway attempt first stopped on stale dependencies; the locked install was restored once. The subsequent default-pool attempt was stopped after revealing the wrong test owner; it is not claimed as passing proof. Broad export/mock scans were stopped and left to PR CI. The two-file checkout/restore attempt also required a broad cold worker build and was stopped under the same host limit. Final-head CI supplies the full gates and the corrected isolated-pool proof. Independent review of the final seven-file cleanup is scoped-clean, with no actionable P0–P2 findings.Final cancellation correction and exact-head proof
CI run
38222154254tested78be070c656769e4f7b25b97d8a01d2be022dfa4. The real-Gateway prompt/checkout/authority proof passed on that exact head in job 114721280414: 29.917 s, one test/one file; isolated-config wall time 38.45 s. The previously cited 14.070 s receipt is earlier-head evidence, not a replacement for this final-head result. The hosted review of that head accepts the executed authority controls. Its next-head cancellation finding is addressed by the preparation-failure correction below.Investigation of the inherited SQLite failure found a concrete dispatch-owner omission: if session lifecycle cancellation rejects accepted dispatch before a runtime terminal exists, the outer error owner drops the typed termination fields. The correction carries typed controller-reason fields through the persisted event, replay payload and chat broadcast. Preparation also aborts the controller with its original error, so ordinary preparation failures retain failed status and their diagnosis. Native terminal ownership is preserved; no cancellation state machine is added. A real Gateway regression using the actual admission interruption fails before the repair because
agent.waitlacksstopReason. The repaired full Gateway file passed 9 tests in 63.17 s, and the direct dispatch-error sibling passed 25 tests in 95.10 s. The final regression is consolidated into the existing interruption matrix: 3 cases passed in 48.04 s using source-mode Vitest on the changed Gateway file. Changed-file formatting and lint pass. Fresh independent review of the final two-file correction is scoped-clean, with no actionable findings. Full exact-head validation is delegated to PR CI; no new leases were started.The suppression-inventory failure is introduced by main commit
04cfcd8e25871e3a1f3078bed85b8e854cb4800b: its new cleanup-socket suppression was absent from the unchanged inventory. This PR changes neither file. The incognito failure still lacks established attribution: source-mode single-case and whole-file replays pass (1 case in 88.57 s and 4 cases in 73.38 s), while CI's compiled shared-worker run rejects the stale session withUnknown agent id "work". These passing replays are not claimed as a fix. No CI rerun, dispatch, or branch update was requested merely for green.Preparation and projection follow-through
The dispatch owner now distinguishes typed cancellation from an ordinary preparation error used to stop inference. The existing pre-prompt worktree-spawn cases assert persisted
failedstatus and the original error, and both pass (152.11 s source-mode file wall). The genuine typed-cancellation case still passes (56.78 s, one selected case). These directly address the hosted preparation-classification finding; no error expectations were relaxed.Investigation also reproduced an existing session-projection defect. Topology captured configuration before an awaited discovery read but captured its revision after the read. A publication during that await could therefore install the old roster/store as current. The existing epoch now covers the entire operation, and stale discovery retries through the existing materialization drain. The regression holds a real worker response, publishes a new roster/store, and checks the same request sees both. In its final test home it fails old code (24.68 s) and passes with the existing config-change sibling (2 cases, 24.27 s). Two deferred-fact siblings pass (18.02 s). Formatting, changed-file lint and diff checks pass; broader proof remains PR CI. No new test file, production export, cache, schema or configuration is added. The exact CI incognito/history symptoms remain qualified separately; a successful source replay alone is not claimed as their root-cause proof.
Run
38225481310completed on539948988033d5388f2f92fcbef9d204a24bba43with five root failures. Its two worktree-spawn failures exposed the preparation classification and are fixed above. The incognito and committed-history failures motivate the reproduced projection repair. Its unrelated test-type errors are the exact optional fixture accesses introduced on main by31a4b923387eand already repaired by main684874efa1c5; the tested merge873473d7e6bbac90774215c6d703b36b0024e660has byte-identical test/fixture inputs to its main parent. The reduced-motion mention UI case received an empty pseudo-element animation name instead ofnone; a narrow source/Vite headless run passes (1 case, 18.07 s), and no matching failing main run was established. This replay is not claimed as a fix or bundled-CI parity. No UI assertion was weakened, no upstream commit copied, and no CI rerun or update-branch was used to chase green.Fresh independent review of the final three-file correction is scoped-clean, with no actionable P0–P2 findings. The review includes the complete preparation owner, termination classifier and projection-drain context. Its required-argument finding was corrected before commit; both classifier calls explicitly pass
undefinedfor the required signal argument. Final source is75a30153ac02c54df098006810234a08a8ab21d5; exact-head CI is recorded before landing.Exact-head CI disposition
CI run
38228919170tests final head75a30153ac02c54df098006810234a08a8ab21d5through merge635cb8b4a2a5f80ba3c39172c02cac558fda5523, whose main parent is80f170ea263a21187384cb67d5aead87b1d01fc2. All three observed root failures independently reproduce on that exact unchanged main parent, using focused source-mode Vitest on the Mac under the updated proof policy:errorinstead ofokundefinedinstead oftarget-idtrueinstead offalseCommands (each run from the unchanged main worktree):
The failing tests and their cron, storage-reader and device-revocation owners are byte-identical between the tested main parent and actual CI merge. The storage assertion executes before any row projection is created; main
2c7cc827b309changes the selected canonical-window fields and exposes its legacy expectation. The cron fixture disables both plugin and OpenClaw tool construction and bypasses the readiness host wrappers. The self-archive case uses unchanged request and revocation owners. Passing branch-only replays are not the inheritance proof: that proof is the matching failures on the exact tested main parent.The earlier preparation-status, incognito, committed-history and reduced-motion mention failures do not recur among these root failures. No upstream fix was copied, no failing assertion weakened, and no CI rerun or branch refresh requested. The current independent local review is scoped-clean. The first hosted review of this head ended with
provider_throttleand published no verdict. The completed hosted review, reviewed at 09:45:59 UTC, reports no actionable findings on this exact head and accepts the production-boundary proof. CI finished with 97 successful jobs, 22 skipped jobs and the three inherited test failures plus their aggregate gate. Production/test types, lint, check-plan and security-fast passed. The inherited-failure disposition does not waive review or security gates.Merged as
325c56d230bcc91a9fe079e31d885c1e3f26cc6eunder the standing inherited-failure landing rule.