Skip to content

fix(agents): resume yielded requesters after visible spawns - #128096

Merged
steipete merged 1 commit into
mainfrom
steipete/zealous-cartwright-fe1a7d
Aug 23, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/zealous-cartwright-fe1a7d

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where a requester that spawned a durable visible session and then called sessions_yield could be told that no pending child completion belonged to its turn. The visible child was omitted from requester settlement, so its result could not participate in the resumed final synthesis.

Why This Change Was Made

Visible session registration now preserves the same exact admitted requester-turn identity already carried by native and ACP child spawns. The registry's existing exact-owner matching, yield settlement, and duplicate-delivery protections remain unchanged.

User Impact

Requesters can yield after spawning a visible dashboard session and receive one synthesized final answer when that child finishes, without duplicate delivery from replayed terminal events.

Evidence

  • Pre-fix focused regression failed with: No pending child completion is owned by this turn.
  • OPENCLAW_E2E_SKIP_BUILD=1 node scripts/run-vitest.mjs src/agents/subagents/registry/subagent-registry.lifecycle-retry-grace.e2e.test.ts
  • node scripts/run-vitest.mjs src/agents/tools/sessions-spawn-tool.test.ts
  • node scripts/check-changed.mjs -- src/agents/tools/sessions-spawn-visible.ts src/agents/tools/sessions-spawn-tool.test.ts src/agents/subagents/registry/subagent-registry.lifecycle-retry-grace.e2e.test.ts
  • Fresh autoreview: no accepted/actionable findings.

AI-assisted: yes. The implementation and tests were inspected and verified by the maintainer.

@clawsweeper

clawsweeper Bot commented Aug 23, 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 agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Aug 23, 2026
@steipete
steipete marked this pull request as ready for review August 23, 2026 03:35
@steipete steipete self-assigned this Aug 23, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. 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 Aug 23, 2026
@clawsweeper

clawsweeper Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 22, 2026, 11:41 PM ET / August 23, 2026, 03:41 UTC.

ClawSweeper review

What this changes

The PR forwards the active requester-turn ID into visible-session registration so a yielded requester can receive the visible child’s final result exactly once.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open: this is a source-confirmed lifecycle repair with no blocking correctness or security finding. The protected maintainer label and incomplete exact-head checks require normal maintainer handling.

Priority: P1
Reviewed head: 2d0bbeb46381f1bf790125e12df5c480b2730c28

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with strong regression coverage; real gateway/dashboard evidence would reduce the remaining lifecycle-path uncertainty.
Proof confidence 🌊 off-meta tidepool Not applicable: Not applicable to this maintainer-authored PR; its focused lifecycle tests are supplemental, while an isolated gateway/dashboard run would still strengthen merge confidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Not applicable to this maintainer-authored PR; its focused lifecycle tests are supplemental, while an isolated gateway/dashboard run would still strengthen merge confidence.
Evidence reviewed 6 items Current-main defect: The tool factory supplies the active run ID as requester-turn identity, but current main’s visible registration omits it before creating the registry record.
Caller and registry contract: The tool factory supplies options.runId, and registration retains it only for completion-bearing children—the same contract needed by yield settlement.
Owner-boundary repair: The PR adds the already-prepared requester-turn identity at visible-run registration, rather than adding downstream matching or fallback logic.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw --help

Result: PASS (completed)

runner@runnervm76f27:/tmp/clawsweeper-live-proof-128096-cBQmRA/target$ pnpm openclaw --help
$ node scripts/run-node.mjs --help
pnpm openclaw --help
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 96.54 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.7s
node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

[tsdown-build] invocation 2/2 finished in 13.3s
[plugin-control-plane-loads] verified 35 built modules with native require and checked doctor closures
runtime-postbuild: 11 phases completed in 4070ms (slowest: built plugin control-plane loads 3360ms)

OpenClaw 2026.8.1 (2d0bbeb) — All your chats, one OpenClaw.

Usage: openclaw [options] [command]

Options:
  --container ‹name›   Run the CLI inside a running Podman/Docker container named ‹name› (default: env OPENCLAW_CONTAINER)
  --dev                Dev profile: isolate state under ~/.openclaw-dev, default gateway port 19001, and shift derived ports (browser/canvas)
  -h, --help           Display help for command
  --log-level ‹level›  Global log level override for file + console (silent|fatal|error|w
… output truncated …

Assertions:

  • PASS expect_output: Usage: openclaw [options] [command]

How this fits together

Visible sessions are durable dashboard child runs created by the agent’s session-spawn tool. Their terminal events enter the subagent registry, which matches them to the requester turn and schedules a resumed final response.

flowchart LR
  A[Requester turn] --> B[Visible session spawn]
  B --> C[Subagent registry]
  C --> D[Yield settlement]
  D --> E[Child terminal event]
  E --> F[Requester final response]
Loading

Before merge

  • Resolve merge risk (P1) - The PR has focused mocked lifecycle coverage but no isolated gateway/dashboard run demonstrating visible spawn, yield, and one resumed final response.
  • Complete next step (P2) - Await isolated real-flow evidence and green exact-head checks; no mechanical repair is indicated.
Agent review details

Security

None.

PR surface

Source +2, Tests +96. Total +98 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 2 0 +2
Tests 2 96 0 +96
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 98 0 +98

Review metrics

Metric Value Why it matters
Production versus regression-test LOC production +2, tests +96 The production change only carries existing requester-turn state into the visible registration owner; the test growth covers settlement and replay behavior.

Stored data model

Persistent data-model change detected: serialized state: src/agents/tools/sessions-spawn-visible.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Capture the real lifecycle flow (recommended)
    Run an isolated gateway/dashboard flow that visibly spawns, yields, and resumes one requester response before merging.
  2. Accept focused harness evidence
    Merge based on the lifecycle regression coverage while explicitly accepting that dashboard-path proof has not been recorded.

Technical review

Best possible solution:

Retain the two-line registration-boundary propagation and land after an isolated real-flow proof confirms one requester final response without replay duplication.

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

Yes, at source level: current main supplies the requester run ID to the spawn tool but visible registration drops it, so exact yield ownership finds no child. The focused test was not executed during this read-only review.

Is this the best way to solve the issue?

Yes: forwarding the already-prepared identity at the registration owner matches native and ACP siblings and avoids a downstream ownership workaround.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against e22d45051c0c.

Labels

Label changes:

  • add P1: A yielded requester can otherwise be denied completion for a visible child workflow.
  • add merge-risk: 🚨 session-state: The change associates a durable child completion with a specific requester turn, and the real gateway/dashboard path remains unrecorded.
  • 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: Not applicable to this maintainer-authored PR; its focused lifecycle tests are supplemental, while an isolated gateway/dashboard run would still strengthen merge confidence.

Label justifications:

  • P1: A yielded requester can otherwise be denied completion for a visible child workflow.
  • merge-risk: 🚨 session-state: The change associates a durable child completion with a specific requester turn, and the real gateway/dashboard path remains unrecorded.
  • 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: Not applicable to this maintainer-authored PR; its focused lifecycle tests are supplemental, while an isolated gateway/dashboard run would still strengthen merge confidence.

Evidence

What I checked:

Likely related people:

  • steipete: Recent history includes durable visible-session and multi-agent ownership work directly adjacent to this flow. (role: recent visible-session and ownership contributor; confidence: high; commits: 8c3b3c6ea8d3, f2158a9c3683, 1ca60fbc3a3f; files: src/agents/tools/sessions-spawn-visible.ts, src/agents/subagents/registry/subagent-registry-run-launch.ts)
  • Vyctor H. Brzezowski: Base blame attributes the registration shape that lacked requester-turn propagation to the visible-session introduction commit. (role: visible-registration introducer; confidence: high; commits: 70c2be7e6aab; files: src/agents/tools/sessions-spawn-visible.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Capture an isolated visible-session spawn → yield → single resumed-final trace, with private data redacted.

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 91fb032 into main Aug 23, 2026
306 checks passed
@steipete
steipete deleted the steipete/zealous-cartwright-fe1a7d branch August 23, 2026 03:54
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete

Copy link
Copy Markdown
Contributor Author

Post-merge ClawSweeper follow-up: the review finalized during the merge window. The optional Rank-up move to capture an isolated dashboard trace was intentionally skipped.

This is not a schema or migration change; it populates the existing requesterTurnRunId field at the visible registration owner. We accepted ClawSweeper's maintainer option 2 because the pre-fix behavioral failure, real visible adapter/registry/sessions_yield/settlement/lifecycle regression, duplicate terminal-event suppression, exact-head CI, and native prepare gate prove the bounded repair. No external provider or channel contract changed.

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 merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. 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