Native Chat passthrough never learns or downgrades a refused reasoning effort (Mistral 400/422)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 54/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
Research direction
Start by capturing Mistral’s raw 400 and 422 response bodies for the reported reasoning efforts, then check whether they match isReasoningEffortRejection in src/providers/reasoning-metadata.ts. Read src/server/chat-native.ts and src/adapters/openai-chat/passthrough.ts, comparing their flow with the Responses dispatch files. Done means a qualifying refusal triggers one lower-rung replay and records the refused rung so later turns and exports omit it.
Written by the indexing model from the issue text.
Description
Area
Provider adapters
What are you trying to accomplish?
When a routed provider refuses a reasoning_effort rung on a native Chat Completions request (OpenCode, Kilo, any /v1/chat/completions caller), I want OpenCodex to learn that refusal and replay once at the next lower published rung, as it already does for Responses traffic. Reported in #8254: Mistral answers medium/xhigh with HTTP 400 and ultra with 422 for GLM 5.3, GLM 5.3 Flash and DeepSeek V4.1 Flash 1017.
What prevents this today?
planReasoningEffortDowngrade (src/providers/reasoning-metadata.ts) is only called from src/server/responses/adapter-dispatch.ts and src/server/responses/passthrough-dispatch.ts. The native Chat lane (src/server/chat-native.ts → src/adapters/openai-chat/passthrough.ts) has no downgrade replay and never calls recordUnsupportedReasoningEffort, so a refused rung fails every time and is never learned.
Second unknown: isReasoningEffortRejection needs the upstream body to blame the effort parameter. The reporter only saw the hub's sanitized client body ({"error":{"message":"The provider rejected the request.","type":"invalid_request_error","param":null,...}}), so nobody has confirmed what Mistral's raw 400/422 body says or whether it names reasoning_effort. Without that capture, wiring the replay might never trigger for Mistral.
What should OpenCodex do?
- Capture Mistral's raw 400 (
mediumonzai-glm-5-3) and 422 (ultra) bodies and check them againstisReasoningEffortRejection. - If they qualify, add the same single-rung downgrade replay and refusal recording to the native Chat lane, so a learned refusal also drops the rung from
configuredReasoningEffortsfor later turns and exports.
Example usage or interface
No new configuration. opencode run -m 'opencodex/mistral/deepseek-v4-1-flash-1017#medium' 'Reply with OK' would succeed on the replayed low rung and record medium as unsupported.
Alternatives or workarounds
The #8254 fix ships per-model Mistral ladders and folds native Chat ultra to max, which covers the known Mistral rows. The replay would cover rows whose accepted set changes later or is undocumented (DeepSeek V4.1 Flash 1017's ladder is empirical). Operators can also pin modelReasoningEfforts.
Additional context
Found while fixing #8254 on dev at ebeb1dc8ad. Related: #7590, #8251.
Checks
- I searched existing issues and documentation.
- This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
- I removed secrets and personal data.
- Dominant language
- TypeScript
- Stars
- 16.9k
- Forks
- 1.3k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 814
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lidge-jun/opencodex
-
bug gui platform
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
lidge-jun/opencodex#9172 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
[Feature]: Include provider, model and account label in the `upstream failure` service.log linePossibly taken @EnesKartal claimed this 4 days ago. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
lidge-jun/opencodex#9057 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
[Provider] antigravity-acp catalog omits gemini-4-hydrogen and gemini-4-neon that agy acp offersPossibly taken @sedoll claimed this 6 days ago. Opencatalog provider provider-compatibility
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
lidge-jun/opencodex#9037 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
bug cli
Difficulty 4/5 3-5 days Newbie friendliness 52/100
lidge-jun/opencodex#9171 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
account-pool enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
All issues in lidge-jun/opencodex
Similar issues
-
manually bump balena-preload to ^19.0.6Possibly taken @shaunmulligan claimed this today. Open
Difficulty 1/5 1-3 hours Newbie friendliness 66/100
balena-io/balena-cli#3200 ·
Maintainers usually reply within 1 day
-
`MaterializedChatMessage._text` is quadratic in the number of text chunks (`+=` followed by `endsWith`), driving the extension host to heap OOMPossibly taken @olegius88 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
microsoft/vscode-prompt-tsx#205 ·
-
triage
Difficulty 1/5 Under an hour Newbie friendliness 64/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
melgarafael/DeskcommCRM#5340 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
ehmpathy/rhachet-roles-ehmpathy#1529 ·
Maintainers usually reply within 1 day