Skip to content

refactor(agents): simplify subagent and runner bookkeeping - #168789

Merged
steipete merged 8 commits into
mainfrom
deslop/p07-agents-runner-20261010
Oct 11, 2026
Merged

steipete merged 8 commits into
mainfrom
deslop/p07-agents-runner-20261010

Conversation

@steipete

@steipete steipete commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

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

Removed mechanism Prior scenario and provenance Accepted outcome
Foreign-row reload and three-attempt replan An out-of-band writer changes the registry while the Gateway owns it; synthetic foreign-connection cases in #163195, distinct from the ordinary same-process FIFO fix. Reject the conflict without overwriting rows; explicit restore/restart reloads them.
Initial requester transfer custody/retirement and two-write release protocol A transfer is replaced between preparation, promotion and claim release; #160778/#163195 provide synthetic handoff proof, not an independently cited human incident. One atomic write and post-commit publication; overlapping initial transfer fails as busy; observer failure is visible rather than compensated/replayed.
Pending-wake copies of requester/cancellation/progress identity A row changes while an acknowledged wake is being retried; #163195 family. Actual native mutation/reconciliation still checks these facts at the effect; pending bookkeeping does not duplicate those predicates.
Retired read-publication ownership Close/reopen or database selector replacement during publication; #151917. Drop the optional cache and load durable rows on later preparation.
Borrowed fill cancellation classification/retry The first of several waiters cancels during a shared fill; #154727 synthetic interleavings. Current waiters observe the failure; the next request fills the cache.
Restore revision retry loop A publication overtakes a streamed restore; #160778. Apply committed local deltas once rather than rereading until quiet.
Read-snapshot publication listeners, topology generations and preparation loops Registry membership changes during read preparation; #165684/#168078. Consume current published facts or request a new selection. The deletion owner retains its current durable-basis guard.
Controller routing/config snapshots Store/roster/routing changes midway through cancellation; #160203/#164727. The prepared target remains selected; current cancellation policy and live session authority still apply.
Scheduler launch retry/requeue and memoized start Failed launch bookkeeping automatically repeats; #133470/#163558. One launch and one failure settlement; uncertain work keeps its slot for shutdown/recovery, without repeat dispatch.
Held-reservation cancellation certification A removed ID is reused during cleanup; #163558 synthetic Stop interleavings. Keep the reservation check at withdrawal and await cleanup; no secondary identity map.
Dynamic prepared lane-limit getter Capacity configuration changes during preparation; #158616. Later preparations see the new limit; active preparation retains its selected limit.
Unbounded spawn cleanup/delete/abort retries Cleanup fails repeatedly; #158251. One cleanup attempt and one bounded hosted abort follow-up, then a clear error and actual controller/shutdown settlement.
Restore timer/backoff/reset-generation owner Reset/config change overlaps restore, or hydration fails; #121766/#165184. A later explicit access/activation or restart retries from the durable rows.
Restore failure nonce and frozen launch/kill snapshots Cleanup and bookkeeping ownership change at a forced boundary; #158251/#163558. A simple in-progress set and one current-state check at the effect.
Cleanup bookkeeping generation checks and shutdown-only timer replay A reservation/counter owner changes while bookkeeping settles; #163195/#163331 families. Counters and reservation release are direct. Resumption checks its timer/run once at the effect; actual delivery/deletion authority remains.
Recursive maintenance owners and custody transfer Another maintenance request arrives during disposal; #143426/#143592 synthetic disposal repros. One owner/loop, bounded disposal, and admission closed during final cleanup. Shutdown continues to join the real tail.
Process-global maintenance abort registry and fake-process seam The module reloads during active work; no cited human incident. Module-local tracking; ordinary SIGINT/SIGTERM handling remains.
Native model-row publication retry A synthetic row publication interrupts model setup; #164682. One read, with live auth/model/writer checks retained across the async ownership hook and at dispatch.
Borrowed catalog generation/identity fence Catalog changes while the first request prepares; #167492. Use the loader's catalog; a stale model selection can fail normally and be retried next run.
Detached replay's extra preparation witness and remembered file incarnation Byte-identical database replacement during replay preparation; #165367. Check current user bytes/anchor and owned writer at replay; no extra remembered filesystem incarnation.
Steering observer-error aggregation/custody conversion An internal accepted/settled observer throws; #165370. Log the observer error best effort; retain the message's real acceptance and persistence outcome without repeat delivery.

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.

  • Final independent review: scoped-clean through P2 on the committed tree.
  • Final focused rerun: 174 tests passed in six files, 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.
  • Initial full-scope Linux run: 3,053 passed / 17 failed. Failures were classified and addressed: five security-effect regressions; one incomplete compaction mock; two cancellation fixtures missing canonical hydration; and nine expectations for removed foreign-write/close-reopen paths. The retained foreign-write integrity case now expects first-conflict rejection and still proves no overwrite. Four unhandled errors belonged to the incomplete mock and removed close/reopen cases.
  • Resource routing: one Testbox completed the initial focus; a second hit the allocation budget. The first AWS scope run completed. A later AWS quota downgrade to a 2-GB instance was stopped before validation. Final proof uses the authorized fallback, one lease at a time; no hosted CI was rerun or dispatched for this work.
  • The next full scope run passed 6,584 tests and exposed 16 later-group failures. Minimal fixes preserve whole-batch no-outcome decisions, committed-wake membership, complete read payloads and native cleanup tracking. Other corrections use canonical fixture writes/recovery and case-owned IDs; the impossible duplicate start and nonpublishing foreign-writer expectations were removed. The full build and both cycle checks passed (zero cycles). All 316 affected tests then passed sequentially, followed by 44 requester tests after the mechanical helper extraction. Core and agents/sessions test typechecks passed.
  • Earlier head 6ca8f54a889df5f3a207e235049004a06d6d39a3, Blacksmith Testbox tbx_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.
  • The earlier suppression failure disappeared after the conflict-only rebase onto newer main; the rebased suite passed 3/3. It was run before every push; no suppression was added or allowlist expanded.
  • GitHub reported actual conflicts, so the branch was rebased (no green-chasing refresh). Main's async native ownership API and unpublished native-write guard are retained; the ownership test passes 33/33, including new async-only and unpublished-write cases. The changed gate passed production types and every test type graph, then stopped at an unrelated unused export in 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 source 969b4d5c37fd2be9b1a98bcdc0ee4c5d58688d1d, tree b831008ad88e40dce6ab00b3c1ee2422865ee5f2: 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 resulting model-setup.ts is byte-identical to the already tested version. Main's usage-write ownership test migration was retained. On rebased head 8886182402a2ec72b54656ce6873e08bee8b73b5, Blacksmith Testbox tbx_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 reported loadSubagentMaintenanceCandidatesInDatabase, whose real lazy production consumer is unchanged in subagent-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 untouched sessions-files.repository.test.ts stale cat-file blob corruption 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.

@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: XL labels Oct 11, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 11, 2026
@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: Wake creation and requester-claim release require two durable writes and a recovery handoff.
  • After: One durable write records the wake and releases the requester claim before publishing continuation facts.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A useful, source-supported simplification with passing relevant harness validation, but limited directly inspected runtime evidence.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; current-head CI supports the production-path harnesses, while the inspected media shows earlier capacity UI behavior rather than this change.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
User problem: Internal recovery and ownership machinery adds complexity without additional value for supported ordinary operation.
Reason: The maintainer author records the direction and accepted tradeoffs, and the diff substantially reduces production code without adding configuration or public surfaces.

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
Reviewed head: 8886182402a2ec72b54656ce6873e08bee8b73b5

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No inspected shipped-entry-point capture demonstrates the complete simplified recovery flow; the ordinary contributor proof gate does not apply to this maintainer-authored refactor.
Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • EVA: Raw commit c15b295 adds src/agents/pi-embedded-runner/context-engine-maintenance.ts:512 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: c15b295a8564; files: src/agents/pi-embedded-runner/context-engine-maintenance.ts)

PR surface

Source -1238, Tests -2351, Docs +4, Other -2. Total -3587 across 76 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 24 812 2050 -1238
Tests 49 535 2886 -2351
Docs 1 12 8 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 2 1 3 -2
Total 76 1360 4947 -3587

Review metrics

Metric Value Why it matters
Production versus test/support LOC Production −1,227 net lines; tests/support −2,362 net lines. The reduction removes the accepted bookkeeping mechanisms and their obsolete fixtures while retaining storage, cancellation, and ordinary flow coverage.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is a maintainer-directed complexity reduction without an urgent user-facing regression introduced by the patch.
  • merge-risk: 🚨 availability: Failed hydration or unconfirmed collector settlement can wait for explicit activation, shutdown, or restart; the maintainer explicitly accepts and documents this availability tradeoff.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (6 earlier review cycles)
  • reviewed 2026-10-11T01:25:12.698Z sha 6ca8f54 :: needs changes before merge. :: none
  • reviewed 2026-10-11T02:13:30.851Z sha 2a3ffa3 :: needs changes before merge. :: none
  • reviewed 2026-10-11T03:10:11.154Z sha cd0fce1 :: needs changes before merge. :: none
  • reviewed 2026-10-11T03:19:28.629Z sha cd0fce1 :: needs changes before merge. :: [P2] Update preflight coverage for captured lane limits | [P2] Migrate the resume test away from automatic foreign-row reload | [P2] Hydrate the retired-owner fixture before its canonical deletion | [P2] Keep withdrawal expectations independent of observer errors | [P2] Remove the retired ambient-source fence expectation from Cron coverage
  • reviewed 2026-10-11T07:45:42.670Z sha 969b4d5 :: needs changes before merge. :: none
  • reviewed 2026-10-11T08:40:01.618Z sha 969b4d5 :: needs changes before merge. :: none

Reviewed October 11, 2026, 4:55 AM ET / 08:55 UTC (Revision 7).

@steipete
steipete force-pushed the deslop/p07-agents-runner-20261010 branch 2 times, most recently from 2a3ffa3 to cd0fce1 Compare October 11, 2026 03:02
@steipete
steipete marked this pull request as ready for review October 11, 2026 03:11
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 11, 2026
@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Oct 11, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

The dependent-test cutover is committed in 969b4d5c37fd2be9b1a98bcdc0ee4c5d58688d1d. Production is unchanged from the reviewed first head; net production reduction remains 1,226 lines.

Attribution for every failing test job in run 38107601106, head cd0fce1fa262af17ce08c81b7d259b9ed584676d:

Job Cause and correction
checks-node-changed-compact-large-13 Preflight still expected a captured cap to mutate mid-call; removed that expectation, keeping admitted group/cap coverage.
checks-node-changed-compact-small-2 Resume still expected automatic foreign-row cache reload; kept rejection, unchanged resident state, no successor, and durable no-overwrite assertions.
checks-node-changed-compact-large-12-1 Preview forced a second compact recovery after an unsupported foreign replacement; removed that case, retaining preview authorization/redaction coverage.
checks-node-changed-compact-large-8 Typed observer exceptions still converted confirmed withdrawal to indeterminate/queued; removed those observer-only variants, retaining real withdrawal and persistence-failure coverage.
checks-node-changed-compact-large-9 Cron expected the removed ambient-source fence during a held read; removed only that variant. Close, cancellation, and current committed writes remain covered.
checks-node-changed-compact-large-1 Dependent tests pinned repeated delete attempts, catalog-lifetime fences, promotion retries, a second cohort write, and repeated-claim custody. Removed those assumptions while keeping actual native cancellation, caller revocation, lost-ACK/restart, and the full sessions.send resume flow.
checks-node-changed-compact-small-20 An unhydrated row inside a private snapshot required foreign-version replan before retirement. Removed that scenario; seven ordinary correlated-recovery cases remain and pass.
checks-node-changed-compact-small-6 Eight tool tests exclusively forced removed compact-recovery/canceled-fill paths. Removed them; the real off-thread persisted wait test remains and passes.
checks-node-changed-compact-large-17 Cold archive tests manufactured foreign recovery before their real assertions. Replaced only that setup with one cold preparation; both archive/LRU/visibility cases pass unchanged.
checks-node-changed-compact-small-17 Index tests manufactured recovery or cleared the cache midway through placement. Removed the latter cases and used canonical preparation/publications for the retained archive, ownership, and index checks. All 11 retained tests pass.
checks-node-changed Requester-wake E2E pinned source-switch retirement/reconciliation retries. Removed only that variant; all 34 retained cases pass on Testbox.
openclaw/ci-gate Aggregate of the test failures above, not a separate defect.

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.
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Oct 11, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Oct 11, 2026
@steipete
steipete force-pushed the deslop/p07-agents-runner-20261010 branch from 969b4d5 to 8886182 Compare October 11, 2026 08:40
@steipete

Copy link
Copy Markdown
Contributor Author

Conflict-only rebase complete at 8886182402a2ec72b54656ce6873e08bee8b73b5, incorporating main 50cf629016e248cdea5fac810c8fc6b194155e01. GitHub reported CONFLICTING; this was not a green-chasing refresh.

The only textual conflict was in the removed pre-read publication retry. The final model-setup.ts has exactly the same blob as the previously reviewed/tested head (a7efcc5daf6879367f8ab27ea381f862ec79b24c). Main's usage-write test migration to the completion owner was preserved.

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 subagent-registry-maintenance.ts. No scan allowance or suppression was added.

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.

@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 11, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Exact-head CI attribution and inherited-failure landing

Head: 8886182402a2ec72b54656ce6873e08bee8b73b5.
CI run: 38125666856.

All 142 check runs were enumerated. All are terminal; zero were cancelled. There are exactly two failures:

Check Attribution
checks-node-changed-compact-large-14-1 Only failing case: sessions-files.repository.test.ts > keeps stopped inspection limited to verified changed artifacts. The stale test hooks cat-file blob, while the pre-existing production reader uses cat-file --batch, so its corruption hook never runs and the request resolves. This PR changes neither the test nor its repository-file reader path.
openclaw/ci-gate Aggregate failure caused by the single test job above; no additional failing suite.

Independent reproduction: the identical case and promise resolved ... instead of rejecting failure are present in unrelated PR #168939, run 38118128965, job 114407266418, at head b23e3b48d0d0f48b68cc0d5f2e9658c187671e44. I inspected that job's log; this is not an inference from a red rollup.

The defect is already fixed on main by #168975, commit a4056f5bbccdf54679f56dd579dfd22ab945c7c1. Its repair updates the three stale predicates to --batch and corrupts a payload byte while preserving the batch framing and every assertion. The repair records reproduction on main 38ced6eb78481f61e55f45a5c74d334cb8e8a2a8 and 12/12 passing tests after the fix. The merged repair is an ancestor of the freshly fetched main; our diff does not touch the repaired file, so the squash retains that fix.

All other selected tests, lint, types, build and checks passed. security-fast passed, and the openclaw/dependency-review and openclaw/security-sensitive-review statuses are successful. There are no missing/cancelled suite results to substitute.

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.

@steipete
steipete merged commit 5d6cf74 into main Oct 11, 2026
151 of 154 checks passed
@steipete
steipete deleted the deslop/p07-agents-runner-20261010 branch October 11, 2026 09:41
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 12, 2026
…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
steipete added a commit that referenced this pull request Oct 13, 2026
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
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.
steipete added a commit that referenced this pull request Oct 15, 2026
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.
steipete added a commit that referenced this pull request Oct 15, 2026
* 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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…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.
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 18, 2026
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]>
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Oct 19, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant