Skip to content

test(subagents): align lifecycle retries with durable completion owners - #152184

Merged
steipete merged 1 commit into
mainfrom
codex/lifecycle-retry-grace-fixture
Sep 18, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/lifecycle-retry-grace-fixture

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Four lifecycle-retry E2E cases fail under both Node and Bun because their fixtures no longer match the completion owners. They load the supported-model mock after its consumer, replace required durable writes with no-ops, and expect one run to deliver text from another run.

Why This Change Was Made

Load the existing model fixture first and use the established isolated session and registry persistence pattern from #151907. Preserve the exact-run result contract from #149223: later session traffic can refresh descriptive metadata without replacing the original run's delivered result. A separate existing case proves a corrected same-run terminal receipt with matching transcript evidence while unrelated later-run text remains excluded.

Move the unchanged frozen-result waits into the existing lifecycle wait helper to stay within the file limit. Retry counts, timing, delivery order, and cleanup remain intact. No production, schema, policy, or dependency changes.

Evidence

  • The safely isolated original fixture reproduces four failures out of fourteen under Node and verified custom Bun v14. The unsafe shared temporary store was not used.
  • All 53 lifecycle, requester, expiry, and exact-run result cases pass under each runtime, with no skips. Actual Vitest executables were verified.
  • Changed-file checks, both file-limit gates, and fresh independent P0–P2 review pass. The extracted waits retain the same predicates, 80 attempts, 1 ms advancement, and Promise flush order.
  • All test processes joined and isolated state cleanup completed. These are source-only fixtures; no packaged application build is claimed.

Use isolated real persistence and load the existing model fixture before its consumer. Preserve cross-run output exclusion while proving a corrected same-run completion receipt. Reuse the existing lifecycle wait owner without changing timing or delivery assertions.
@clawsweeper

clawsweeper Bot commented Sep 18, 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 agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Sep 18, 2026
@steipete
steipete marked this pull request as ready for review September 18, 2026 21:55
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 18, 2026
@clawsweeper

clawsweeper Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 18, 2026, 6:07 PM ET / 22:07 UTC.

ClawSweeper review

What this changes

The PR updates subagent lifecycle tests to use isolated durable persistence, verify run-specific retry results, and reuse the existing wait helpers.

Merge readiness

✅ Ready for maintainer review

Keep open: this focused fixture repair remains absent from current main, preserves the established completion contract, and has no identified blocking defect. The maintainer-authored PR is also protected from automatic closure.

Priority: P3
Reviewed head: 042e6c9da9f732608d6bf58d228eab9ae3482a67

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused fixture repair with meaningful boundary assertions, reported paired validation, and no identified correctness or security blocker.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored PR changes lifecycle fixtures and assertions only; the external-contributor runtime-proof gate does not apply. Its reported Node/Bun tests exercise registry persistence with mocked Gateway responses, not live channel behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR changes lifecycle fixtures and assertions only; the external-contributor runtime-proof gate does not apply. Its reported Node/Bun tests exercise registry persistence with mocked Gateway responses, not live channel behavior.
Evidence reviewed 7 items Introduced scope: The host-verified merge-base-to-head patch changes only the lifecycle test and its wait helper. The verified test merge likewise changes only those paths against its main parent; unrelated endpoint drift is not attributed to this PR.
Fixture isolation and persistence: Setup creates dedicated OpenClaw state, seeds the requester through the real session accessor before fake timers, and retains production registry persistence. Teardown resets registry state and cleans the fixture. The requester-wake sibling uses the same established pattern.
Assertions match the production result boundary: The announcement reader filters transcript messages by the completed run ID. Session refresh may change completion.resultText without replacing terminalReply; the revised cases exercise that distinction and a corrected same-run receipt. The production reader has identical blobs on the reviewed head and fetched main.
Findings None None.
Security None None.

How this fits together

Subagent lifecycle handling records child completion and delivers the selected child's answer to its parent. These tests exercise completion events, persistence, and delivery retries through controlled Gateway responses.

flowchart LR
  A[Child lifecycle events] --> B[Subagent registry]
  B --> C[Isolated durable state]
  B --> D[Run-specific answer reader]
  E[Child transcript] --> D
  D --> F[Parent delivery and retry]
  F --> G[Delivery and cleanup assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +27. Total +27 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 97 70 +27
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 97 70 +27

Review metrics

None.

Technical review

Best possible solution:

Keep lifecycle regression coverage aligned with the existing durable owners and exact-run answer contract without relaxing retry, ordering, or cleanup assertions.

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

Yes, at source level: the existing lifecycle suite expects another run's text despite the production reader filtering by run ID. The author reports failing baseline runs; this review did not execute tests.

Is this the best way to solve the issue?

Yes. Reusing the isolated persistence fixture and correcting the existing boundary assertions is a narrow repair; the extracted waits preserve their predicates and timing.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 4fe8176abb0d.

Labels

Label changes:

  • add P3: This is bounded test-fixture maintenance with no production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR changes lifecycle fixtures and assertions only; the external-contributor runtime-proof gate does not apply. Its reported Node/Bun tests exercise registry persistence with mocked Gateway responses, not live channel behavior.

Label justifications:

  • P3: This is bounded test-fixture maintenance with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR changes lifecycle fixtures and assertions only; the external-contributor runtime-proof gate does not apply. Its reported Node/Bun tests exercise registry persistence with mocked Gateway responses, not live channel behavior.

Evidence

What I checked:

  • Introduced scope: The host-verified merge-base-to-head patch changes only the lifecycle test and its wait helper. The verified test merge likewise changes only those paths against its main parent; unrelated endpoint drift is not attributed to this PR. (042e6c9da9f7)
  • Fixture isolation and persistence: Setup creates dedicated OpenClaw state, seeds the requester through the real session accessor before fake timers, and retains production registry persistence. Teardown resets registry state and cleans the fixture. The requester-wake sibling uses the same established pattern. (src/agents/subagents/registry/subagent-registry.lifecycle-retry-grace.e2e.test.ts:116, 042e6c9da9f7)
  • Assertions match the production result boundary: The announcement reader filters transcript messages by the completed run ID. Session refresh may change completion.resultText without replacing terminalReply; the revised cases exercise that distinction and a corrected same-run receipt. The production reader has identical blobs on the reviewed head and fetched main. (src/agents/subagents/announce/subagent-announce-result.ts:62, 31172cf54466)
  • Current-main necessity: Comparison with fetched main shows the old shared store, persistence no-ops, and cross-run fixture expectation remain there. The supplied latest-release tree could not be resolved locally, so no shipped-fix claim is made. (src/agents/subagents/registry/subagent-registry.lifecycle-retry-grace.e2e.test.ts:116, 4fe8176abb0d)
  • Related merged work supports this repair: Provided GitHub metadata verifies fix(agents): deliver complete subagent answers to waiting parents #149223 merged the exact-run answer contract and fix(agents): preserve active cleanup during requester settlement #151907 merged the requester cleanup repair and isolated persistence pattern. Neither implements this remaining lifecycle fixture update.
  • Validation and proof scope: The captured PR body reports four original failures and 53 passing lifecycle, requester, expiry, and exact-run cases under each of Node and custom Bun. Those executions were not repeated under this read-only review. Diff whitespace checks passed. Inspected downloaded screenshots belong to the earlier merged answer-delivery PR, not this test repair. (042e6c9da9f7)

Likely related people:

  • Ayaan Zaidi: Raw commit 31172cf adds src/agents/subagents/announce/subagent-announce-result.ts:62 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 31172cf54466; files: src/agents/subagents/announce/subagent-announce-result.ts)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit d5dee8f into main Sep 18, 2026
238 checks passed
@steipete
steipete deleted the codex/lifecycle-retry-grace-fixture branch September 18, 2026 22:25
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 18, 2026
…pr-149099-main-20260918

* commit '795e460278d4f8f41545dc8b4a66da1d12defd90': (1902 commits)
  refactor(slack): share Markdown preparation (#149129)
  fix(tooling): release completed PR operations with exited loaders (#152209)
  fix(release): allow stable npm bootstrap under an operator soak waiver (#152206)
  fix(daemon): avoid false restart timeouts during slow startup (#151387)
  feat: read agent documents from a host-owned workspace (#150584)
  improve(startup): skip redundant single-agent directory checks (#152192)
  test(ui): await board widget readiness before size reports (#152198)
  perf(browser): move dashboard event discovery to SQLite worker (#151952)
  improve(auth): reduce pauses during concurrent credential reads (#152140)
  improve(ui): load older chat history in smaller pages (#152093)
  fix(release): reject incomplete legacy npm install trees (#152186)
  refactor: share current-conversation binding row serialization (#152134)
  test(tooling): preserve Node and terminal fixture ownership under Bun (#152187)
  fix(sqlite): service worker admission through retained path aliases (#152190)
  improve: reduce CPU work for long CLI reasoning streams (#152191)
  chore(ui): refresh control ui locales (#152196)
  test(subagents): align lifecycle retries with durable completion owners (#152184)
  perf(gateway): defer participant maps for owned sessions (#152097)
  refactor(stream): share auxiliary queue overflow handling (#149282)
  fix(test): execute CLI fixture preloads on Node and Bun (#152076)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 19, 2026
…rs (openclaw#152184)

Use isolated real persistence and load the existing model fixture before its consumer. Preserve cross-run output exclusion while proving a corrected same-run completion receipt. Reuse the existing lifecycle wait owner without changing timing or delivery assertions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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