Repository navigation
refactor(agents): simplify subagent and runner bookkeeping - #168789
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 simplifies subagent recovery, completion, cleanup, and embedded-runner bookkeeping by removing selected retries and duplicate ownership tracking. Example: A yielded parent transfers completion responsibility for child run atomic-transfer.
Review scores
ProductKind: Refactor · Worth it: Yes Merge readiness✅ Ready for maintainer review Keep this PR open: the maintainer-approved simplification preserves the essential write and authority checks, with no actionable patch defect found; its remaining CI failure is inherited and already repaired on main. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe agent runtime coordinates spawned children, parent continuations, transcript maintenance, and cancellation through Gateway-owned workers, durable registry rows, and acknowledged publications. flowchart TD
A[Parent agent turn] --> B[Subagent lifecycle]
B --> C[Registry mutation owner]
C --> D[SQLite worker]
D --> E[Committed publication]
E --> F[Parent continuation]
B --> G[Cancellation and cleanup]
Technical reviewBest possible solution: Land the simplification through the native workflow's inherited-CI handling while preserving the merged fixture repair and retained effect-boundary checks. Do we have a high-confidence way to reproduce the issue? This is an intentional refactor; the inherited CI failure is independently explained by its failing annotation and the merged main repair. Is this the best way to solve the issue? The change follows the repository's compromise policy by keeping the existing owners and essential effect checks while explicitly accepting simpler recovery behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fd1fd2ce0ef8. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -1238, Tests -2351, Docs +4, Other -2. Total -3587 across 76 files. Added test files: 0. View PR surface stats
Review metrics
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 (6 earlier review cycles)
Reviewed October 11, 2026, 4:55 AM ET / 08:55 UTC (Revision 7). |
2a3ffa3 to
cd0fce1
Compare
|
The dependent-test cutover is committed in Attribution for every failing test job in run 38107601106, head
The two cancelled draft dispatch/context checks were superseded by successful ready-for-review dispatch/context checks on the same head. No test suite was cancelled in that completed CI run. Proof: final local focus 52/52; preflight/resume pair 47/47; retained Gateway flow tests pass; Testbox E2E 34/34, production and all test-type graphs pass, suppressions 3/3; typed lint passes for all 14 test/support files; runtime/static cycles 0. Review is clean through P2. The full changed check separately reports pre-existing unused exports already removed/private on current main, plus a maintenance loader with a real production caller; no inherited-main-red CI claim or waiver is being made. No CI rerun, timeout increase, retry, test skip, or allowance expansion was used. The new push contains the actual dependent-test cutover and will receive its own exact-head CI. |
Keep the single-Gateway FIFO, native row-version guard, live authority, atomic terminal writes, and acknowledged publication. Remove the foreign-row refresh and three-attempt replan loop from the registry mutation owner. Best-effort tradeoffs accepted: - An unsupported out-of-band SQLite writer now causes the first conflicting mutation to fail. The row is not overwritten; canonical restore or restart refreshes the resident state before another attempt. The same-process overlap incident in #163195 requires the retained FIFO and publication ordering. Its foreign-writer retry coverage used injected second connections rather than a reported production writer. Keep atomic conflict tests and verify explicit canonical recovery instead of transparent retry. No schema, stored format, public API, permission, retention, or durability contract changes. Net production reduction: 53 lines.
969b4d5 to
8886182
Compare
|
Conflict-only rebase complete at The only textual conflict was in the removed pre-read publication retry. The final Testbox proof, bound to the rebased source tree: 33/33 native-ownership tests, production types, all test-type graphs, runtime cycles 0, static cycles 0, and suppressions 3/3. The lease is completed. The scoped changed check passed its guards and production export scan; its sole full-tree finding is the existing maintenance-loader export, which has a real lazy production caller in Net production reduction is now 1,227 lines (826 added / 2,053 removed). The earlier E2E and dependent-test proof remains attributed to its tested head. The rebased head now needs its own hosted CI before landing. |
Exact-head CI attribution and inherited-failure landingHead: All 142 check runs were enumerated. All are terminal; zero were cancelled. There are exactly two failures:
Independent reproduction: the identical case and The defect is already fixed on main by #168975, commit All other selected tests, lint, types, build and checks passed. This uses the coordinator-authorized inherited-only CI admin exception, pinned to the exact head above. No job rerun, empty push, fourth rebase, or weakened expectation is needed. Earlier PR-caused stale tests were fixed in the branch; this remaining failure is independently inherited and already repaired on main. |
…168789) * refactor(agents): stop retrying foreign registry writes Keep the single-Gateway FIFO, native row-version guard, live authority, atomic terminal writes, and acknowledged publication. Remove the foreign-row refresh and three-attempt replan loop from the registry mutation owner. Best-effort tradeoffs accepted: - An unsupported out-of-band SQLite writer now causes the first conflicting mutation to fail. The row is not overwritten; canonical restore or restart refreshes the resident state before another attempt. The same-process overlap incident in openclaw#163195 requires the retained FIFO and publication ordering. Its foreign-writer retry coverage used injected second connections rather than a reported production writer. Keep atomic conflict tests and verify explicit canonical recovery instead of transparent retry. No schema, stored format, public API, permission, retention, or durability contract changes. Net production reduction: 53 lines. * refactor(agents): simplify subagent and maintenance bookkeeping * fix(agents): preserve batch and cleanup settlement * test(agents): share completion queue fixture query * test(agents): shrink retired bookkeeping baselines * test(agents): remove retired publication race cases * style(agents): format async ownership preparation * test(agents): finish simplified bookkeeping cutover
Account-only models admitted through the Codex catalog can be rejected before inference because their transport route is lost. Regression commit `5d6cf7424de268b0354e3b1c4bfae81e20bdd99c` (#168789) removed the published-catalog handoff. Native capability rows intentionally omit transport fields, while the admission capture retains route evidence separately; projecting the runtime snapshot loses the object identity used to retrieve that evidence. Reuse the existing borrowed admission snapshot when it shares the projected snapshot's catalog identity. This preserves the route, OAuth profile forwarding, and runtime compatibility evidence captured for the turn. Auth planning and harness support checks remain unchanged, including rejection of unsupported routes. No new catalog owner, database access, or model allowlist is introduced. The regression exercises catalog capture followed by snapshot projection through runtime preparation and verifies native ownership, the subscription route, OAuth profile forwarding, and compatible runtime IDs. Scope: two files, **+92/−3** overall (**+17/−2** production). Validation: - One isolated Codex review completed with no actionable P0–P2 findings. - Formatting, whitespace checks, and normal commit hooks passed. - Local lint stopped during configuration loading because `eslint-plugin-solid` could not be resolved. Exact-candidate [hosted proof](https://github.com/openclaw/openclaw/actions/runs/38347218098/job/115131307024) subsequently passed targeted type-aware lint with zero warnings or errors. - The same hosted job passed the complete ownership test file, 32/32 with no skips, including the new admitted-route regression (99.47 seconds Vitest, 139.53 seconds runner wall). - The separate [product proof](https://github.com/openclaw/openclaw/actions/runs/38347218098/job/115131307190) built the private QA runtime and passed the complete unchanged three-case account-model route file, 3/3 with no skips (171.35 seconds Vitest, 174.90 seconds runner wall). Candidate and test-file blob were verified from the hosted log. - Ordinary [CI 38347219340](https://github.com/openclaw/openclaw/actions/runs/38347219340) completed successfully: 35 jobs passed and 26 were skipped. Build artifacts, production types, all selected test types, lint, source contracts, boundaries, and the aggregate gate passed. Madge found zero cycles; T1 stayed 455→455, compatibility calls 9→9, and the dialect ratchet 0→0. Knip, the published-driver cell, and SDK diff were unselected; no fresh pass is claimed for those. The change adds no exports, SDK surface, or database calls.
Account-only models admitted through the Codex catalog can be rejected before inference because their transport route is lost. Regression commit `57244cbcd2d3ffa24d7339e6bc459f7f19cf3d53` (openclaw#168789) removed the published-catalog handoff. Native capability rows intentionally omit transport fields, while the admission capture retains route evidence separately; projecting the runtime snapshot loses the object identity used to retrieve that evidence. Reuse the existing borrowed admission snapshot when it shares the projected snapshot's catalog identity. This preserves the route, OAuth profile forwarding, and runtime compatibility evidence captured for the turn. Auth planning and harness support checks remain unchanged, including rejection of unsupported routes. No new catalog owner, database access, or model allowlist is introduced. The regression exercises catalog capture followed by snapshot projection through runtime preparation and verifies native ownership, the subscription route, OAuth profile forwarding, and compatible runtime IDs. Scope: two files, **+92/−3** overall (**+17/−2** production). Validation: - One isolated Codex review completed with no actionable P0–P2 findings. - Formatting, whitespace checks, and normal commit hooks passed. - Local lint stopped during configuration loading because `eslint-plugin-solid` could not be resolved. Exact-candidate [hosted proof](https://github.com/openclaw/openclaw/actions/runs/38347218098/job/115131307024) subsequently passed targeted type-aware lint with zero warnings or errors. - The same hosted job passed the complete ownership test file, 32/32 with no skips, including the new admitted-route regression (99.47 seconds Vitest, 139.53 seconds runner wall). - The separate [product proof](https://github.com/openclaw/openclaw/actions/runs/38347218098/job/115131307190) built the private QA runtime and passed the complete unchanged three-case account-model route file, 3/3 with no skips (171.35 seconds Vitest, 174.90 seconds runner wall). Candidate and test-file blob were verified from the hosted log. - Ordinary [CI 38347219340](https://github.com/openclaw/openclaw/actions/runs/38347219340) completed successfully: 35 jobs passed and 26 were skipped. Build artifacts, production types, all selected test types, lint, source contracts, boundaries, and the aggregate gate passed. Madge found zero cycles; T1 stayed 455→455, compatibility calls 9→9, and the dialect ratchet 0→0. Knip, the published-driver cell, and SDK diff were unselected; no fresh pass is claimed for those. The change adds no exports, SDK surface, or database calls.
Share lifecycle hook capture, native policy loops and gated diagnostic content construction. Combine initial session metadata updates through the existing writer and reuse the persisted-input notifier. Keep delivery evidence in a typed WeakMap without mutating or wrapping frozen error objects. Security checks, public contracts, transcript durability, parallel tool correlation and ordinary shutdown settlement remain. No schema, configuration, dependency, protocol or public SDK signature changes. The standalone session memory backend and its lifecycle machinery are untouched. Best-effort tradeoffs accepted: - Reusing the same engine during active disposal no longer has a WeakRef tombstone rejection. #168789 cites synthetic #143426/#143592 disposal cases, not a human production report. Misuse may fail in the engine normally; closing admission and actual resource settlement remain. - Fresh bounded primitive diagnostics are not redundantly cloned before publication (#108304). Listener egress still isolates its payloads. - Internal delivery-evidence readers receive the attachment-time snapshot, not another defensive copy (0ea0807). No human mutation report was found; unsupported internal mutation could affect a later reader. Confirmed-send suppression and attachment-time copying remain. Lane y08: 105 net production lines removed (165 added / 270 removed), excluding tests; tests add 67 net lines. Below-500 branch-only handoff for coordinator bundling after recent, older and largest-owner audits found no further sound candidate. No PR or hosted-CI success is claimed. Proof: production and affected test types, changed-file lint/format, runtime and madge cycles (zero), lint-suppressions (3/3), and independent P2 review passed. Maintenance resources (6/6), CLI spawn (40/40), and restart recovery (33/33) completed. Support proof was stopped after ten minutes without an assertion result; Gateway cancellation timed out during startup/imports with no assertion result, and deletion was not reached. CLI reliability was only partially exercised in an earlier interrupted selection. These are unresolved proof gaps, not attributed main failures.
* refactor(ui): consolidate chat owners and remove obsolete adapters Keep both live rendering routes and the existing DOM, text, persisted shapes, security boundaries, draft durability, and ordinary session concurrency. Consolidate effective-tool loading, header registration, transcript refs, history target capture, and PCM output ownership. Remove unused adapters after their completed native-control cutovers and redundant internal work. Best-effort tradeoffs accepted: - Pending-page/live-update overlap: #145240 records synthetic request-order proof, not a cited human incident. Displayed disposition can briefly lag until the next ordinary refresh; durable receipts remain authoritative. - Synchronous rail self-retirement: #153245 records a synthetic benchmark, not a cited human incident. Focus restoration is best effort in that case. - Obsolete intersection callbacks: #142227 records synthetic E2E proof, not a cited stale-delivery incident. Target maps ignore retired rows; a late callback can request redundant layout. - Obsolete mutation callbacks: the same #142227 provenance. Native disconnect remains; a late delivery can resample the current scroller. - Obsolete resize callbacks: #162617 records synthetic performance traces, not a cited stale-delivery incident. Native cleanup remains; a late callback can sample current layout. - Wrong bundled Gateway PR identity: #148070/#147952 describe the feature, not a wrong-target incident. The producer constructs the exact requested target; a contract violation now displays its returned result. - Cross-tab prefetch election: #125128 covered a retired five-session idle sweep with synthetic performance proof. Two tabs can now redundantly read one explicitly hover/focus-intended target; per-tab limits remain. - Malformed internal sidebar maps: #113712 introduced feature normalization, not a cited incident. Settings validates load/save and all callers use that output; impossible malformed typed values are not repaired at every update. * refactor(ui): consolidate chat lifecycle and internal state paths Continue the y01 largest-owner, export/caller and duplicate-helper audit. Delegate composer mounting to the canonical interop boundary while retaining field equality, keyed renderer identity and foreground picker cleanup. Remove test-only panel refresh methods and commit counters; exercise the actual view, polling and committed DOM instead. Trust admitted immutable composer metadata and the full tool-stream owner contract. Narrow sidebar traversal to its normalized single column and simplify browser/Gateway realtime decoding. Both shipping Lit/Solid paths and rendered markup remain unchanged. No config, protocol, storage, dependency, security-boundary or Phase E backend changes. Best-effort tradeoffs accepted - Malformed internal tool-stream hosts: #158032 introduced shape probes during a bookkeeping refactor, not a human incident. Real owners have complete state; a broken internal caller now fails rather than silently skipping cleanup. #125197's human steering/order report still justifies the unchanged causal reconciliation algorithm; no report ties malformed-host probes to that bug. - In-place mutation of admitted draft metadata: #158335 added reply persistence and #166682 moved the annotation copies, without a mutation incident. Actual editors replace records/arrays. A future in-place mutator must follow that contract or it may alter a pending snapshot. Durable receipts/revisions stay. - Non-JSON relay events: #146676 added transport machinery without a human cyclic-frame incident. Frames already crossed JSON decoding; an impossible internal cycle or BigInt now throws. Activation count/byte bounds remain. - Older Gateway close-disposition support: #171377 added a compatibility path, but UI/Gateway ship together and the current server advertises the field. Unsupported skew now rejects. Accepted-answer durability from the real human report #171310 and fixes #171377/#172159 remains intact. - Blob/typed-array/arbitrary Google message representations: c399fb7 added these alternate decoder branches without a linked human report. The browser WebSocket is configured as arraybuffer before listeners. Unsupported synthetic representations are ignored; actual strings/ArrayBuffers still decode, and removal of the artificial await needs no post-await stale check. - Extra sidebar columns after normalization: #123874 flattened the flexible #113712 layout to one tabbed panel. A broken internal producer is no longer searched as a multi-column layout; persisted legacy flattening still runs. The earlier commit records the original eight accepted best-effort scenarios. Coverage and remaining justified owners are logged in .local/y01-ledger.md for coordinator bundling. Combined candidate removes 416 net production lines against 5716bb1 (tests/support excluded). * test(ui): align talk fixtures with transport contracts Require detach disposition when append rejection closes the relay. The UI and Gateway ship together; the prior fallback's omitted field is no longer valid. Close the Google socket before start settles when testing startup rejection. Synchronous frame decoding removed the fixture's former artificial decode microtask; waiting one turn now settles start before the close. Preserve all error, callback, microphone, socket and timer assertions. No production change or new best-effort tradeoff. The preceding commit records the accepted transport assumptions and their provenance. * refactor(agents): consolidate runner lifecycle plumbing Share lifecycle hook capture, native policy loops and gated diagnostic content construction. Combine initial session metadata updates through the existing writer and reuse the persisted-input notifier. Keep delivery evidence in a typed WeakMap without mutating or wrapping frozen error objects. Security checks, public contracts, transcript durability, parallel tool correlation and ordinary shutdown settlement remain. No schema, configuration, dependency, protocol or public SDK signature changes. The standalone session memory backend and its lifecycle machinery are untouched. Best-effort tradeoffs accepted: - Reusing the same engine during active disposal no longer has a WeakRef tombstone rejection. #168789 cites synthetic #143426/#143592 disposal cases, not a human production report. Misuse may fail in the engine normally; closing admission and actual resource settlement remain. - Fresh bounded primitive diagnostics are not redundantly cloned before publication (#108304). Listener egress still isolates its payloads. - Internal delivery-evidence readers receive the attachment-time snapshot, not another defensive copy (0ea0807). No human mutation report was found; unsupported internal mutation could affect a later reader. Confirmed-send suppression and attachment-time copying remain. Lane y08: 105 net production lines removed (165 added / 270 removed), excluding tests; tests add 67 net lines. Below-500 branch-only handoff for coordinator bundling after recent, older and largest-owner audits found no further sound candidate. No PR or hosted-CI success is claimed. Proof: production and affected test types, changed-file lint/format, runtime and madge cycles (zero), lint-suppressions (3/3), and independent P2 review passed. Maintenance resources (6/6), CLI spawn (40/40), and restart recovery (33/33) completed. Support proof was stopped after ten minutes without an assertion result; Gateway cancellation timed out during startup/imports with no assertion result, and deletion was not reached. CLI reliability was only partially exercised in an earlier interrupted selection. These are unresolved proof gaps, not attributed main failures. * refactor(agents): remove duplicate runner preparation work Trust canonical inline model modalities and waiter-owned cleanup. Fold the sole-caller HTTP setup wrapper and stage warning predicate into their owners, and remove an unused diagnostic clock option. This pass removes 32 net production lines; the branch total is 137. Core and affected test types, lint, format, cycle checks, stage timing and suppression tests pass. Independent P2 review is clean. Wider focused runtime selections remain incomplete under host load; coordinator bundling needs broad CI proof. * refactor: withdraw inconclusive stream cleanup and repair bundle ratchets Retain current main stream-state contracts after the UI failure replay could not establish an exact-main comparison. Shrink the delivery-evidence assertion allowance and keep its frozen/primitive regression intact in a focused unit file.
…w#173015) * refactor(ui): consolidate chat owners and remove obsolete adapters Keep both live rendering routes and the existing DOM, text, persisted shapes, security boundaries, draft durability, and ordinary session concurrency. Consolidate effective-tool loading, header registration, transcript refs, history target capture, and PCM output ownership. Remove unused adapters after their completed native-control cutovers and redundant internal work. Best-effort tradeoffs accepted: - Pending-page/live-update overlap: openclaw#145240 records synthetic request-order proof, not a cited human incident. Displayed disposition can briefly lag until the next ordinary refresh; durable receipts remain authoritative. - Synchronous rail self-retirement: openclaw#153245 records a synthetic benchmark, not a cited human incident. Focus restoration is best effort in that case. - Obsolete intersection callbacks: openclaw#142227 records synthetic E2E proof, not a cited stale-delivery incident. Target maps ignore retired rows; a late callback can request redundant layout. - Obsolete mutation callbacks: the same openclaw#142227 provenance. Native disconnect remains; a late delivery can resample the current scroller. - Obsolete resize callbacks: openclaw#162617 records synthetic performance traces, not a cited stale-delivery incident. Native cleanup remains; a late callback can sample current layout. - Wrong bundled Gateway PR identity: openclaw#148070/openclaw#147952 describe the feature, not a wrong-target incident. The producer constructs the exact requested target; a contract violation now displays its returned result. - Cross-tab prefetch election: openclaw#125128 covered a retired five-session idle sweep with synthetic performance proof. Two tabs can now redundantly read one explicitly hover/focus-intended target; per-tab limits remain. - Malformed internal sidebar maps: openclaw#113712 introduced feature normalization, not a cited incident. Settings validates load/save and all callers use that output; impossible malformed typed values are not repaired at every update. * refactor(ui): consolidate chat lifecycle and internal state paths Continue the y01 largest-owner, export/caller and duplicate-helper audit. Delegate composer mounting to the canonical interop boundary while retaining field equality, keyed renderer identity and foreground picker cleanup. Remove test-only panel refresh methods and commit counters; exercise the actual view, polling and committed DOM instead. Trust admitted immutable composer metadata and the full tool-stream owner contract. Narrow sidebar traversal to its normalized single column and simplify browser/Gateway realtime decoding. Both shipping Lit/Solid paths and rendered markup remain unchanged. No config, protocol, storage, dependency, security-boundary or Phase E backend changes. Best-effort tradeoffs accepted - Malformed internal tool-stream hosts: openclaw#158032 introduced shape probes during a bookkeeping refactor, not a human incident. Real owners have complete state; a broken internal caller now fails rather than silently skipping cleanup. openclaw#125197's human steering/order report still justifies the unchanged causal reconciliation algorithm; no report ties malformed-host probes to that bug. - In-place mutation of admitted draft metadata: openclaw#158335 added reply persistence and openclaw#166682 moved the annotation copies, without a mutation incident. Actual editors replace records/arrays. A future in-place mutator must follow that contract or it may alter a pending snapshot. Durable receipts/revisions stay. - Non-JSON relay events: openclaw#146676 added transport machinery without a human cyclic-frame incident. Frames already crossed JSON decoding; an impossible internal cycle or BigInt now throws. Activation count/byte bounds remain. - Older Gateway close-disposition support: openclaw#171377 added a compatibility path, but UI/Gateway ship together and the current server advertises the field. Unsupported skew now rejects. Accepted-answer durability from the real human report openclaw#171310 and fixes openclaw#171377/openclaw#172159 remains intact. - Blob/typed-array/arbitrary Google message representations: 2a4c20f added these alternate decoder branches without a linked human report. The browser WebSocket is configured as arraybuffer before listeners. Unsupported synthetic representations are ignored; actual strings/ArrayBuffers still decode, and removal of the artificial await needs no post-await stale check. - Extra sidebar columns after normalization: openclaw#123874 flattened the flexible openclaw#113712 layout to one tabbed panel. A broken internal producer is no longer searched as a multi-column layout; persisted legacy flattening still runs. The earlier commit records the original eight accepted best-effort scenarios. Coverage and remaining justified owners are logged in .local/y01-ledger.md for coordinator bundling. Combined candidate removes 416 net production lines against 7f7310a (tests/support excluded). * test(ui): align talk fixtures with transport contracts Require detach disposition when append rejection closes the relay. The UI and Gateway ship together; the prior fallback's omitted field is no longer valid. Close the Google socket before start settles when testing startup rejection. Synchronous frame decoding removed the fixture's former artificial decode microtask; waiting one turn now settles start before the close. Preserve all error, callback, microphone, socket and timer assertions. No production change or new best-effort tradeoff. The preceding commit records the accepted transport assumptions and their provenance. * refactor(agents): consolidate runner lifecycle plumbing Share lifecycle hook capture, native policy loops and gated diagnostic content construction. Combine initial session metadata updates through the existing writer and reuse the persisted-input notifier. Keep delivery evidence in a typed WeakMap without mutating or wrapping frozen error objects. Security checks, public contracts, transcript durability, parallel tool correlation and ordinary shutdown settlement remain. No schema, configuration, dependency, protocol or public SDK signature changes. The standalone session memory backend and its lifecycle machinery are untouched. Best-effort tradeoffs accepted: - Reusing the same engine during active disposal no longer has a WeakRef tombstone rejection. openclaw#168789 cites synthetic openclaw#143426/openclaw#143592 disposal cases, not a human production report. Misuse may fail in the engine normally; closing admission and actual resource settlement remain. - Fresh bounded primitive diagnostics are not redundantly cloned before publication (openclaw#108304). Listener egress still isolates its payloads. - Internal delivery-evidence readers receive the attachment-time snapshot, not another defensive copy (8c995fb). No human mutation report was found; unsupported internal mutation could affect a later reader. Confirmed-send suppression and attachment-time copying remain. Lane y08: 105 net production lines removed (165 added / 270 removed), excluding tests; tests add 67 net lines. Below-500 branch-only handoff for coordinator bundling after recent, older and largest-owner audits found no further sound candidate. No PR or hosted-CI success is claimed. Proof: production and affected test types, changed-file lint/format, runtime and madge cycles (zero), lint-suppressions (3/3), and independent P2 review passed. Maintenance resources (6/6), CLI spawn (40/40), and restart recovery (33/33) completed. Support proof was stopped after ten minutes without an assertion result; Gateway cancellation timed out during startup/imports with no assertion result, and deletion was not reached. CLI reliability was only partially exercised in an earlier interrupted selection. These are unresolved proof gaps, not attributed main failures. * refactor(agents): remove duplicate runner preparation work Trust canonical inline model modalities and waiter-owned cleanup. Fold the sole-caller HTTP setup wrapper and stage warning predicate into their owners, and remove an unused diagnostic clock option. This pass removes 32 net production lines; the branch total is 137. Core and affected test types, lint, format, cycle checks, stage timing and suppression tests pass. Independent P2 review is clean. Wider focused runtime selections remain incomplete under host load; coordinator bundling needs broad CI proof. * refactor: withdraw inconclusive stream cleanup and repair bundle ratchets Retain current main stream-state contracts after the UI failure replay could not establish an exact-main comparison. Shrink the delivery-evidence assertion allowance and keep its frozen/primitive regression intact in a focused unit file.
First-parent upstream facdd3c..fd0fc62 (7 commits: openclaw#168789 subagent and runner bookkeeping, e65bd3b cold actor append retry, openclaw#168747 worker environment lifecycle, openclaw#169037, 7fb80f6, openclaw#168949, fd0fc62). openclaw#168789 removes retrySubagentCleanup: accepted-run termination is now a single attempt that resolves when the stop is confirmed (or the session provably belongs to a successor) and rejects when it is not. Conflicts: - subagent-spawn-cleanup.ts: took upstream's single-attempt form. Kept our hasFrozenSessionIdentity arms on both deletion paths: the abort-miss fallback rejects instead of deleting by key alone, and the waited provisional delete is skipped without a frozen identity. Dropped our retry option and isSettledAbortResponse (upstream's isDefinitiveAbortMiss already covers it in preserve mode); the continuation guard call-site contract still pins the identity guard. - Our boolean consumers adapted to the rejecting contract, keeping their pre-merge outcomes: the accepted-spawn sweep and spawn rollback map a rejection to "not terminated"; the collector's launch-failure path keeps rollback custody for the sweeper and settles once (pinned by subagent-registry.rollback-custody-restart.test.ts); its registration-changed path releases the acceptance hold in a finally. - subagent-spawn.test.ts: upstream's new "holds an unconfirmed collector slot for shutdown" expects no settlement; ported to the fork's custody contract (one abort, no second dispatch, settled once). - subagent-spawn-cleanup.test.ts: our cases ported to the new contract, plus two pins for the identity arms (RED with the arms removed). - subagent-registry-restore.ts: kept our armed-row skip next to upstream's restart-recovery/kill skip. - subagent-registry.test.ts: our extracted restore test kept; upstream's "reconcile on the next explicit restore" change ported into subagent-registry.restore-retry.test-support.ts. - worker-access inventory regenerated. Refs #1475 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…gistry only Upstream openclaw#168789 (absorbed at step 48) stopped refreshing and replanning registry mutations after a foreign row write: an out-of-band SQLite writer now makes the first conflicting mutation fail by design. Our "persists exact-registration rollback custody even after cleanup ownership flips" case re-saved its row raw right after the registry's own test add, which is exactly such a foreign write, so the recorder now returns pending-persistence (SubagentRegistryVersionConflictError). Seed through the registry add alone (it is already durable) and assert the durable row, the same fix the sibling kill case in this file already carries. The persisted/durable custody assertions are unchanged; the production writer goes through the same in-process FIFO. GREEN at step 47 (sweep s47 b-004), RED at steps 48 and 53 (s48 b-003, s53 b-005) and at a5b4c0c, 10/10 GREEN after. Refs #1475 Co-Authored-By: Claude Opus 5.5 <[email protected]>
What Problem This Solves
Agent completion and embedded-runner bookkeeping carries multiple overlapping ownership, retry, and invalidation protocols for unsupported or unusually timed changes. This removes those protocols while retaining the checks that protect real effects.
User Impact
Normal spawning, completion delivery, restart recovery, cancellation, transcript persistence, and configured capacity limits remain. Unsupported out-of-band writes and rare mid-operation configuration changes may fail visibly or take effect on the next request instead of receiving transparent recovery.
No configuration keys, persisted formats, schemas, retention policies, permissions, protocol shapes, or plugin SDK exports change. Ordinary shutdown still joins write-capable work and disposers. Requester wake creation and claim release now commit atomically rather than requiring two writes and a recovery handoff.
Why This Change Was Made
Eight of eleven original KEEP categories were narrowed: preserve the security, durability, measured-cache, and shutdown parts; remove the surrounding machinery. Synthetic interleaving tests and maintainer PR descriptions are not treated as production incidents. The retained opaque run keys participate directly in live execution/cron authority; the retained row generations also define persisted run ordering. Measured lookup caches remain: #167684 records large allocation reductions, and #131442 records live metadata cost plus warm lookups with no discovery filesystem calls. The human report #99495 independently justifies preserving frozen prompt projections and their cache behavior.
Best-effort tradeoffs accepted
The remaining descendant
dispose()no-op is required by a heartbeat-protected cron caller; this PR does not change that runtime caller. The Decision-prefilter config-change path also needs heartbeat-protected runtime callers and is left for that owner's cutover. Test-only notification and ambient-source-change cases that pinned removed read retries are deleted, including their unused support. During conflict resolution, main's independent cron-test removals were preserved; the resulting module contained only our obsolete source-swap cases and was removed. Caller-revocation coverage remains.Evidence
Net production reduction: 1,227 lines (826 added / 2,053 removed), excluding tests, fixtures, harness/test support, generated files and declarations. No new lint suppressions.
Earlier focused proof exposed an uncommitted-error classification regression; production classification was restored without weakening the test. Independent review found incomplete same-kind dedupe and maintenance disposal lifetime issues; these were corrected with explicit busy failure, weak identity tracking, and one cleanup-admission boundary. The full-scope run also caught five native auth-hook mutation regressions; the synchronous effect check was retained, without restoring async publication/retry machinery. The two shared baseline updates only shrink retired assertions and obsolete mock entries.
node scripts/run-vitest.mjs <six affected files> --maxWorkers=1; 2,658.54 s Vitest / 2,853.63 s wrapper wall on the heavily loaded host. This preserves native storage, auth, cancellation and cleanup boundary proof rather than duplicating those owners with cheaper mocks. No timeouts changed.6ca8f54a889df5f3a207e235049004a06d6d39a3, Blacksmith Testboxtbx_01m4m7shqq1jam98trccfbwx5a(run): 34/34 tests passed in the final model-ownership and cron-lifecycle files, 111.41 s wrapper wall time (--maxWorkers=1; individual Vitest durations 62.93 s and 26.69 s). Both cycle checks passed at zero. The changed gate passed formatting, assertion/mock/worker/timeout/line-cap ratchets, dependency pins, plugin boundaries and other pre-typecheck guards, then stopped at the unrelated existing UI-E2E root count: 722 versus 720. No UI or tsconfig files are changed here; this is a recorded local validation gap, not a claimed green gate.src/gateway/server-instance-runtime.types.ts(GatewayApprovalEventPublisherV2). Both cycle checks passed at zero. Exact-head PR CI remains the final gate.Dependent-test cutover after exact-head CI
The first ready-for-review CI run exposed 11 failing test jobs that still expected removed mechanisms. The follow-up is test-only: it removes synthetic foreign-reload, publication-retry, typed observer-error, mid-call cap, and two-phase promotion cases while retaining the actual resume flow, native no-overwrite/unknown-outcome guarantees, caller revocation, cold archive identity/LRU, and ordinary cleanup. Archive fixtures now use one explicit cold preparation and canonical publications rather than manufacturing a foreign-writer recovery.
The final five-file local run passed 52/52 (1,809.84 s wrapper wall); the earlier preflight/resume pair passed 47/47. The retained Gateway resume, initial-transfer, correlated-recovery, preview, and archive tests also passed. Two newly rewritten fixture errors were corrected: the redundant overlap fixture had the wrong session identity, and the clear-observer fixture accidentally persisted a deliberately memory-only row. No production code was changed to satisfy either fixture.
Blacksmith Testbox
tbx_01m4mtrcdc9a369t1zz1t936bk(run) verified source969b4d5c37fd2be9b1a98bcdc0ee4c5d58688d1d, treeb831008ad88e40dce6ab00b3c1ee2422865ee5f2: requester-wake E2E 34/34 (282.86 s Vitest), production types and all test-type graphs passed, and suppressions passed 3/3. Typed lint passed on all 14 changed test/support files; both cycle checks remain zero. No timeouts, retries, skips, lint allowances, or baselines were expanded.The full changed check passed its behavior-independent guards and types, then stopped at pre-existing unused exports in untouched session/state/Gateway/UI files. Those exports are already removed or private on current main. The maintenance loader full-tree finding has a real production caller in
subagent-registry-maintenance.ts; the caller and export predate this PR. This is a recorded branch-base/static-scan gap, not a claimed passing full changed check or an inherited-CI waiver. Exact-head hosted CI is still the landing gate; no CI job was rerun.GitHub then reported an actual conflict, so the final conflict-only rebase incorporates main
50cf629016e248cdea5fac810c8fc6b194155e01. The conflict was inside the removed pre-read publication retry; the resultingmodel-setup.tsis byte-identical to the already tested version. Main's usage-write ownership test migration was retained. On rebased head8886182402a2ec72b54656ce6873e08bee8b73b5, Blacksmith Testboxtbx_01m4mzvmw6awzspjzxxp69a68y(run) passed 33/33 native-ownership tests, production types, every test-type graph, both cycle checks at zero, and suppressions 3/3. The scoped changed check passed all preceding guards and its production export scan; only the full-tree scan reportedloadSubagentMaintenanceCandidatesInDatabase, whose real lazy production consumer is unchanged insubagent-registry-maintenance.ts. No ignore or allowance was added. The lease is completed. Earlier proof remains earlier-head proof, not a claim of green hosted CI for the rebase.Exact-head CI outcome
Run 38125666856 finished on
8886182402a2ec72b54656ce6873e08bee8b73b5: 142 terminal checks, no cancellations, and one failing test job plus its aggregate CI gate. The sole failure is the untouchedsessions-files.repository.test.tsstalecat-file blobcorruption hook. The identical failure was inspected in unrelated #168939, and #168975 has already fixed it on current main by updating the hook to--batch. All other checks, including security, passed. Landing uses the coordinator-authorized inherited-only admin exception pinned to that exact head, with the per-job evidence comment; it does not relabel red CI as green or rerun anything for a green result.