Skip to content

Tool definitions sent to models that cannot call tools (Vertex Gemini image models reject every request) #41464

Closed as not planned

Description

@IngTian

Bug

Tool definitions are sent to models that can't call tools, so providers that reject function calling fail every request.

Vertex Gemini image models (gemini-2.5-flash-image) return:

Unable to submit request because the model does not support function calling.

Cause

capabilities.toolcall is set from provider config (provider.ts:1236) but never read when building a request. resolveTools in session/llm/request.ts filters only on permission rules and the per-message tools map, so all ~12 tools get declared regardless of the model.

Why it's hard to work around

  • The error names the model, so it looks like a provider/model problem.
  • Setting tool_call: false in config appears to be the fix but does nothing, since the flag isn't consulted in this path.
  • Denying tools by name in an agent isn't enough — agents start from "*": "allow", and you can't name a plugin-injected tool you don't know exists. Only permission: {"*": deny} works.

Repro

  1. Configure a Vertex/Google image model, e.g. gemini-2.5-flash-image.
  2. Send any message with the stock build agent.
  3. Request fails with the error above. Capturing the outgoing request shows a tools array with 12 functionDeclarations.

Version

1.18.15 (dev)

Activity

  1. github-actions commented on Aug 10, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of an existing issue. Please check:

    • Config tool_call: false does not disable tools #35432: Same root cause — capabilities.toolcall is set from provider config but never read when building LLM requests, so tools are always sent regardless of the tool_call: false config flag. That issue describes the same prompt-loop bug with a different provider (morphllm), but the fix would cover this case too.

    If you believe these are distinct enough to warrant a separate issue, please let a maintainer know.

  2. github-actions commented on Oct 9, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions