Skip to content

feat(agents): ship CLI-parity built-in subagents to embedded SDK#36

Merged
aletc1 merged 1 commit into
devfrom
claude/festive-edison-70edd4
Apr 24, 2026
Merged

feat(agents): ship CLI-parity built-in subagents to embedded SDK#36
aletc1 merged 1 commit into
devfrom
claude/festive-edison-70edd4

Conversation

@aletc1
Copy link
Copy Markdown
Owner

@aletc1 aletc1 commented Apr 24, 2026

Claude running inside the app reports "Explore agent isn't available" because @anthropic-ai/claude-agent-sdk ships zero built-in subagents — Explore/Plan/general-purpose/statusline-setup/claude-code-guide are CLI-only. Seed them via options.agents so Claude inside 1Code gets parity with the CLI's Task tool.

  • New builtin-agents.ts with the five subagents. Read-only ones use disallowedTools (Edit, Write, NotebookEdit, ExitPlanMode) rather than a hand-curated allowlist, matching the CLI's "all tools except X" phrasing and avoiding SDK tool-name drift.
  • All built-ins omit the model field so they inherit the user's selected model rather than forcing Sonnet.
  • buildAgentsOption() seeds built-ins first, then overlays user/ project/plugin agents — user-defined files with the same name still override, matching CLI behavior.
  • Also forwards disallowedTools from parsed user .md agents to the SDK. This field was already parsed from frontmatter but silently dropped before reaching the SDK.

Ollama path unchanged (SDK options.agents isn't supported there).

Claude running inside the app reports "Explore agent isn't available"
because @anthropic-ai/claude-agent-sdk ships zero built-in subagents —
Explore/Plan/general-purpose/statusline-setup/claude-code-guide are
CLI-only. Seed them via options.agents so Claude inside 1Code gets
parity with the CLI's Task tool.

- New builtin-agents.ts with the five subagents. Read-only ones use
  disallowedTools (Edit, Write, NotebookEdit, ExitPlanMode) rather than
  a hand-curated allowlist, matching the CLI's "all tools except X"
  phrasing and avoiding SDK tool-name drift.
- All built-ins omit the model field so they inherit the user's
  selected model rather than forcing Sonnet.
- buildAgentsOption() seeds built-ins first, then overlays user/
  project/plugin agents — user-defined files with the same name still
  override, matching CLI behavior.
- Also forwards disallowedTools from parsed user .md agents to the
  SDK. This field was already parsed from frontmatter but silently
  dropped before reaching the SDK.

Ollama path unchanged (SDK options.agents isn't supported there).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@aletc1 aletc1 merged commit b8b7b64 into dev Apr 24, 2026
aletc1 added a commit that referenced this pull request Apr 24, 2026
#38)

The Agent SDK's CLI-parity built-in subagents (shipped in #36) can emit
the dispatch tool as either `Task` or `Agent`. The inline chat renderer
hard-coded `tool-Task`, so `tool-Agent` dispatches fell through to the
generic fallback that shows only the bare tool name with no description,
while the Tasks sidebar rendered correctly because it reads input by
shape. Result: the top row looked empty ("Agent" with no subtitle) even
though the subagent was running and nested child tools rendered fine.

- Add `isSubagentDispatchType()` helper; use it at the primary and
  orphan-group dispatch sites so `AgentTaskTool` handles both names.
- Harden the catch-all fallback to show `<ToolName> <summary>` via a
  shared `summarizeToolInput()` (extracted from tasks-widget so the two
  surfaces stay in sync).
- Bump `@anthropic-ai/claude-agent-sdk` 0.2.118 → 0.2.119 and the
  bundled CLI binary 2.1.118 → 2.1.119 (released in lockstep).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant