Skip to content

feat(providers/openai): add ReasoningEffortXHigh constant#186

Merged
andreynering merged 2 commits intocharmbracelet:mainfrom
ibetitsmike:mike/openai-reasoning-effort-xhigh
Mar 25, 2026
Merged

feat(providers/openai): add ReasoningEffortXHigh constant#186
andreynering merged 2 commits intocharmbracelet:mainfrom
ibetitsmike:mike/openai-reasoning-effort-xhigh

Conversation

@ibetitsmike
Copy link
Copy Markdown
Contributor

@ibetitsmike ibetitsmike commented Mar 24, 2026

OpenAI now supports xhigh reasoning effort for GPT-5.4 class models. This adds the missing ReasoningEffortXHigh constant so downstream consumers can reference it by name.

OpenAI now supports "xhigh" reasoning effort for GPT-5.4 class models.
Add the missing constant so consumers can reference it by name instead
of hardcoding the string.
@ibetitsmike ibetitsmike force-pushed the mike/openai-reasoning-effort-xhigh branch from bd1c87e to b503b28 Compare March 25, 2026 00:03
ibetitsmike added a commit to coder/coder that referenced this pull request Mar 25, 2026
## Summary

Adds `xhigh` to the OpenAI reasoning effort normalizer so GPT-5.4 class
models can use `reasoning_effort: xhigh` without it being silently
dropped.

## Problem

The SDK schema (`codersdk/chats.go`) already advertises `xhigh` as a
valid `reasoning_effort` value, but the runtime normalizer in
`chatprovider.go` only accepts `minimal|low|medium|high` for the OpenAI
provider. When a user sets `xhigh`, `ReasoningEffortFromChat()` returns
`nil` and the value never reaches the OpenAI API.

## Changes

- **Fantasy dependency**: Updated `kylecarbs/fantasy` (cj/go1.25) which
now includes the `ReasoningEffortXHigh` constant
([coder/fantasy#9](coder/fantasy#9)).
- **`chatprovider.go`**: Adds `fantasyopenai.ReasoningEffortXHigh` to
the OpenAI case in `ReasoningEffortFromChat()`.
- **`chatprovider_test.go`**: Adds `OpenAIXHighEffort` test case.

## Upstream

-
[charmbracelet/fantasy#186](charmbracelet/fantasy#186)
Copy link
Copy Markdown
Member

@andreynering andreynering left a comment

Choose a reason for hiding this comment

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

Thank you again @ibetitsmike!

I pushed a commit adding a few missing constants and the needed checks to make them work.

@andreynering andreynering merged commit d13521a into charmbracelet:main Mar 25, 2026
8 checks passed
johnstcn pushed a commit to coder/coder that referenced this pull request Mar 25, 2026
## Summary

Adds `xhigh` to the OpenAI reasoning effort normalizer so GPT-5.4 class
models can use `reasoning_effort: xhigh` without it being silently
dropped.

## Problem

The SDK schema (`codersdk/chats.go`) already advertises `xhigh` as a
valid `reasoning_effort` value, but the runtime normalizer in
`chatprovider.go` only accepts `minimal|low|medium|high` for the OpenAI
provider. When a user sets `xhigh`, `ReasoningEffortFromChat()` returns
`nil` and the value never reaches the OpenAI API.

## Changes

- **Fantasy dependency**: Updated `kylecarbs/fantasy` (cj/go1.25) which
now includes the `ReasoningEffortXHigh` constant
([coder/fantasy#9](coder/fantasy#9)).
- **`chatprovider.go`**: Adds `fantasyopenai.ReasoningEffortXHigh` to
the OpenAI case in `ReasoningEffortFromChat()`.
- **`chatprovider_test.go`**: Adds `OpenAIXHighEffort` test case.

## Upstream

-
[charmbracelet/fantasy#186](charmbracelet/fantasy#186)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants