Skip to content

Settle forked-skill subagents from their own transcript - #48

Merged
calvintvu merged 2 commits into
mainfrom
cvu/forked-skill-agent
Aug 10, 2026
Merged

Settle forked-skill subagents from their own transcript#48
calvintvu merged 2 commits into
mainfrom
cvu/forked-skill-agent

Conversation

@calvintvu

@calvintvu calvintvu commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Context

A subagent kept the running badge after its session closed. The subagent came from a forked skill, for example /code-review. No tool call spawns a forked skill, so its meta.json carries no toolUseId. subagentStatus matched that empty key against the completed tool results of the parent, and the match never succeeded.

Changes

  • When its own transcript is complete, a forked-skill subagent now reads returned. Before this change it read running forever.
  • The fallback needs an empty spawn key. A normal Task subagent keeps the tool-result path, which stays authoritative. That path settles a child only after the parent writes the tool result, so a child mid-handoff never flickers to returned.
  • InTurn is the signal, and it already clears on a terminal stop_reason (claude/parse.go:275). The fix reads a value the parser produces today and adds no new parsing.
  • Note: the digest gap remains. linkSpawnDigest still logs has no spawn row in the parent transcript for a forked skill, so the subagent shows in the rail with no turn anchor.

Test

  • go vet ./... — passed
  • go test ./... — passed
  • Manual: List(0) over the local transcripts. Subagent agent-a5101e8ad9c72bdc6 in session cebc97ec reads returned. It read running before the fix.

Screenshots

with session closed
before
Screenshot 2026-08-06 at 18 03 50

after
Screenshot 2026-08-06 at 18 04 05

@calvintvu calvintvu added the bug Something isn't working label Aug 7, 2026
Comment thread collector/internal/collector/helpers.go Outdated
@calvintvu
calvintvu merged commit b910799 into main Aug 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants