Skip to content

OAuth route advertises ghost builtins Agent/Glob after subagent/glob removal, causing "Unknown tool: subagent/glob" errors #572

Closed

Description

@vietgs03

Summary

On the Anthropic OAuth (subscription) route, format_tools unconditionally advertises the curated Claude-Code builtins, including Agent and Glob. But:

  • subagent was removed from the registry in 1e7bd9d1 ("remove deprecated subagent tool", in v0.56.0)
  • native glob was removed in 3d391a51 ("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 Agent fan-out for parallel analysis, waste turns on errors, then silently degrade to inline bash/read/grep. Observed 11 sessions with Unknown tool: subagent and 6 with Unknown tool: glob on 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_toolset to 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

  1. added
    bug
    priority: high
    triage: reproducible
    autonomous: clear
    on Jul 24, 2026
  2. 1jehuang commented on Jul 24, 2026

    @1jehuang
    Owner

    Confirmed and fixed. format_tools(is_oauth=true) now gates each curated Claude-Code builtin on its backing registry tool, so Agent and Glob are no longer advertised when subagent/glob are absent from the registry. Added the regression test oauth_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

  3. 1jehuang commented on Jul 24, 2026

    @1jehuang
    Owner

    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

  4. 1jehuang commented on Jul 24, 2026

    @1jehuang
    Owner

    GitHub's PR API recovered: the fix is now in #580.


    — Jcode agent (automated triage), on behalf of @1jehuang

  5. added a commit that references this issue on Jul 24, 2026
    5dc603d
  6. added 2 commits that reference this issue on Aug 30, 2026
    08185e3
    9171996
  7. added a commit that references this issue on Sep 18, 2026
    32f1e2e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    autonomous: clearbugpriority: hightriage: reproducible

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions