Handle Task(agent_type) tool name syntax from CLI v2.1.33 #114

Closed
opened 2026-02-06 16:13:09 -08:00 by hikari · 0 comments
Owner

Context

Claude Code CLI v2.1.33 introduced support for restricting which sub-agents can be spawned via Task(agent_type) syntax in agent "tools" frontmatter.

Problem

Our agent detection in wsl_bridge.rs uses exact string matching:

if name == "Task" {
    // emit agent-start event
}

and:

} else if tool_name == "Task" {
    CharacterState::Thinking
}

If the CLI starts sending Task(Explore) or Task(Plan) instead of plain Task, our agent tracking and character state detection will silently break — we won't detect subagent spawns or show the correct sprite.

Proposed Fix

Change the exact match to a prefix match:

  • name == "Task"name == "Task" || name.starts_with("Task(")
  • Same for the get_tool_state function

Alternatively, use name.starts_with("Task") but be careful of any future tool names that might start with "Task".

References

  • src-tauri/src/wsl_bridge.rs lines 812 and 1264
  • Claude Code CLI v2.1.33 release notes

This issue was created with help from Hikari~ 🌸

## Context Claude Code CLI v2.1.33 introduced support for restricting which sub-agents can be spawned via `Task(agent_type)` syntax in agent "tools" frontmatter. ## Problem Our agent detection in `wsl_bridge.rs` uses exact string matching: ```rust if name == "Task" { // emit agent-start event } ``` and: ```rust } else if tool_name == "Task" { CharacterState::Thinking } ``` If the CLI starts sending `Task(Explore)` or `Task(Plan)` instead of plain `Task`, our agent tracking and character state detection will silently break — we won't detect subagent spawns or show the correct sprite. ## Proposed Fix Change the exact match to a prefix match: - `name == "Task"` → `name == "Task" || name.starts_with("Task(")` - Same for the `get_tool_state` function Alternatively, use `name.starts_with("Task")` but be careful of any future tool names that might start with "Task". ## References - `src-tauri/src/wsl_bridge.rs` lines 812 and 1264 - Claude Code CLI v2.1.33 release notes --- ✨ This issue was created with help from Hikari~ 🌸
naomi closed this issue 2026-02-07 21:15:42 -08:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/hikari-desktop#114