[GH-ISSUE #4907] [Issue]: Force To Call Tool is ignored by Google, Vertex, and Anthropic #2718

Closed
opened 2026-10-21 05:53:47 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Xelvanis on GitHub (Aug 11, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4907

Originally assigned to: @SpicyMarinara on GitHub.

Summary

The provider-agnostic Force To Call Tool chat setting is ignored by the native Google, Vertex, and Anthropic adapters. The first tool round resolves to Marinara's toolChoice: "required" policy, but those adapters do not translate it to their native request contracts.

Expected behavior

When Force To Call Tool is enabled and tools are available, the first request should require one tool call on supported providers. Google and Vertex should send function-calling mode ANY; compatible Anthropic requests should send tool_choice: { "type": "any" }. Later tool rounds should return to automatic selection. Unsupported Anthropic combinations should avoid invalid forced-choice requests and expose a clear fallback or limitation.

Actual behavior

Google and Vertex always serialize toolConfig.functionCallingConfig.mode as AUTO. Anthropic serializes tools but omits tool_choice. The model can therefore answer without calling a tool even though the chat setting is enabled.

Steps to reproduce

  1. Configure a native Google, Vertex, or Anthropic connection and enable at least one function tool for a chat.
  2. Enable Force To Call Tool in the chat's Function Calls settings.
  3. Send a prompt that can be answered either directly or by calling the enabled tool.
  4. Inspect the first outbound provider request.
  5. Observe AUTO for Google/Vertex or no tool_choice for Anthropic instead of the provider-native forced-tool policy.

Environment

  • Marinara Engine version: current staging at 0ec8271962ec4c6c5a3c8e4fb3d358ee21f20418
  • Install type: source inspection
  • OS + version: Not provided
  • Browser or app shell: Not provided

Logs, screenshots, or video

No live provider logs, screenshots, or video are attached. Current request construction shows:

  • packages/server/src/services/llm/providers/google.provider.ts always writes mode AUTO.
  • packages/server/src/services/llm/providers/anthropic.provider.ts writes tools but no tool_choice.
  • packages/server/src/services/generation/tool-resolution-runtime.ts resolves the enabled first round to required.

Additional context

This is a provider-compatibility follow-up to #4197 and #4199. That work introduced the provider-agnostic setting but implemented request translation only for OpenAI-style builders.

Official provider contracts:

Anthropic requires compatibility handling rather than an unconditional field: manual extended thinking rejects forced tool choice, adaptive thinking supports it, and Mythos does not support forced tool use. Provider-body regressions should cover required, automatic, and incompatible cases while preserving existing OpenAI behavior.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Xelvanis on GitHub (Aug 11, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4907 Originally assigned to: @SpicyMarinara on GitHub. <!-- task-id: honor-forced-tool-choice-supported-providers --> ## Summary The provider-agnostic **Force To Call Tool** chat setting is ignored by the native Google, Vertex, and Anthropic adapters. The first tool round resolves to Marinara's `toolChoice: "required"` policy, but those adapters do not translate it to their native request contracts. ## Expected behavior When **Force To Call Tool** is enabled and tools are available, the first request should require one tool call on supported providers. Google and Vertex should send function-calling mode `ANY`; compatible Anthropic requests should send `tool_choice: { "type": "any" }`. Later tool rounds should return to automatic selection. Unsupported Anthropic combinations should avoid invalid forced-choice requests and expose a clear fallback or limitation. ## Actual behavior Google and Vertex always serialize `toolConfig.functionCallingConfig.mode` as `AUTO`. Anthropic serializes tools but omits `tool_choice`. The model can therefore answer without calling a tool even though the chat setting is enabled. ## Steps to reproduce 1. Configure a native Google, Vertex, or Anthropic connection and enable at least one function tool for a chat. 2. Enable **Force To Call Tool** in the chat's Function Calls settings. 3. Send a prompt that can be answered either directly or by calling the enabled tool. 4. Inspect the first outbound provider request. 5. Observe `AUTO` for Google/Vertex or no `tool_choice` for Anthropic instead of the provider-native forced-tool policy. ## Environment - Marinara Engine version: current `staging` at `0ec8271962ec4c6c5a3c8e4fb3d358ee21f20418` - Install type: source inspection - OS + version: Not provided - Browser or app shell: Not provided ## Logs, screenshots, or video No live provider logs, screenshots, or video are attached. Current request construction shows: - `packages/server/src/services/llm/providers/google.provider.ts` always writes mode `AUTO`. - `packages/server/src/services/llm/providers/anthropic.provider.ts` writes `tools` but no `tool_choice`. - `packages/server/src/services/generation/tool-resolution-runtime.ts` resolves the enabled first round to `required`. ## Additional context This is a provider-compatibility follow-up to #4197 and #4199. That work introduced the provider-agnostic setting but implemented request translation only for OpenAI-style builders. Official provider contracts: - Google Gemini function calling: https://ai.google.dev/gemini-api/docs/function-calling - Anthropic tool use: https://platform.claude.com/docs/en/agents-and-tools/tool-use/implement-tool-use Anthropic requires compatibility handling rather than an unconditional field: manual extended thinking rejects forced tool choice, adaptive thinking supports it, and Mythos does not support forced tool use. Provider-body regressions should cover required, automatic, and incompatible cases while preserving existing OpenAI behavior. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:53:47 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Aug 11, 2026):

Addressed by #4908 and merged into staging in a0c303f6b.

<!-- gh-comment-id:5255429223 --> @SpicyMarinara commented on GitHub (Aug 11, 2026): Addressed by #4908 and merged into staging in a0c303f6b.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#2718
No description provided.