Skip to content

server: tool_choice required does not require a tool call #33

Description

@am17an

Upstream: ggml-org#27217

tool_choice:"required" is accepted but the model can generate ordinary content until the token limit without making a tool call.

Environment: current main 465e49b9, Linux aarch64, Gemma 4 12B Q4_K_M, CUDA.

{"messages":[{"role":"user","content":"Hello, how are you today?"}],"tools":[{"type":"function","function":{"name":"get_disk_free","parameters":{"type":"object","properties":{"host":{"type":"string"}},"required":["host"]}}}],"tool_choice":"required","max_tokens":256,"temperature":0}

Observed: finish_reason:"length", predicted_n:256, and no tool_calls. This also reproduces with supports_preserve_reasoning:false, so the bug is broader than the upstream title.

The eager grammar still permits unbounded content before the tool marker; that forced-tool content allowance likely dates to a4701c98.

Activity

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

    bugSomething isn't workingserver

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions