Skip to content

fix: prevent sessions_yield completion wake freeze#87330

Open
adam-birddog wants to merge 1 commit into
openclaw:mainfrom
adam-birddog:fix/br-0593-sessions-yield-resume
Open

fix: prevent sessions_yield completion wake freeze#87330
adam-birddog wants to merge 1 commit into
openclaw:mainfrom
adam-birddog:fix/br-0593-sessions-yield-resume

Conversation

@adam-birddog

Copy link
Copy Markdown

Summary

  • Prefer direct requester-agent handoff for expected subagent completion messages so yielded parent sessions resume instead of being steered into an aborting active run.
  • Mark sessions_yield abort transitions as temporarily not accepting embedded messages, forcing completion delivery fallback instead of queueing into a stale active context.
  • Add focused regression coverage for completion handoff and yield-aborting run queue rejection.

Tests

  • pnpm exec vitest run src/agents/pi-embedded-runner/runs.test.ts src/agents/subagent-announce-delivery.test.ts
  • npx -y [email protected] format:check src/agents/pi-embedded-runner/run-state.ts src/agents/pi-embedded-runner/run/attempt.ts src/agents/pi-embedded-runner/runs.test.ts src/agents/pi-embedded-runner/runs.ts src/agents/subagent-announce-delivery.test.ts src/agents/subagent-announce-delivery.ts
  • npx -y [email protected] tsgo:core

BR-0593

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 27, 2026
@clawsweeper

clawsweeper Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 29, 2026, 7:51 AM ET / 11:51 UTC.

Summary
The PR adds a sessions_yield abort acceptance gate to the old embedded runner queue path and changes completion delivery tests to prefer direct requester-agent handoff before queued steering.

PR surface: Source +37, Tests +8. Total +45 across 6 files.

Reproducibility: yes. at source level, but not with live runtime proof yet: current main lacks the proposed sessions_yield abort acceptance gate, and the active completion path can still queue into an active requester before falling back.

Review metrics: 1 noteworthy metric.

  • Obsolete Runner Paths: 4 modified PR files target removed paths. The submitted queue guard cannot affect current main until it is ported from pi-embedded-runner to embedded-agent-runner.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🧂 unranked krab
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted real sessions_yield runtime or transport proof after the fix, with private details removed.
  • Port the queue guard to current embedded-agent-runner files and tests.
  • Explain how the handoff behavior composes with current active completion delivery ordering.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The external PR body lists tests only and does not include redacted after-fix runtime logs, terminal output, copied live output, screenshots, recordings, or linked artifacts showing the sessions_yield completion path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Mantis proof suggestion
A live transport transcript would materially verify that a yielded parent resumes once without duplicate, missed, or raw child completion delivery. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram live: run a sessions_yield parent/subagent completion and verify the yielded parent resumes with one visible parent reply and no duplicate or raw child completion text.

Risk before merge

  • [P1] The branch is currently conflicting and the runtime guard is implemented against deleted src/agents/pi-embedded-runner files rather than current src/agents/embedded-agent-runner files.
  • [P1] Real behavior proof is absent for the sessions_yield completion path after the patch.
  • [P1] The direct requester-agent handoff changes session ownership and message ordering semantics and overlaps newer canonical sessions_yield completion-delivery work.

Maintainer options:

  1. Port, Reconcile, And Prove (recommended)
    Port the queue-acceptance guard to current embedded-agent-runner files, explain how it composes with active completion delivery, and attach redacted after-fix runtime or transport proof.
  2. Accept Direct-Handoff Semantics
    Maintainers can intentionally accept the direct requester-agent handoff behavior, but should own the session-state and ordering contract before merge.
  3. Pause Behind Canonical Yield Work
    If newer sessions_yield completion PRs define the permanent contract first, keep this branch paused or replace it after that path lands.

Next step before merge

  • [P1] Contributor proof is missing and the branch is conflicting/obsolete, so this needs author or maintainer handling rather than an automated repair marker.

Security
Cleared: The diff changes agent runtime/tests only and does not introduce dependency, workflow, secret, package, install, or supply-chain changes.

Review findings

  • [P1] Port the queue guard to embedded-agent-runner — src/agents/pi-embedded-runner/run/attempt.ts:3748
Review details

Best possible solution:

Port any still-useful guard to current embedded-agent-runner paths, reconcile it with the active completion delivery contract, and require redacted real runtime or transport proof before merge.

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

Yes at source level, but not with live runtime proof yet: current main lacks the proposed sessions_yield abort acceptance gate, and the active completion path can still queue into an active requester before falling back.

Is this the best way to solve the issue?

No as submitted: the guard is on obsolete files and the direct-handoff semantics need maintainer agreement against the current delivery contract.

Full review comments:

  • [P1] Port the queue guard to embedded-agent-runner — src/agents/pi-embedded-runner/run/attempt.ts:3748
    Current main no longer has src/agents/pi-embedded-runner, so adding isAcceptingMessages only to that old handle cannot protect the current queue path. Please port the type, handle state, registry guard, and regression coverage to src/agents/embedded-agent-runner.
    Confidence: 0.95

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P1: The PR targets a yielded parent/subagent completion workflow that can freeze or misdeliver real agent-session work.
  • merge-risk: 🚨 session-state: The diff changes whether an active yielded requester session accepts queued completion input during the abort transition.
  • merge-risk: 🚨 message-delivery: The diff changes subagent completion delivery ordering and fallback behavior, which could drop, duplicate, or misroute completion output.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The external PR body lists tests only and does not include redacted after-fix runtime logs, terminal output, copied live output, screenshots, recordings, or linked artifacts showing the sessions_yield completion path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +37, Tests +8. Total +45 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 4 40 3 +37
Tests 2 78 70 +8
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 118 73 +45

What I checked:

  • Repository policy applied: Root AGENTS.md and scoped agent-runner AGENTS.md files were read fully and applied to the deep current-main, sibling-surface, proof, and merge-risk review. (AGENTS.md:1, db2488b6e3d6)
  • PR targets removed runner path: The submitted diff modifies four files under src/agents/pi-embedded-runner, while current main no longer has that tree. (f9a83962ad7e)
  • Current queue handle lacks acceptance probe: Current EmbeddedAgentQueueHandle has streaming, compacting, transcript-wait, cancel/abort, and source-reply mode fields, but no isAcceptingMessages equivalent for the sessions_yield abort transition. (src/agents/embedded-agent-runner/run-state.ts:19, db2488b6e3d6)
  • Current queue eligibility lacks the PR guard: Current prepareEmbeddedAgentQueueMessage rejects missing, non-streaming, compacting, transcript-wait-unsupported, and source-reply mismatched handles, but not a streaming run that is in the sessions_yield abort window. (src/agents/embedded-agent-runner/runs.ts:365, db2488b6e3d6)
  • Current yield callback has no abort-in-progress state: The current onYield callback records yield, queues the interrupt, aborts with sessions_yield, and aborts the session, but does not flip a queue-acceptance state like the PR proposes. (src/agents/embedded-agent-runner/run/attempt.ts:1347, db2488b6e3d6)
  • Active completion wake still queues active requesters: Current completion delivery still attempts resolveActiveWakeWithRetries for active completion requesters and reports path: "steered" when the queue outcome is accepted. (src/agents/subagent-announce-delivery.ts:1398, db2488b6e3d6)

Likely related people:

  • vincentkoc: Recent GitHub path history shows multiple current subagent completion handoff and embedded runner queue changes in the affected files. (role: recent area contributor; confidence: high; commits: 81eaa88ce56d, 68a1e00b73bd, 7fc4bbc0bcba; files: src/agents/embedded-agent-runner/runs.ts, src/agents/subagent-announce-delivery.ts)
  • steipete: Path history shows the split of subagent announce delivery helpers and prior work shaping the current delivery owner boundary. (role: feature-history contributor; confidence: medium; commits: b75be0914491; files: src/agents/subagent-announce-delivery.ts, src/agents/subagent-announce-dispatch.ts)
  • jriff: The cooperative sessions_yield tool involved in this wake/freeze path traces to the sessions_yield feature introduction. (role: introduced behavior; confidence: high; commits: 3fa91cd69d5d; files: src/agents/tools/sessions-yield-tool.ts)
  • joshavant: Prior commits changed subagent completion announce delivery timing and subagent DM completion delivery in the same delivery module. (role: prior delivery timing contributor; confidence: medium; commits: 903d9c13f3ee, 0896917e1ad9; files: src/agents/subagent-announce-delivery.ts, src/agents/subagent-announce-delivery.test.ts)
  • IWhatsskill: Recent embedded runner history includes transcript flush behavior around after-turn cleanup, adjacent to the sessions_yield abort/flush window. (role: recent adjacent contributor; confidence: medium; commits: 7ac8b48a08bf; files: src/agents/embedded-agent-runner/run/attempt.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels May 27, 2026
@clawsweeper

clawsweeper Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@BingqingLyu

This comment was marked as spam.

@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 29, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 15, 2026
@clawsweeper

clawsweeper Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

@adam-birddog thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward.

Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive.

Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added stale Marked as stale due to inactivity triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 14, 2026
@clawsweeper

clawsweeper Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix: prevent sessions_yield completion wake freeze This is item 1/1 in the current shard. Shard 2/25.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. 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: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants