Repository navigation
Description
Summary
On the Anthropic OAuth (subscription) route, format_tools unconditionally advertises the curated Claude-Code builtins, including Agent and Glob. But:
subagentwas removed from the registry in1e7bd9d1("remove deprecated subagent tool", in v0.56.0)- native
globwas removed in3d391a51("Remove redundant grep, glob, lsp, and codesearch native tools")
So the model is told Agent/Glob exist, calls them, and gets:
Error: Unknown tool: subagent. Available tools: agentgrep, apply_patch, bash, ...
Error: Unknown tool: glob. Available tools: agentgrep, apply_patch, bash, ...
Verified still present on latest master (28e476ac).
Impact
- Fable 5 / Opus on OAuth frequently attempt
Agentfan-out for parallel analysis, waste turns on errors, then silently degrade to inline bash/read/grep. Observed 11 sessions withUnknown tool: subagentand 6 withUnknown tool: globon one machine since v0.56.0. - Related to Batch subcalls fail with PascalCase tool names (Read, Bash) that work at top level #486 (same family: OAuth-advertised names vs registry reality), but this one is about advertising tools whose backing registry tool no longer exists at all, so no alias mapping can save it.
Root cause
crates/jcode-provider-anthropic/src/lib.rs format_tools(is_oauth=true): the curated builtin vec (Agent, Bash, Edit, Glob, Grep, Read, ScheduleWakeup, Skill, Write) is emitted unconditionally, then registry tools in OAUTH_BUILTIN_LOCAL_TOOLS are skipped. Nothing checks that the builtin's backing local tool is actually registered.
Reverse map: Agent -> subagent (provider-core/src/anthropic.rs), Glob -> glob -> registry miss -> "Unknown tool".
Fix
Gate each curated builtin on its backing registry tool(s): only advertise Agent when subagent is registered, Glob when glob is registered, Grep when grep or agentgrep is registered, etc. Patch + regression tests available (see branch fix/oauth-ghost-builtin-tools, commit vietgs03/jcode@44440ccd):
oauth_format_tools_drops_builtins_missing_from_registry: registry without subagent/glob must not advertise Agent/Glob- updated
oauth_format_tools_keeps_full_custom_toolsetto register backing tools explicitly
cargo test -p jcode-provider-anthropic: 8 passed.
Happy to open a PR if this repo accepts them, otherwise feel free to take the patch.
Environment
- jcode v0.56.0 (9aa8c5a), Linux x86_64
- Provider: Anthropic OAuth (subscription), claude-fable-5 / claude-opus-4-8
Activity
1jehuang commentedon Jul 24, 2026
Confirmed and fixed.
format_tools(is_oauth=true)now gates each curated Claude-Code builtin on its backing registry tool, soAgentandGlobare no longer advertised whensubagent/globare absent from the registry. Added the regression testoauth_format_tools_drops_builtins_missing_from_registry(cargo test -p jcode-provider-anthropic: 8 passed). Thanks for the precise root-cause pointer.— Jcode agent (automated triage), on behalf of @1jehuang
1jehuang commentedon Jul 24, 2026
Note: the fix is committed on branch
triage/2026-07-24-batch(pushed). GitHub's pull-request creation API is currently returning 500s repo-wide, so the PR link will follow once that clears.— Jcode agent (automated triage), on behalf of @1jehuang
1jehuang commentedon Jul 24, 2026
GitHub's PR API recovered: the fix is now in #580.
— Jcode agent (automated triage), on behalf of @1jehuang
fix(anthropic): stop advertising OAuth builtins without backing regis…
fix(anthropic): stop advertising OAuth builtins without backing regis…
fix(anthropic): stop advertising OAuth builtins without backing regis…
fix(anthropic): stop advertising OAuth builtins without backing regis…