Skip to content

fix(#84): support xhigh reasoning_effort for GPT-5.x models#104

Closed
AI-Context-Engineer wants to merge 1 commit into
MadAppGang:mainfrom
AI-Context-Engineer:fix-issue-84-xhigh-mapping
Closed

fix(#84): support xhigh reasoning_effort for GPT-5.x models#104
AI-Context-Engineer wants to merge 1 commit into
MadAppGang:mainfrom
AI-Context-Engineer:fix-issue-84-xhigh-mapping

Conversation

@AI-Context-Engineer

Copy link
Copy Markdown

Fixes #84

The previous mapping in packages/cli/src/adapters/openai-api-format.ts capped reasoning_effort at high even when budget_tokens >= 32000. Per the openai-python SDK (shared/reasoning_effort.py), valid values include xhigh, which is supported by the newer GPT-5.x reasoning models documented in the issue:

  • gpt-5.4, gpt-5.4-pro, gpt-5.4-mini
  • gpt-5.3-codex
  • gpt-5.2, gpt-5.2-pro, gpt-5.2-codex
  • gpt-5.1-codex-max

Change

New mapping:

budget_tokens < 4000    -> minimal
budget_tokens < 16000   -> low
budget_tokens < 32000   -> high
budget_tokens >= 32000  -> xhigh

Both prepareRequest() and the secondary mapping in the Codex Responses payload builder are updated for consistency.

Test

When the user runs claudish --model cx@gpt-5.4 --effort max:

  • Before: Claude Code passes budget_tokens >= 32000 -> mapped to high (loses one tier)
  • After: Mapped to xhigh (uses the model's full reasoning capacity)

Notes

This is a minimal fix focused only on extending the upper bound. A more comprehensive fix would include per-model effort tables (issue #84 has the matrix), but that's out of scope for this PR.

The previous mapping capped at 'high' even when budget_tokens >= 32000,
but per the openai-python SDK (shared/reasoning_effort.py), valid
reasoning_effort values include 'xhigh' which is supported by:
- gpt-5.4, gpt-5.4-pro, gpt-5.4-mini
- gpt-5.3-codex
- gpt-5.2, gpt-5.2-pro, gpt-5.2-codex
- gpt-5.1-codex-max

New mapping:
  budget_tokens < 4000   -> minimal
  budget_tokens < 16000  -> low
  budget_tokens < 32000  -> high
  budget_tokens >= 32000 -> xhigh

Both prepareRequest() and the secondary mapping in the Codex Responses
payload builder are updated for consistency.

Closes MadAppGang#84
@AI-Context-Engineer

Copy link
Copy Markdown
Author

Cerrando: duplica el trabajo de #84 que ya esta abierto y es mas completo. Disculpas por el ruido.

@AI-Context-Engineer AI-Context-Engineer deleted the fix-issue-84-xhigh-mapping branch April 12, 2026 04:23
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