Skip to content

fix(subagents): hand quiet interrupted children to revisionless requesters - #175278

Merged
RomneyDa merged 1 commit into
mainfrom
fix/subagent-revisionless-requester-handoff
Oct 17, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/subagent-revisionless-requester-handoff

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

What Problem This Solves

A non-announcing subagent (expectsCompletionMessage: false) interrupted by a Gateway restart is marked interrupted, but its parent never gets the reconcile turn when the parent session has no lifecycle revision. Sessions created directly by the agent RPC (no sessions.create / chat.send) never receive one, so the child's work is silently dropped until a user asks. After three unclean restarts in five minutes the restart-loop breaker adds up to five minutes of delay before the same silent outcome.

This fails test/gateway-subagent-restart.live.test.ts (Native live test harnesses), a 2026.10.5 release blocker; main has the same gate and the same live assertion.

Why This Change Was Made

The quiet-completion handoff required both completionRequesterSessionId and completionRequesterLifecycleRevision. Every later requester identity check compares the revision by equality, so an absent revision binds as absent, and a reset assigns a new revision, which still rejects a replaced requester. Private spawn already requires only a session id. Drop the revision requirement at this one gate.

User Impact

Interrupted quiet subagents now hand their unfinished work back to the parent after restart recovery regardless of how the parent session was created. No change for sessions that already carry a lifecycle revision.

Evidence

Deterministic repro (scratch copy of the subagent-restart e2e twin with SIGKILL restarts):

run parent start warm-up kills orphan settled parent reconcile
before chat.send 2 (breaker trips) 319.3s, wake armed 320.3s
before agent 2 318.1s, no target never (failed at 440s)
before agent 0 15.2s, no target never (failed after 90s)
after agent 0 13.8s, wake armed 14.7s
after agent 2 321.7s 322.6s
  • New regression case in subagent-registry-lifecycle.test.ts (requester with and without a revision); the revisionless case fails before the fix.
  • pnpm test src/agents/subagents/registry/subagent-registry-lifecycle.test.ts --maxWorkers=1: 238 passed on main (243 on the release line, ~36s).
  • Also passing on the release line: subagent-registry-restart-recovery, requester-settle-restart, completion-runtime, spawn.requester-incarnation.

…sters

The #169144 backport converts a non-announcing child interrupted by a
Gateway restart into a private parent continuation only when the captured
requester has both a session id and a lifecycle revision. Sessions created
implicitly by the `agent` RPC (and other paths that never patch a new
session) carry no lifecycle revision, so the orphan settled terminal with
no completionTarget or requester settle wake and the parent never received
the "Reconcile every listed unfinished child" turn.

Every downstream requester identity check already compares the captured
revision by equality (absent matches absent, and a reset assigns a new
revision), and private spawn only requires a requester session id. Apply
the same requirement here.

The native live subagent restart proof starts its parents through `agent`,
which is why its parent-handoff assertion timed out; the crash-loop breaker
only delayed settlement. A quiet-child e2e twin started via `agent` failed
with and without the breaker before this change and receives the parent
reconcile turn within a second of settlement after it.
@clawsweeper

clawsweeper Bot commented Oct 17, 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: XS labels Oct 17, 2026
@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. labels Oct 17, 2026
@RomneyDa
RomneyDa merged commit 8d4591a into main Oct 17, 2026
121 checks passed
@RomneyDa
RomneyDa deleted the fix/subagent-revisionless-requester-handoff branch October 17, 2026 07:18
RomneyDa added a commit that referenced this pull request Oct 17, 2026
…sters (#175278)

The #169144 backport converts a non-announcing child interrupted by a
Gateway restart into a private parent continuation only when the captured
requester has both a session id and a lifecycle revision. Sessions created
implicitly by the `agent` RPC (and other paths that never patch a new
session) carry no lifecycle revision, so the orphan settled terminal with
no completionTarget or requester settle wake and the parent never received
the "Reconcile every listed unfinished child" turn.

Every downstream requester identity check already compares the captured
revision by equality (absent matches absent, and a reset assigns a new
revision), and private spawn only requires a requester session id. Apply
the same requirement here.

The native live subagent restart proof starts its parents through `agent`,
which is why its parent-handoff assertion timed out; the crash-loop breaker
only delayed settlement. A quiet-child e2e twin started via `agent` failed
with and without the breaker before this change and receives the parent
reconcile turn within a second of settlement after it.

(cherry picked from commit 8d4591a)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 18, 2026
…sters (openclaw#175278)

The openclaw#169144 backport converts a non-announcing child interrupted by a
Gateway restart into a private parent continuation only when the captured
requester has both a session id and a lifecycle revision. Sessions created
implicitly by the `agent` RPC (and other paths that never patch a new
session) carry no lifecycle revision, so the orphan settled terminal with
no completionTarget or requester settle wake and the parent never received
the "Reconcile every listed unfinished child" turn.

Every downstream requester identity check already compares the captured
revision by equality (absent matches absent, and a reset assigns a new
revision), and private spawn only requires a requester session id. Apply
the same requirement here.

The native live subagent restart proof starts its parents through `agent`,
which is why its parent-handoff assertion timed out; the crash-loop breaker
only delayed settlement. A quiet-child e2e twin started via `agent` failed
with and without the breaker before this change and receives the parent
reconcile turn within a second of settlement after it.
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Oct 22, 2026
RomneyDa added a commit that referenced this pull request Oct 27, 2026
…sters (#175278)

The #169144 backport converts a non-announcing child interrupted by a
Gateway restart into a private parent continuation only when the captured
requester has both a session id and a lifecycle revision. Sessions created
implicitly by the `agent` RPC (and other paths that never patch a new
session) carry no lifecycle revision, so the orphan settled terminal with
no completionTarget or requester settle wake and the parent never received
the "Reconcile every listed unfinished child" turn.

Every downstream requester identity check already compares the captured
revision by equality (absent matches absent, and a reset assigns a new
revision), and private spawn only requires a requester session id. Apply
the same requirement here.

The native live subagent restart proof starts its parents through `agent`,
which is why its parent-handoff assertion timed out; the crash-loop breaker
only delayed settlement. A quiet-child e2e twin started via `agent` failed
with and without the breaker before this change and receives the parent
reconcile turn within a second of settlement after it.

(cherry picked from commit 8d4591a)
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-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant