Skip to content

fix: retain subagent results through Gateway restarts - #199868

Merged
steipete merged 4 commits into
mainfrom
steipete/perf-micro-restart-subagent-result-loss-20260919
Nov 16, 2026
Merged

steipete merged 4 commits into
mainfrom
steipete/perf-micro-restart-subagent-result-loss-20260919

Conversation

@steipete

@steipete steipete commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes finished subagent results being suspended or silently removed when a Gateway restart interrupts requester settlement or completion delivery.

User Impact

Dashboard requesters recover owed results after restart, retries retain the accepted input identity, and every removed registry row leaves a recorded delivered, suspended, or discarded outcome with a reason. No configuration or database schema change is required. Removal receipts use the existing session-state history retention (30 days / 50,000 events).

Why This Change Was Made

A settled requester can have pending child results without any interrupted-run marker. Startup skipped that requester, then the sweeper and announce cleanup interpreted retired process authority as a permanently replaced store. Recovery now selects those obligations through the existing requester index, and both false failure branches are removed.

An accepted completion replay could retain its operator profile but lose its original sender presentation. That changed the accepted-input identity despite identical content and provenance. Replay now preserves accepted attribution when the freshly admitted profile matches. It retains the complete-request conflict check. This builds on #199695's committed consumption fact: a consumed private result remains delivered and a restored consumed row finalizes without redispatch; accepting an input alone does not prove consumption.

Retryable rows are protected from completed-run cleanup. The single registry deletion owner records a terminal fact atomically with removal, including the terminal postimage when requester settlement or lifecycle expiry immediately retires a row.

Evidence

Team r337 (257759ae → dd2d58be) drained at 23:31:19Z, exited at 23:31:27, restarted at 23:31:29, and reached readiness at 23:31:53. Read-only observations at +1/+6 minutes reported 4 lost results among 14 captured successful results: one was suspended as store replaced without a delivery attempt; three had accepted-input idempotency conflicts during drain, then failed/retryable rows disappeared. Two additional pending rows disappeared without delivery evidence. Production transcript contents were not accessed; synthetic evidence does not establish which of those three production inputs were consumed.

Related prior fixes: #198905, #199488, #198807, #198843, #199575. Integrated #199695 at 6d7a56de584a.

Focused native suites passed 160 tests (117 custody/lifecycle cases and 43 requester-coordination cases), including a real-worker lifecycle-expiry regression that was red before the review correction and green afterward. Baseline regressions fail for unmarked requester discovery, false store replacement, six-minute deletion of retryable results, absent removal facts, and restored sender attribution. The real Gateway subprocess harness passes announce-in-flight, private consumption, busy-requester, settled-private-result, unmarked-requester, and private-announce crash cases: 0 lost of 8 explicitly checked completion rows, with another restart checking each captured result’s delivered receipt and single input (six repeat checks). The unmarked case recreates the observed persisted shape by removing only restart markers from the stopped synthetic requester after real child capture/drain; it verifies the result is pending and absent from the transcript before startup. The provider is synthetic; Gateway processes, SQLite, admission, transcript consumption, shutdown and restart are real.

Published stable 2026.11.3 → candidate compatibility proof passed through the supported doctor --fix upgrade: two completed registry rows and the original transcript survived, and a fresh chat completed. Automatic-startup-only upgrade hit a separate secrets-loading ERR_SQLITE_ERROR after migration; that failure remains recorded, and is not represented as passing upgrade proof. Stable also hit a prompt-prefix error in the repeated-delegation setup, so pending recovery and stable data compatibility are separate proofs.

pnpm check:changed completed after each correction. Own test lint findings were fixed and both affected lint scopes pass. Its remaining dead-export failure reproduces on exact parent 6d7a56de584a: resolveRollbackWorkerInputs in the unchanged rollback test helper became unused when e4a30936bb35 / #198268 removed its external consumer. This is a main regression, not a passing gate. Format, typechecks, database/import guards and other checks passed. Codex P0–P2 autoreview found no actionable defects.

Production delta: +141/-56, net +85 lines; tests +379 net lines. Growth is predominantly the requested atomic terminal removal facts and explicit removal reasons; the false store-replacement failure path is deleted. No schema, configuration, dependency, or cache change. No Control UI runtime imports of changed modules were found.

Linux/btrfs synthetic measurement: 42,871,726,080-byte agent DB (~39.9 GiB), 10,830 sessions, 4,300 obligations, 62,000 files / 1.116 GB; Node 24.22.1, 4 CPU / 12 GiB container limits. Five interleaved A/B process pairs, each with 20 warmups and 20 trials, plus two A/A pairs and separate allocation sampling. Baseline selects 4,300 sessions; candidate selects 6,046, recovering 1,746 omitted requesters.

Discovery owner Before After
Median of process wall medians 172.5 ms 180.4 ms
Median of process CPU medians (all threads) 290.7 ms 318.5 ms
Pooled wall p95 431.7 ms 586.5 ms
Sampled main-thread allocation per pass 49.79 MB 51.54 MB

A/A wall medians were 171.7/170.3 and 170.3/169.7 ms; CPU medians were 287.9/271.8 and 295.3/289.6 ms. Allocation control was 49.72 MB/pass. The added recovery costs work; this is not a speedup claim. These timings cover startup discovery, not full startup or workspace I/O, and sampled allocation excludes worker heaps. No Team data was copied or mutated.

Initial-head CI run 43782742045 failed only when the Bun correlated-recovery shard exceeded its 60-second no-output watchdog (exit 143, no assertion reported). The six selected tests passed locally under Bun with that same watchdog. This is not claimed inherited or fixed; the final head requires its own CI.

CI run 43786635304 exposed an inherited fixture race in five requester-receipt cases. All five reproduce on its exact main parent 6aae38f36ee8 under Linux CPU contention. Normal session maintenance pruned newly created child fixtures because updatedAt: 1 dated them in 1970; diagnostic tracing reached the committed session-removal owner. The fixture was introduced by 903b5f20eb4a / #187270. This PR repairs the two fixture timestamps: the same contention run changes from 5 failed to 5 passed, and all 43 affected-file tests pass. Production retention and receipt assertions are unchanged. This is a repaired main test regression, not ignored CI noise.

CI run 43791145697 found a transcript-counting defect in the new private-announce harness. On exact CI merge dc6c6b3b61d3, a 1-CPU Linux run reproduces two matching carriers: the actual completion input and a later Recently Completed Subagents summary. Changing only the filter to count completion-event fragments passes under identical contention. No delivery assertion is removed. The final owner correction also has two baseline-red regressions: restored consumed private input must finalize without announcing again, and process-custody retirement must leave undelivered input retryable. Twelve selected lifecycle cases pass, including both regressions. Final Codex autoreview is scoped-clean through P2.

Final Linux proof also passes graceful private announce and busy requester at one CPU, then private announce interrupted by process crash at four CPUs. The one-CPU crash attempt timed out during setup before any crash or completed-result capture; the unchanged case passes at the fixture’s normal capacity (28.17 seconds total), with unchanged timeouts and assertions. It is a recorded setup limit, not a claimed restart failure or inherited defect. All three final scenarios retain delivered receipts and exactly one captured-result input through a second restart.

The consumer sweep caught an additional contract while simplifying the false retirement branch: an actual store replacement observed during an announce must remain terminal even if its selector later returns. The existing test became red with pending instead of suspended. The admission helper now reports its concrete replacement observation to the cleanup owner; ordinary process retirement still does not imply replacement. This retains the existing store boundary without adding a cache, schema, or generic failure classification. Final focused proof and independent review cover this correction.

Final correction verification: 17 selected lifecycle cases and all 8 selected store-replacement cases pass, including the previously failing selector-return case; all 40 requester-completion settlement cases, 3 normalization cases, and 38 requester-wake product cases pass. The latter covers six-child batches, nested completion, overlapping callers, receipt retention, yielded cohorts, cancellation, and descendant settlement. Final Codex P0–P2 review is scoped-clean.

Exact-head CI 43797910391 also exposes a new main lint regression: unicorn(prefer-structured-clone) in unchanged src/agents/tool-search-prepared-catalog.ts:118. The exact CI main parent 8862ffc735fe6f5e553a69ea2fb7731a6b90fd87 reproduces the identical diagnostic with the normal focused lint wrapper. Commit f4d2e45592438dbaae12975e1c4223a991285b7a / #199909 introduced the JSON snapshot expression. This is an attributed main regression requiring follow-up, not a passing gate or ignored noise; the repair must preserve its intentional JSON normalization. No CI rerun requested. The final-head ClawSweeper review has zero open items and no findings.

@clawsweeper

clawsweeper Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime scripts Repository scripts agents Agent runtime and tooling size: L labels Nov 16, 2026
@steipete
steipete marked this pull request as ready for review November 16, 2026 00:50
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T03:26:19.978564Z 82b0483 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7d619804b5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

Please review head 7d61980, especially unmarked requester recovery, accepted-input replay after restart, and atomic terminal removal facts. This builds on #199695's consumed-input owner. The PR body includes the restart reproduction, baseline failures, 0 lost of 6 checked completions, btrfs measurements, and the exact-parent attribution for the inherited unused test-helper export.

@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 16, 2026
@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR recovers retained subagent results after restart, preserves replay attribution, and records delivery outcomes atomically when registry rows are removed.

Example: A finished child holds CAPTURED_CUSTODY_RESULT while its settled requester has no restart marker.

  • Before: Startup skips the requester, and retired process custody can cause suspension or removal of the owed result.
  • After: Startup discovers the obligation, admits its requester again, and preserves one consumed result through subsequent restarts.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, focused repair with production-process restart evidence, stable-data compatibility proof, and no open findings; the synthetic provider bounds the proof claims.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): Supplied terminal evidence exercises isolated Gateway subprocesses, real SQLite, public session creation, completion consumption, graceful restart and process crash with a synthetic HTTP provider; reported results retain delivery receipts and one captured-result input across another restart.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Finished delegated work can disappear or remain unavailable after a Gateway restart.
Reason: The maintainer-authored repair addresses observed lost results with existing owners and adds durable removal evidence without a new schema or runtime setting.

Merge readiness

✅ Ready for maintainer review

This PR addresses concrete restart-related result loss that remains on main; no actionable introduced defect was found, and current-head CI is pending.

Priority: P2
Reviewed head: 82b048328be9017635f267bd6f3380cfecdc9b58

Before merge

None.

Findings

None.

Agent review details

How this fits together

The subagent registry retains child execution and delivery facts; Gateway startup restores requester custody, completion owners deliver retained input, and cleanup records terminal outcomes in session-state history.

flowchart TD
  A[Finished child result] --> B[SQLite subagent registry]
  B --> C[Gateway restart discovery]
  C --> D[Requester authority admission]
  D --> E[Requester transcript consumption]
  E --> F[Completion settlement]
  F --> G[Atomic removal and session event]
Loading

Technical review

Best possible solution:

Retain this focused repair using the existing discovery, admission, completion, and transactional history owners.

Do we have a high-confidence way to reproduce the issue?

Current-main discovery demonstrably excludes unmarked settled requesters, and supplied regressions cover the resulting recovery and cleanup failures; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The patch repairs the existing owners, preserves fresh requester admission and complete-request conflict checking, and removes the false equivalence between retired process custody and store replacement.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8862ffc735fe.

Provenance checked

  • Restart requester selection changes intended behavior with a stated reason (585ba38: Startup discovery installed per-session recovery waits while allowing unrelated owner-ready reads to proceed.)
  • Retired-custody cleanup and retention changes intended behavior with a stated reason (9344233: Graceful restart retired process-bound execution and resumed root sessions through ordinary input; the current incident demonstrates that retained delivery obligations must survive that retirement.)
  • Expired orphan completion settlement keeps the original intent (b7861d6: Expired completions without a producer must release parent FIFO reservations; this patch retains that owner while protecting genuinely retryable results.)
  • Private requester consumption keeps the original intent (6d7a56d: Committed private-input consumption remains delivered despite restart cancellation, while a separately owed visible final remains required.)
  • Accepted sender presentation on replay keeps the original intent (a11893e: Private replay preserves accepted presentation for the same stable identity while retaining complete-request hashing and live-authority checks.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +85, Tests +379, Docs +11, Other +40. Total +515 across 31 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 19 141 56 +85
Tests 10 439 60 +379
Docs 1 11 0 +11
Config 0 0 0 0
Generated 0 0 0 0
Other 1 47 7 +40
Total 31 638 123 +515

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus regression coverage Production +141/-56; tests +439/-60 Production growth chiefly adds atomic removal facts and their propagation through existing owners; tests cover distinct restart, retention, attribution, and transaction failures.
Configuration surface One benchmark flag: --discovery The flag selects startup-discovery measurement in the existing performance script; runtime configuration and defaults are unchanged.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Retained child results can be stranded or removed across Gateway restart, affecting delegated workflows with a bounded trigger.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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 execution lanes are retired.

History

Review history (3 earlier review cycles)
  • reviewed 2026-11-16T01:05:03.193Z sha 7d61980 :: blocked before merge. :: [P2] Preserve finalized rows through lifecycle-driven deletion
  • reviewed 2026-11-16T01:41:32.521Z sha fff1530 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-16T02:22:40.218Z sha 07e481c :: needs maintainer review before merge. :: none

Reviewed November 15, 2026, 10:30 PM ET / November 16, 2026, 03:30 UTC (Revision 4).

@steipete

Copy link
Copy Markdown
Contributor Author

Addressed both numbered items from the latest review on final head fff153011fa16645a78af458c8c7c59af01e9ea2:

  1. Preserve finalized lifecycle rows. The lifecycle owner now carries its finalized draft alongside the null deletion postimage (lines 54–58); the existing worker passes it to the atomic removal owner (lines 87–90). The real-worker regression failed before this correction with suspended / permanent_failure; it now records discarded / expired, retains the last error, and confirms the row is gone. Twelve focused lifecycle cases pass. This also addresses discussion_r4581052205.

  2. Stored-data compatibility and recovery proof. Published [email protected] created two completed registry rows and a requester transcript through a real Gateway and synthetic HTTP model. After stopping it, candidate doctor --fix --non-interactive followed by candidate startup preserved both rows' complete execution/completion values and the original transcript, and a fresh chat succeeded. No schema, codec, configuration, or dependency change is introduced. Sanitized output:

    [2519-upgrade] stable 2026.11.3 -> candidate: 2 completed registry rows and original transcript preserved; fresh chat passed
    Test Files  1 passed
    Tests       1 passed
    

    The new unmarked-requester restart case verifies a still-pending result and zero matching transcript inputs before startup, then delivery and exactly one input after two restarts. It recreates the observed persisted shape by clearing only requester restart markers in the stopped synthetic fixture after real child capture/drain; it does not claim that marker loss occurred organically in that run. After-fix output:

    recovers session completion custody through a real Gateway restart (unmarked-requester) 19117ms
    Test Files  1 passed
    Tests       1 passed
    

    Exact-parent native regressions remain red for omitted unmarked requester discovery and false store replacement. A real-process control with only the three recovery owners restored to exact parent 6d7a56de584a also failed to deliver the captured result, but logged an agent-inspection deferral, so that control is not claimed as an unambiguous standalone causal verdict. The reviewed sources were restored byte-for-byte and rebuilt afterward.

The PR body now distinguishes five restart scenarios (0 lost of 7 checked completion rows; five second-restart receipt checks) from the stable-data upgrade proof. It also records the upgrade limitations: stable repeated delegation hit a prompt-prefix error before the pending-result setup, and automatic-startup-only migration hit a separate secrets-loading SQLite I/O error; the supported separate-process Doctor upgrade passed. These failures are not hidden or counted as passing proof.

Final correction Codex autoreview is scoped-clean through P2. pnpm check:changed ran twice; its only remaining failure is the exact-parent-attributed unused helper from #198268, documented in the body. Initial-head CI had a no-output timeout; its six selected Bun tests pass locally under the same watchdog, and final-head CI is running independently.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Nov 16, 2026
@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. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 16, 2026
Use current timestamps for newly created fixture sessions. Under CPU contention, maintenance pruned the 1970-dated children during admission, before receipt assertions. The exact CI main parent reproduced all five failures; this two-line correction passes the same contention run and all 43 coordination tests.
@steipete

Copy link
Copy Markdown
Contributor Author

Final head is now 07e481c94bd2f016ce88a66fe2100554ee2be874. The only change since the zero-finding review is a two-line fixture repair exposed by CI:

  1. The finalized lifecycle postimage correction remains at the lifecycle owner, with its real-worker red/green regression unchanged.
  2. Stored-data compatibility and real Gateway recovery evidence remain as documented in the numbered response and current PR body. Production sources are unchanged since that review.

CI run 43786635304 failed five requester-receipt tests during initial admission. All five reproduce on its exact main parent 6aae38f36ee8152c2294fb52f9b91bb174e146e3 under Linux CPU contention. Diagnostic tracing showed normal session maintenance deleting the newly created child fixtures because updatedAt: 1 dated them in 1970. This fixture originated in 903b5f20eb4a / #187270; it is a main test regression, not noise.

The fixture now uses current timestamps. With the same 0.5-CPU runtime quota, all five cases change from failed to passed. All 43 affected-file cases pass normally. Production retention, the six-minute receipt checks, and their assertions are unchanged. Codex correction review is scoped-clean through P2. The changed-file pass has only the already attributed unused export from #198268; no other check failed.

Fresh exact-head CI is required before landing. No CI rerun was requested.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 16, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Final correction head: 82b0483.

  1. The prior lifecycle-removal finding remains fixed at the finalized postimage owner; its real-worker red/green regression is unchanged.
  2. The prior compatibility/restart evidence remains in the numbered response and updated PR body. Restart coverage now includes a real private-announce process crash: zero lost of eight checked rows across six scenarios, followed by six repeat receipt/single-input checks. Production transcript presence is still unproven; no Team DB was queried.

CI run 43791145697 exposed a harness overcount, reproduced on its exact merge under one-CPU Linux contention. The second custom message contains Recently Completed Subagents summary text, not another completion input. The filter now counts the completion-event fragment. Changing only that filter passes under the same contention; delivery and single-input assertions remain.

The owner follow-up finalizes restored consumed private input before redispatch and uses observed store replacement, rather than generic retired custody. Both new regressions fail on the previous head. The existing selector-return regression also caught an overbroad deletion; the existing admission helper now passes that concrete observation to cleanup. Seventeen selected lifecycle and eight store-boundary cases pass, plus all 40 settlement, three normalization, and 38 requester-wake cases. Final Codex P0–P2 review is scoped-clean.

The one-CPU crash attempt timed out in setup before result capture/crash. At normal four-CPU capacity, the unchanged case passes; no timeout or assertion was loosened. That setup limitation remains recorded. Changed-file checks retain the independently attributed main unused-export defect from #198268; all other checks pass. New exact-head CI must complete before landing. No CI rerun requested.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 16, 2026
@steipete
steipete merged commit 22f4042 into main Nov 16, 2026
149 of 154 checks passed
@steipete
steipete deleted the steipete/perf-micro-restart-subagent-result-loss-20260919 branch November 16, 2026 03:48
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 16, 2026
* fix: retain subagent results through Gateway restarts

* fix: preserve terminal state when retiring subagent results

* test: keep requester receipt fixtures within session retention

Use current timestamps for newly created fixture sessions. Under CPU contention, maintenance pruned the 1970-dated children during admission, before receipt assertions. The exact CI main parent reproduced all five failures; this two-line correction passes the same contention run and all 43 coordination tests.

* fix: settle restored subagent consumption before retry
scribe-dandelion-cult added a commit to karmaterminal/openclaw that referenced this pull request Nov 19, 2026
…stage 2)

Catches the pure continuation candidate bc7e568 up to openclaw/openclaw
main 41bdde2 (fetched 2026-11-19T14:32:59Z),
2,996 upstream commits past the old merge base 401a1de. Merge commit only;
rerere disabled, so every resolution was made here.

80 conflicted paths (77 content, 3 modify/delete), each recorded with base,
ours and theirs blobs and its reason in the lane's stage2-conflicts.md:
- 8 take upstream whole: the openclaw#197153 pg16-smoke cherry-pick (6909b64) now
  ships upstream (ci.yml, ci-build-manifest, ci-workflow-planning test), the
  Control UI settings child moved onto runDistArtifactChild, the canary
  worker target and two active-facts migration tests.
- 3 deleted with upstream: session-fork and update-candidate-canary suites
  whose production paths upstream removed; cwd-split folded away (openclaw#198916),
  its one continuation case rehomed to attempt.continuation-tools.test.ts.
- One-owner cutovers where upstream now owns a fork extraction: the
  requester-origin projection and replacement-text helpers (openclaw#200533) replace
  the fork's byte-identical copies in user-turn-transcript.metadata.ts.
- Ports into fork-extracted owners: removalReason in the queued-start plan
  and collector-group sweep (openclaw#199868), the async prepared-pricing usage
  diagnostic, the announce flow types, and the session-delivery codec, which
  gains upstream's mediaCandidate kind, reviewedTaskId and their schemas
  (openclaw#198227), importing its retention type from the leaf types module.
- Transcript repair (openclaw#201304, post-b894): upstream's payload-free adapter
  kernel carries the fork's continue_delegate attachment redaction through a
  payload-adapter-only fact and a withBlock update.
- Reset cleanup: upstream's process and retained-send stops (openclaw#199079,
  openclaw#200326) with the fork's continuation-aware reason as the single input;
  the chat reset's retention adapter wraps upstream's stopSessionResetWork,
  the Gateway preemption keeps stopSessionResetSubagents as upstream does.
- Schema: upstream owns agent 42 (tool usage) and 43 (pending-input
  endings) and is at 43; 44 is unused upstream. Continuation's recipient
  authority moves 42 -> 44: version constants, step order, historical
  schemas, witness additive table and version set, backup scope, PostgreSQL
  ladder (V43 = current minus the authority table) and port descriptor.
  package.json schemaVersions state 40, agent 44.
- Generated outputs regenerated, never hand-merged: config baseline,
  gateway validators, postgres schema catalogs, worker-access inventory.
- Compile follow-through for upstream's delivery-union narrowing and its
  readSessionDelivery callers.

Refs openclaw#129388
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: L 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