mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #4197] [Issue]: Expose tool_choice setting to require tool calls #2271
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#2271
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SpicyMarinara on GitHub (Jul 28, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4197
Originally assigned to: @SpicyMarinara on GitHub.
Summary
OpenAI-compatible chats hardcode tool_choice to "auto", allowing models to silently answer from conversation context without calling an enabled tool. Expose a user-visible "auto", "none", or "required" setting while retaining "auto" as the default.
Expected behavior
Users should be able to set tool_choice to "required" for a preset or chat so the model must call one of the supplied tools before producing a final answer. The default should remain "auto" for backward compatibility.
Actual behavior
In Marinara Engine 2.3.4, openai.provider.ts hardcodes body.tool_choice = "auto" with no shared schema, preset, chat, or UI override. During a nutrition-data chat, the model skipped the webhook call and confidently reported food that was not logged; it returned the correct data only after the user asked it to look again.
Steps to reproduce
Environment
Logs, screenshots, or video
Webhook request log:
20:27:42 tool=get_training_status -> 7873 bytes
20:31:15 tool=get_training_status -> 7871 bytes
21:21:09 tool=get_training_status -> 8766 bytes
The incorrect answer occurred between 20:31 and 21:21, with no webhook request in that interval. The 21:21:09 request was triggered by the "look again" retry and produced the correct answer.
Additional context
Provider: OpenAI-compatible NanoGPT using GLM-5. Tool: custom webhook execution type using a local URL with WEBHOOK_LOCAL_URLS_ENABLED=true. Code inspection found body.tool_choice = "auto" in packages/server/src/services/llm/providers/openai.provider.ts; this was inspected locally in 2.3.4 and has not been verified against current staging. Only the OpenAI-compatible provider path was reviewed. The requested values are the string enum "none", "auto", and "required", not the object form previously associated with #1704. A maintainer suggested a possible "Force To Call Tool" toggle in the Function Calls section of Chat Settings that changes "auto" to "required", with no guarantee that every model will honor it.
Discord thread: Expose tool_choice as a setting — models silently skip tool calls and answer from context
Discord thread link: https://discord.com/channels/1417099416812392641/1531489390759645395
Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653)
Discord thread transcript (9 messages)
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Jul 28, 2026):
That's how we do it.
@SpicyMarinara commented on GitHub (Jul 28, 2026):
Implementation is claimed by @SpicyMarinara on
agent/assigned-issues-4195-4198. I’m implementing the agreed Force To Call Tool toggle in the Function Calls section, preservingautoas the default and using the barerequiredstring when enabled.@SpicyMarinara commented on GitHub (Jul 28, 2026):
Draft implementation PR: #4199
@SpicyMarinara commented on GitHub (Jul 28, 2026):
Fixed on
stagingvia #4199 (a97cc55d6) according to the maintainer decision in this issue: Function Calls now exposesForce To Call Tool, switching the first tool-capable round fromautoto barerequired, then returning toautoso the model can finish. Both OpenAI request paths and profile persistence are covered.