Skip to content

fix(subagents): find a resumed worker by its spawn or run ID - #208254

Merged
freeqaz-openai merged 2 commits into
mainfrom
fix/subagent-id-after-yield
Nov 29, 2026
Merged

freeqaz-openai merged 2 commits into
mainfrom
fix/subagent-id-after-yield

Conversation

@freeqaz-openai

@freeqaz-openai freeqaz-openai commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A worker can yield and resume the same task under a new run ID. After delivery, /subagents info rejected the ID from sessions_spawn and the current ID shown under Run. Looking up the full Session key worked.

User Impact

Use either full ID to inspect the resumed worker with /subagents info or /subagents log. This helps the parent check delivery before retrying work. There is no new permission or configuration.

Why This Change Was Made

The current ID can contain colons. The command treated it exclusively as a session key. The registry also keeps the original spawn ID in taskRunId. Look for both IDs in the same list of visible workers. Keep session keys, labels and numeric selectors working as before. Require the full task ID and refuse ambiguous matches.

Evidence

Update after the identity check

The first head (955a3221) added three direct ID comparisons. Both CI and the local session-identity check flagged them. The current head (422129a3) treats the two IDs as command aliases for each entry in the existing visible list. Both lookup paths share that logic. The selected record still addresses a child by session key. The resolver makes no decision about whether an execution or a writer owns that session. The identity checker and its allowlist are unchanged.

On the updated code, the same identity check, the 29 lookup tests (91.21 seconds including startup), 19 command tests, formatting and focused type-aware lint passed. The packaged trials below used the first head.

Packaged comparison at 955a3221

I started a goal in an isolated Gateway using Codex CLI 0.164.0 and scripted inference. The parent spawned a worker, which spawned a child to read a unique value. Both callers yielded. The worker resumed under a different run ID and passed the result back to the parent.

Target of the parent's info command after delivery Before After
Original spawn ID Unknown subagent ID Done, delivered
Current run ID Unknown subagent session Done, delivered
Full session key Done, delivered Done, delivered

The two packaged builds used OpenClaw 67f29364 with the same downstream runtime patches. The only additional change in the second build was the first head of this PR. The two edited files had identical preimages there and on the PR base. Seven status commands per run made zero model calls. Each run had one file read. Automatic goal continuation is a separate bug.

On the PR base, three lookup regressions failed without the fix. With the fix, pnpm test src/auto-reply/reply/subagents-utils.test.ts --maxWorkers=1 passed 29/29 in 87.46 seconds including a cold compiler build. The command suite passed 19/19. Formatting and type-aware lint passed after I restored the lint plugin mount in the isolated runner. The packaged comparison exercised the info command. Log uses the same resolver.

@clawsweeper

clawsweeper Bot commented Nov 29, 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.

View the workflow run.

@freeqaz-openai
freeqaz-openai marked this pull request as ready for review November 29, 2026 10:55
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 29, 2026
@clawsweeper

clawsweeper Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This PR lets subagent info and log commands find a resumed worker by its original spawn ID or current run ID.

Example: A worker spawned as 3bc6a5a4-a50a-4a47-aede-bd121eae811f resumes as announce:requester-settle:main:agent:main:subagent:example:leaf:yield-1.

  • Before: /subagents info rejects either ID, although the full session key works.
  • After: Either full ID selects the latest visible worker.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, worthwhile repair with packaged behavior evidence, distinct regression coverage and passing exact-head checks.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The body records before/after info-command output through an isolated packaged Gateway after nested yield/resume, with session-key lookup as a control; this exercised the first head, whose matching behavior is preserved by the reviewed refactor, while log shares the resolver but was not separately exercised.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: After a worker resumes, users cannot inspect it using its spawn receipt ID or the current run ID displayed by the product.
Reason: Restoring existing inspection commands has clear user value and adds no configuration, permissions, persistence or competing owner.

Merge readiness

✅ Ready for maintainer review

Keep this PR open for landing: it fixes a current lookup defect, resolves the earlier ratchet failure, and has no remaining actionable findings.

Reviewed head: 422129a31f6212ee40b2cc6761d24bb70bb13974

Before merge

None.

Findings

None.

Agent review details

How this fits together

The shared command resolver receives a session-scoped worker view and selector, then returns a registry record for info display or session-key-based transcript retrieval.

flowchart LR
  A[Subagent command] --> B[Scoped worker snapshot]
  B --> C[Shared selector resolver]
  C --> D[Info reader]
  C --> E[Transcript reader]
  D --> F[Command reply]
  E --> F
Loading

Technical review

Best possible solution:

Land the shared alias lookup while retaining the existing visibility, ordering, ambiguity and session-key contracts.

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

Current-main lookup and registry replacement code establish both rejection paths, supported by the author's packaged-Gateway comparison; this review executed no target code.

Is this the best way to solve the issue?

The change repairs the existing resolver directly, reuses registry-owned task identity, and leaves authorization and transcript addressing with their existing owners.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7c0080f09ee2.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +6, Tests +22. Total +28 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 16 10 +6
Tests 1 22 0 +22
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 38 10 +28

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-29T11:11:44.739Z sha 955a322 :: needs changes before merge. :: [P2] Reconcile the new ID comparisons with the session-identity ratchet

Reviewed November 29, 2026, 6:36 AM ET / 11:36 UTC (Revision 2).

@freeqaz-openai

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 29, 2026
@freeqaz-openai
freeqaz-openai merged commit 51ce8ed into main Nov 29, 2026
123 of 125 checks passed
@freeqaz-openai
freeqaz-openai deleted the fix/subagent-id-after-yield branch November 29, 2026 11:39
@freeqaz-openai

Copy link
Copy Markdown
Contributor Author

Merged via squash.

tideclaw-bot pushed a commit that referenced this pull request Nov 29, 2026
* fix(subagents): find a resumed worker by its spawn or run ID

* refactor(subagents): share the read-only command alias lookup

Follow-up scan: 34d4f8f improve: list Docker streams and flag unconfirmed cleanup in Doctor (#201292); 21786f6 refactor(ui): stop sending 28 additional unused labels to translators (#207982); 9cec330 refactor(workboard): group session tiles without rescanning each column (#207380); 16a2d4b refactor(ui): lowercase log search text only once (#207383). Other hits are not required by this focused beta.2 fix.

(cherry picked from commit 51ce8ed)

Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 30, 2026
…w#208254)

* fix(subagents): find a resumed worker by its spawn or run ID

* refactor(subagents): share the read-only command alias lookup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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