Task tool (subagents) not displayed with special treatment in app
Summary
When Claude uses the Task tool to spawn subagents (for research, exploration, etc.), the app displays them as regular tool cards instead of with a special "Thinking: description..." display that would match the Mac CLI's visual treatment of background agents.
Current Behavior
Tasktool appears as a generic tool card with the robot icon- The tool input is shown as raw JSON (or parsed description)
- No visual indication that work is happening in the background
- No clear distinction from other tools like Read/Write/Bash
Expected Behavior
- Subagent invocations should show a distinctive UI:
- "Thinking: [task description]..." text
- The agent's prompt should be viewable (like thinking content)
- Visual indication of background activity
- Should match the
StreamUpdateType.subagenthandling that exists in the Dart code
Root Cause Analysis
The Dart code defines StreamUpdateType.subagent (in claude_tool_service.dart line 42), but the Rust engine only emits StreamUpdateType::ToolUse for all tool calls including Task.
The Rust parser (parser/types.rs) has no Subagent variant in its StreamUpdateType enum.
The _processStreamUpdate method in ssh_chat_screen.dart has a case StreamUpdateType.subagent: handler (lines 1999-2011) that would show the special display, but this code path is never reached because:
- Rust emits
ToolUseforTasktool _convertUpdateTypeinengine_session_adapter.dartmaps RustToolUse→ DarttoolUse- The Dart
subagenttype is never used
Proposed Fix Options
Option A: Client-side detection (simpler)
In _processStreamUpdate or _convertEvent, check if toolName == "Task" and convert to StreamUpdateType.subagent:
// In engine_session_adapter.dart _convertEvent()
case StreamUpdateType.toolUse:
final toolName = event.toolName ?? 'unknown';
if (toolName == 'Task') {
return ClaudeStreamUpdate(
type: StreamUpdateType.subagent, // Convert to subagent
content: ...,
metadata: {'description': input['description'], 'prompt': input['prompt']},
);
}
// ... normal toolUse handling
Option B: Rust-side (more comprehensive)
Add StreamUpdateType::Subagent to the Rust enum and detect Task tool in the parser, emitting the new type.
Related
This is related to the thinking display improvements - both are about showing Claude's internal processes more clearly to the user.
Files Affected
rust/src/parser/types.rs- StreamUpdateType enumlib/services/engine_session_adapter.dart- type conversionlib/screens/ssh_chat_screen.dart- existing subagent handler at line 1999
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗