OpenAI-compatible adapters forward allowed_tools upstream; upstreams that ignore it widen the tool choice
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 15/100
Research direction
Start with the CompatibleProvider adapters and core.NarrowToAllowedTools, and compare them with how the Anthropic, Bedrock and Cohere adapters narrow tools after #1156. The first step is a per-provider check of which upstreams honor allowed_tools, and the issue leaves the choice between the three options open. Done means a decision on the option, a provider-level behavior change, and tests covering both narrowed and forwarded cases.
Written by the indexing model from the issue text.
Description
Follow-up to #1093 / #1156.
After #1156, an allowed_tools tool_choice reaches every chat-bridged provider in the Chat Completions shape, and each native adapter either maps it (Gemini, Vertex) or narrows the declared tools (Anthropic, Bedrock, Cohere). The OpenAI-compatible adapters (Groq, Ollama, Chutes, MiniMax, Bailian, EdenAI, OpenCode Go and the other CompatibleProvider users) forward the choice upstream unchanged, which is also what the Chat Completions path does today.
That's fine for an upstream that honors allowed_tools or rejects it with an error. For one that silently ignores an unknown tool_choice type, the original bug comes back one hop later: the model can call any declared function.
Options:
- Per provider, record whether the upstream supports
allowed_tools, and narrow the declared tools (core.NarrowToAllowedTools) for the ones that don't. - Always narrow for compatible adapters. That's safe everywhere, but it changes the tool list for upstreams that do support
allowed_tools, which costs prompt-cache hits. - Leave forwarding as the default and add a per-provider override.
Knowing which upstreams accept the field needs a check against each provider's API, so it is left out of #1156.
- Dominant language
- Go
- Stars
- 1.2k
- Forks
- 111
- Avg merge
- 14h 43m
- Merged PRs (30d)
- 142
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ENTERPILOT/GoModel
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 55/100
ENTERPILOT/GoModel#1182 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 15/100
ENTERPILOT/GoModel#1170 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 Half a day Newbie friendliness 35/100
ENTERPILOT/GoModel#1154 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
ENTERPILOT/GoModel#1107 ·
Maintainers usually reply within 1 day
-
Feature: QoL and feature requests from daily usePossibly taken @SantiagoDePolonia claimed this 12 days ago. Open
ENTERPILOT/GoModel#1104 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
All issues in ENTERPILOT/GoModel
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
[Bug]: Bedrock invoke-with-response-stream reports `stop_reason: "end_turn"` for tool-use turnsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
oalders/clodhopper#162 ·
Maintainers usually reply within 1 day
-
component/server severity/minor type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
diagnose globalnet reports a failure for every exported headless ServicePossibly taken @kurtyoon claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
submariner-io/subctl#1948 ·
Maintainers usually reply within 1 day