Skip to content

fix(providers): translate thinking_config for codex and refresh model list - #687

Merged
delete-cloud merged 1 commit into
mainfrom
fix/codex-thinking-config
Aug 1, 2026
Merged

delete-cloud merged 1 commit into
mainfrom
fix/codex-thinking-config

Conversation

@delete-cloud

@delete-cloud delete-cloud commented Aug 1, 2026 •

Copy link
Copy Markdown
Owner

o6n 实测发现并修复:

  • codex provider 把 pipeline 传入的 thinking_config 原样塞进请求体,后端 400 Unsupported parameter → 翻译为 Responses 的 reasoning.effort,disabled 时省略
  • gpt-5.2 已被上游下线(ChatGPT 账号现只接受 gpt-5.5/gpt-5.4)→ CONTEXT_SIZES 和 webui 预设同步移除

测试:test_codex_responses 6 个全过(新增 2 个:翻译/省略),vitest 100 全过,ruff 干净

Summary by CodeRabbit

  • New Features

    • Improved reasoning controls for Codex requests, translating enabled thinking settings into the appropriate reasoning effort.
  • Updates

    • Removed the unavailable GPT-5.2 model option from Codex model selection.
    • GPT-5.5 and GPT-5.4 remain available.
  • Bug Fixes

    • Requests now omit reasoning settings when thinking is disabled.

… list

The codex provider passed kwargs through to the request body verbatim,
so the pipeline's thinking_config hit the backend as an unsupported
parameter (HTTP 400). Translate it to the Responses reasoning.effort
shape and omit reasoning when disabled. Also drop gpt-5.2 (retired
upstream; the backend now only accepts gpt-5.5/gpt-5.4 for ChatGPT
accounts) from CONTEXT_SIZES and the webui codex presets.
@coderabbitai

coderabbitai Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The Codex provider now translates enabled thinking_config into Responses API reasoning settings and removes the internal field from requests. The gpt-5.2 model is removed from provider metadata and web UI presets.

Changes

Codex provider and model updates

Layer / File(s) Summary
Map thinking configuration to reasoning fields
coding-agent/src/coding_agent/providers/codex_responses.py, coding-agent/tests/providers/test_codex_responses.py
_build_request removes thinking_config and maps enabled settings to reasoning.effort. Tests cover enabled and disabled configurations.
Remove gpt-5.2 from model availability
coding-agent/src/coding_agent/providers/codex_responses.py, coding-agent/webui/app/src/components/Header.tsx, coding-agent/webui/app/src/components/Header.test.tsx
The provider context-size mapping and Codex model presets no longer include gpt-5.2.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the Codex thinking_config translation and model list updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/codex-thinking-config

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
coding-agent/tests/providers/test_codex_responses.py (1)

129-156: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover the default reasoning effort.

The provider defaults enabled thinking to "medium" when effort is absent. This test only supplies "high". Add a case with thinking_config={"enabled": True} and assert body["reasoning"] == {"effort": "medium"}.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@coding-agent/tests/providers/test_codex_responses.py` around lines 129 - 156,
Extend test_stream_translates_thinking_config_to_reasoning_effort with a case
using thinking_config={"enabled": True} and no effort value, then assert the
captured request body contains reasoning set to {"effort": "medium"} while
excluding thinking_config.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@coding-agent/tests/providers/test_codex_responses.py`:
- Around line 129-156: Extend
test_stream_translates_thinking_config_to_reasoning_effort with a case using
thinking_config={"enabled": True} and no effort value, then assert the captured
request body contains reasoning set to {"effort": "medium"} while excluding
thinking_config.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b21db767-58d2-44f7-b554-a7227ec77c3f

📥 Commits

Reviewing files that changed from the base of the PR and between 34c0dc5 and 172ff80.

📒 Files selected for processing (4)
  • coding-agent/src/coding_agent/providers/codex_responses.py
  • coding-agent/tests/providers/test_codex_responses.py
  • coding-agent/webui/app/src/components/Header.test.tsx
  • coding-agent/webui/app/src/components/Header.tsx

@delete-cloud
delete-cloud merged commit 249adb8 into main Aug 1, 2026
2 checks passed
@delete-cloud
delete-cloud deleted the fix/codex-thinking-config branch August 1, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant