[Bug] Task tool: subagent_type parameter arrives as 'undefined' in VSCode extension 2.1.42

Resolved 💬 3 comments Opened Feb 16, 2026 by alkari Closed Mar 21, 2026

Summary

The Task tool's subagent_type parameter is not being read from tool call parameters in the VSCode extension. Every Task tool invocation fails with Agent type 'undefined' not found regardless of which agent type is specified. The error message lists the available agents correctly, confirming the agent infrastructure works — only the parameter deserialization is broken.

Environment

| Property | Value |
|----------|-------|
| VSCode Extension | anthropic.claude-code v2.1.42 (linux-arm64) |
| CLI Version | 2.1.44 |
| OS | Linux 6.14.0-1015-nvidia (arm64) |
| VSCode | Remote SSH (vscode-server) |
| Model | Claude Opus 4.6 |

Steps to Reproduce

  1. Open any project in VSCode with Claude Code extension 2.1.42
  2. Ask Claude to use the Task tool with any subagent type
  3. Observe the error

Error (100% reproducible across ALL agent types)

Agent type 'undefined' not found. Available agents: Bash, general-purpose, statusline-setup, Explore, Plan, claude-code-guide

Tested with every available agent type — all fail identically:

  • BashAgent type 'undefined' not found
  • general-purposeAgent type 'undefined' not found
  • ExploreAgent type 'undefined' not found
  • PlanAgent type 'undefined' not found
  • claude-code-guideAgent type 'undefined' not found

Key Observation

The error says 'undefined' (JavaScript undefined), NOT the agent type string being passed. This means the subagent_type parameter value is being lost during deserialization in the VSCode extension's Task tool handler. The model is sending the correct parameter, but the extension handler receives undefined.

Difference from Related Issues

This is NOT the classifyHandoffIfNeeded is not defined error from #22087/#23307. Those bugs occur during agent completion/handoff. This bug occurs at dispatch time — the agent never even starts. The subagent_type parameter is dropped before the agent is spawned.

Attempted Fixes (None Worked)

  1. claude update — Updated CLI from 2.1.34 to 2.1.44. Extension stayed at 2.1.42. Bug persists.
  2. code --uninstall-extension anthropic.claude-code then code --install-extension anthropic.claude-code --force — Reinstalled same 2.1.42 (latest on marketplace). Bug persists.
  3. VSCode window reload — Bug persists.

Impact

  • Severity: High — completely blocks Task tool / subagent usage
  • Workaround: Perform all work directly in the main context (no parallelization via subagents)
  • Frequency: 100% — every single Task call fails

Related Issues

  • #22087 — classifyHandoffIfNeeded (different error, closed, fix coming in next release per @ashwin-ant)
  • #23307 — Built-in agents affected by classifyHandoffIfNeeded (different error)
  • Note: This may be a separate symptom of the same underlying bug, or a distinct parameter deserialization issue in the VSCode extension layer

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗