-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
ACP parent session stuck until refresh when yielded waiting for child completion #52249
Copy link
Copy link
Open
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
When an ACP child session completes while a parent session is yielded waiting for the result, the parent session remains stuck/non-responsive until the user manually refreshes the UI.
Root cause: The ACP parent-stream relay was using transcript inspection (
isYieldedParentAwaitingResume()) and direct gateway re-entry (resumeYieldedParent()) instead of the normal system-event + heartbeat wake path. This ad-hoc resumption path can leave parent session state wedged.Steps to Reproduce
sessions_spawn({ runtime: "acp", agentId: "codex", task: "..." })sessions_yield()Expected Behavior
Parent session automatically resumes when child completes, without manual intervention.
Root Cause
In
src/acp/parent-stream-relay.ts(compiled todist/auth-profiles-CCgh0vEZ.js):The
emitOrResume(...)helper was doing:This transcript-sniffing + direct-re-entry approach bypasses the normal session wake scheduler, causing state inconsistency.
The Fix Applied
We deployed a Phase A stabilization patch that changed the relay to:
This forces all ACP completion follow-ups back onto the existing system-event + heartbeat wake path.
Files Affected
src/acp/parent-stream-relay.ts(source)dist/auth-profiles-CCgh0vEZ.js(compiled, where patch was applied)Workaround Status
Phase A patch deployed locally. Tests show parent now auto-resumes on child completion (without manual refresh), but relies on heartbeat wake machinery rather than dedicated yield-resume path.
This is a stabilization patch. The proper long-term fix is:
Proper Fix (Phase B)
Implement explicit
yieldWaitstate tracking in the runtime:sessions_yieldis calledParentYieldWaitLifecycleEventon child completionresumeAcpYieldWaitingParent()path (code already exists but unused)System Information
Impact
Severity: High
Current Status
Phase A patch has been applied and partially tested. Parent auto-resume now works, but the architecture still couples to heartbeat wake machinery rather than having proper yield-resume semantics.
Full proper fix requires implementing the Phase B architecture with explicit yield-wait state and lifecycle events.