Skip to content

fix(parser): treat Agent tool as subagent spawn (Task renamed in CC 2.1.63) - #238

Open
axisrow wants to merge 1 commit into
matt1398:mainfrom
axisrow:fix/agent-tool-rename
Open

axisrow wants to merge 1 commit into
matt1398:mainfrom
axisrow:fix/agent-tool-rename

Conversation

@axisrow

@axisrow axisrow commented Sep 21, 2026 •

Copy link
Copy Markdown

Fixes #237

Summary

Claude Code 2.1.63 renamed the subagent-spawning tool from Task to Agent (docs: "In version 2.1.63, the Task tool was renamed to Agent"). The settings alias keeps old Task(...) references working, but session JSONL records the new name — so extractToolCalls marked zero subagent spawns in modern sessions, silently dropping task descriptions and breaking ProcessLinker linking.

The fix accepts both names. The input schema (description, prompt, subagent_type) is unchanged per docs, so the existing extraction right below the changed line works as-is. The subagents/agent-{id}.jsonl transcript layout is already handled by SubagentLocator.

Validation checklist

  • pnpm typecheck
  • pnpm lint (0 errors)
  • pnpm test (724 passed, +2 new: Agent-named blocks extract isTask/taskDescription/taskSubagentType; legacy Task unchanged; regular tools stay non-task)
  • Verified against a real modern session: 11 Agent blocks, 0 Task — after the fix all spawn links resolve

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Recognize both the current Agent tool name and the legacy Task name as subagent calls.
    • Preserve descriptions and subagent types for recognized calls.
    • Continue treating regular tools, such as Bash, as non-task calls.

….1.63)

Claude Code 2.1.63 renamed the Task tool to Agent (docs:
code.claude.com/docs/en/sub-agents.md). Session JSONL now records
"Agent" tool_use blocks, which the parser ignored — subagent spawns
lost task descriptions and ProcessLinker could not link them.

Accept both names; the input schema (description, prompt,
subagent_type) is unchanged.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@coderabbitai coderabbitai Bot added bug Something isn't working documentation Improvements or additions to documentation labels Sep 21, 2026
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: e32d655f-decf-454b-9fea-27ec88947cc0

📥 Commits

Reviewing files that changed from the base of the PR and between 16cc3c8 and 5c8af3e.

📒 Files selected for processing (2)
  • src/main/utils/toolExtraction.ts
  • test/main/utils/toolExtraction.test.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Subagent tool recognition

Layer / File(s) Summary
Parser recognition and validation
src/main/utils/toolExtraction.ts, test/main/utils/toolExtraction.test.ts
extractToolCalls now treats Agent and Task blocks as subagent calls. Tests verify task metadata for both names and confirm that Bash remains a regular tool.

Suggested labels: bug, documentation

Priority: ➖ Normal

Change: Bug fix · Severity of issue fixed: Medium

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The change satisfies #237. extractToolCalls marks both Task and Agent tool uses as task calls. It preserves the complete input, including description, prompt, and subagent_type, and extr…
Out of Scope Changes check ✅ Passed The change is limited to src/main/utils/toolExtraction.ts and its focused test file. It does not alter TaskCreate, TaskUpdate, TaskOutput, or subagents/agent-{id}.jsonl handling. The added t…

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parser misses subagent spawns: Task tool renamed to Agent in Claude Code 2.1.63

1 participant