GPT-6 models get no default reasoning settings leading to 400 on /v1/chat/completions with function tools
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start with src/agents/models/default_models.py and read get_default_model_settings() alongside the GPT-5 patterns and helper functions named in the issue. Check existing tests for default settings and add coverage for the confirmed GPT-6 names, unconfirmed variants, and chat aliases. Done when the defaults match the requested behavior and the relevant tests pass.
由索引模型根据 Issue 内容生成。
描述
Summary
agents.models.default_models.get_default_model_settings() only recognizes GPT-5 model names. For GPT-6 models it returns empty ModelSettings, so no reasoning is sent with the request. GPT-6 models then reject function tool calls on /v1/chat/completions with a 400 unless reasoning_effort is set to "none" (or the call is routed to /v1/responses).
We would like GPT-6 models to receive the same per-model default reasoning treatment as GPT-5 models.
Environment
- SDK:
openai-agents0.19.2 (also present on currentmain—src/agents/models/default_models.py) - Python 3.12
- Model invoked through
OpenAIChatCompletionsModel(/v1/chat/completions), accessed via an OpenAI-compatible gateway that forwards provider errors unchanged
Observed error
Creating an Agent with a GPT-6 model and any function tool (or MCP tool), then running it, fails with:
Error code: 400 - {'error': {'message': "Function tools with reasoning_effort are not
supported for gpt-6-sol in /v1/chat/completions. To use function tools, use
/v1/responses or set reasoning_effort to 'none'.", 'type': 'invalid_request_error',
'param': 'reasoning_effort', 'code': None}}
The same agent code works with gpt-5.6-luna, because that name is covered by _GPT_5_DEFAULT_REASONING_EFFORT_PATTERNS and the SDK sends reasoning={"effort": "none"} by default.
Minimal reproduction sketch:
from agents import Agent, Runner, function_tool
@function_tool
def get_weather(city: str) -> str:
"""Get the weather for a city."""
return "sunny"
# Fails: agent.model_settings == ModelSettings() -> no reasoning sent -> 400
agent = Agent(name="test", model="gpt-6-sol", tools=[get_weather])
Runner.run_sync(agent, "What's the weather in Paris?")
# Works: explicit reasoning makes the provider accept the tool call
from agents import ModelSettings
from openai.types.shared.reasoning import Reasoning
agent = Agent(
name="test",
model="gpt-6-sol",
tools=[get_weather],
model_settings=ModelSettings(reasoning=Reasoning(effort="none")),
)
The second case succeeding confirms gpt-6-sol accepts reasoning_effort: "none" on /v1/chat/completions — the model just never receives it by default.
Root cause
In src/agents/models/default_models.py:
gpt_5_reasoning_settings_required()gates onmodel_name.startswith("gpt-5"), so GPT-6 names are not considered reasoning models._GPT_5_DEFAULT_REASONING_EFFORT_PATTERNShas no GPT-6 entries.get_default_model_settings("gpt-6-sol")therefore returnsModelSettings()and nothing is sent asreasoning_effort; the provider applies its own default, which GPT-6 rejects in combination with function tools on/v1/chat/completions.
Requested change
Extend the existing default-reasoning machinery to the GPT-6 family, mirroring the GPT-5 structure:
- Confirmed defaults:
gpt-6-sol,gpt-6-luna, andgpt-6.1-sol(plus dated snapshots) should map toreasoning=Reasoning(effort="none")withverbosity="low", i.e. the same settings already applied togpt-5.6-luna/gpt-5.6-sol. - Unconfirmed variants: for GPT-6 names whose supported efforts are not yet confirmed (e.g.
gpt-6,gpt-6-astra), keep the existing policy of the family verbosity default withoutreasoning.effort— the same way unconfirmed GPT-5 variants (e.g.gpt-5-mini) are handled today. Maintainers can fill in confirmed efforts as they become known. - Non-reasoning aliases:
gpt-6-chat(andgpt-6-chat-latest, if it exists) should return emptyModelSettings, like thegpt-5.x-chat-latestaliases, since they do not acceptreasoning.effort.
The functions involved are the ones our application relies on: get_default_model_settings (used by Agent's model_settings default factory and by agents.run_internal.turn_preparation), get_default_model, gpt_5_reasoning_settings_required, and is_gpt_5_default.
Workaround we are using
Setting model_settings=ModelSettings(reasoning=Reasoning(effort="none")) explicitly on every GPT-6 agent. This works but duplicates what the SDK already does per-model for GPT-5, and it silently pins the effort even for models where a different default would be preferable — which is exactly what get_default_model_settings exists to avoid.
- 主要语言
- Python
- 星标
- 30.2k
- 派生
- 4.9k
- 平均合并
- 12 小时 18 分钟
- 30 天内合并 PR
- 148
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
openai/openai-agents-python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
openai/openai-agents-python#5409 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
openai/openai-agents-python#5405 · 1 条评论 ·
维护者通常 1 天内回复
-
fix(typing): explicitly specialize ToolContext[Any] in ToolFunctionWithToolContext可能重新可做 @AbarnaaSree 于 7 天前认领,目前没有进行中的 PR。 未关闭
难度 1/5 1 小时以内 新手友好度 85/100
openai/openai-agents-python#5387 · 3 条评论 ·
维护者通常 1 天内回复
-
ShellTool: empty ShellResult(output=[]) fabricates stdout "(no output)" in the model-visible shell_call_output and persisted shell_output可能重新可做 @AbarnaaSree 于 7 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 77/100
openai/openai-agents-python#5348 · 10 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 53/100
openai/openai-agents-python#5413 · 2 条评论 ·
维护者通常 1 天内回复
查看 openai/openai-agents-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
google-agentic-commerce/AP2#388 ·
-
area:codegen backend:cuda backend:hip bug direction:input
难度 2/5 1-3 小时 新手友好度 78/100
CrossGL/crosstl#3061 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
rlaope/oh-my-hermes#2304 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
mochan-tk/agentic-dev-kit-for-codex#64 ·
维护者通常 1 天内回复
-
bug docs performance
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 3 天内回复