gpt-6-luna: reasoning_effort + tools fails because the chat loop always uses chat/completions
Version: v1.7.1.
What happens: With OpenAI gpt-6-luna and reasoning_effort: low, every chat turn fails: 400 Function tools with reasoning_effort are not supported for gpt-6-luna in /v1/chat/completions. To use function tools, use /v1/responses or set reasoning_effort to 'none'. Setting the profile to api_format: openai_responses / wire_api: responses does not help.
Cause: agents/loop/agent_loop.py _create_response_stream always calls self.client.chat.completions.create. The wire_api from the profile is only used in metadata. The _should_use_responses_api logic in openai_compat_provider.py is not used by the agent loop. Also, is_tool_schema_unsupported does not match this error text, so the no-tools fallback does not trigger.
Workaround: capabilities.tools: false on the model. Chat temperature must also be 1.0, because the forced_temperature table only covers gpt-5, o1 and o3, not gpt-6.
Suggested fix: honour wire_api=responses in the agent loop, or retry without reasoning_effort or without tools on this error. Add gpt-6 to the forced_temperature overrides.
Tested workaround: a separate profile and model with reasoning_effort: "low" and capabilities: {"tools": false}, plus capabilities.chat.temperature: 1.0 in agents.yaml. Turns then succeed and reasoning tokens are reported (30-110 on arithmetic checks). Native tools are lost for that model, so the real fix is to route the loop through the Responses API when wire_api == "responses", or when reasoning is requested together with tools.
The trace isolates the routing bug well. One additional boundary is to make the resolved request contract explicit per attempt, so a compatibility fix does not silently turn a tool-enabled turn into a different kind of turn.
A useful acceptance matrix would be:
- Explicit Responses profile: with
wire_api=responses, the first request must go to/responses; assert that/chat/completionsis never called and that bothreasoning_effortand the tool definitions survive. - Chat Completions incompatibility: if the provider rejects reasoning plus function tools, either fail fast with an actionable profile error or apply an explicitly configured fallback. Retrying without tools should not be presented as an equivalent successful tool-calling turn; expose
tools_enabled=falseand the fallback reason in the turn receipt/diagnostics. - Retry only before commitment: fallback is safe before the first content delta or tool call. Once output or a tool side effect has been committed, do not issue a second model request under the same user turn. Reuse an attempt ID so an exact transport retry remains idempotent.
- Model defaults: avoid extending temperature behavior only through another model-name prefix. Prefer provider/profile capability metadata, with the
gpt-6override as a documented interim rule; an unknown model should retain the user setting rather than silently receiving an unrelated default.
For regression coverage, I would test explicit Responses, Chat Completions with reasoning-only, tools-only, and the incompatible combination, plus a failure after the first tool call. Each test can assert the selected wire API, resolved temperature/reasoning/tools fields, number of provider attempts, and whether any fallback was user-visible. That would verify both request routing and the absence of a silent capability downgrade.