[PR #7090] [MERGED] fix(codex): let Codex connections set the thinking level (#7083) #7469

Closed
opened 2026-10-23 04:20:06 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7090
Author: @SpicyMarinara
Created: 10/5/2026
Status: ✅ Merged
Merged: 10/5/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/codex-thinking-level-7083


📝 Commits (7)

  • db0bf04 fix(codex): let Codex connections set the thinking level
  • ba6aa93 fix(codex): keep Codex levels valid and Default unchanged
  • 18809f3 Merge remote-tracking branch 'origin/staging' into fix/codex-thinking-level-7083
  • da15c47 Merge remote-tracking branch 'origin/staging' into fix/codex-thinking-level-7083
  • c597878 Merge branch 'staging' into fix/codex-thinking-level-7083
  • b04ce52 Merge remote-tracking branch 'origin/staging' into fix/codex-thinking-level-7083
  • 100bfdb Merge remote-tracking branch 'origin/fix/codex-thinking-level-7083' into fix/codex-thinking-level-7083

📊 Changes

19 files changed (+498 additions, -40 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 docs/connections/providers-reference.md (+1 -1)
📝 docs/connections/subscription-clis.md (+2 -0)
➕ e2e/codex-reasoning-effort.e2e.ts (+94 -0)
📝 packages/client/src/components/chat/ChatSetupWizard.tsx (+14 -4)
📝 packages/client/src/components/connections/ConnectionEditor.tsx (+6 -2)
📝 packages/client/src/components/game/GameSetupWizard.tsx (+8 -2)
📝 packages/client/src/components/ui/GenerationParametersEditor.tsx (+8 -1)
📝 packages/client/src/localization/locales/en.json (+1 -0)
📝 packages/server/src/routes/generate/dry-run-route.ts (+5 -1)
📝 packages/server/src/routes/generate/parameter-preview-route.ts (+2 -0)
📝 packages/server/src/services/generation/generation-parameters.ts (+12 -0)
📝 packages/server/src/services/generation/provider-generation-runtime.ts (+12 -2)
📝 packages/server/src/services/llm/connection-fallback-provider.ts (+10 -7)
📝 packages/server/src/services/llm/providers/openai.provider.ts (+14 -2)
📝 packages/shared/src/constants/generation-parameter-relevance.ts (+17 -16)
📝 packages/shared/src/constants/model-lists.ts (+10 -1)
➕ scripts/regressions/codex-reasoning-effort.regression.ts (+279 -0)
📝 scripts/regressions/generation-parameter-relevance.regression.ts (+1 -1)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7083

Why this change

  • Codex (OpenAI ChatGPT login) connections had no way to set the thinking level, although the Codex client supports it. The request sent to Codex dropped the reasoning field and the panel hid Reasoning Effort for this provider.
  • Codex users who never picked a level should keep Codex's own default, not suddenly get the preset's built-in Maximum (more plan usage, slower replies).

What changed

  • Codex requests send the chosen level as reasoning: { effort }, converted to one the model accepts (GPT-5.5: low–xhigh; GPT-5.6/GPT-6: low–max, per Codex's model catalog). Nothing is sent when the level is unset or Default, the send switch is off, or the model doesn't reason or isn't known.
  • The existing Reasoning Effort control now shows for Codex reasoning models in the connection's Default Chat Parameters and in a chat's Advanced Parameters, with Default instead of Off and one plain help sentence (new en.json key).
  • Codex follows a level only once the connection or the chat picks one; the preset, the built-in Maximum and scene chats leave Codex on its default until then. Parameter editors and the Chat/Game setup wizards start Codex at Default.
  • A Codex fallback uses only its own saved level; levels from fallbacks and agent packages are converted for the Codex model.
  • Parameter preview and dry-run match what generation sends.
  • The built-in Codex model list adds the GPT-6 and GPT-5.6 models Codex offers; GPT-5.5 stays the default for new connections.
  • Docs: docs/connections/subscription-clis.md, docs/connections/providers-reference.md. CHANGELOG entry under [Unreleased].

Known behaviour changes (in the CHANGELOG):

  • Codex connections or chats that already had custom parameters saved a Reasoning Effort that was never sent before; it now applies. Maintainer decision: keep the CHANGELOG warning, or clear those saved values.
  • When a Codex connection on Default falls back to a connection with no Reasoning Effort of its own, the fallback no longer gets the preset's level.

Validation

Agent-run (no real OpenAI/Codex endpoint was called; tests use a temporary CODEX_HOME, a local stub server and a stubbed model list):

  • pnpm check passes (includes localization:check, format, lint, e2e types, build).

  • New node regression scripts/regressions/codex-reasoning-effort.regression.ts fails on staging and passes here. It sends each level through a stub and checks the request body, the cases where the field is left out, conversion for gpt-5.5, the Codex fallback, the order of preset/connection/chat/scene, the panel choices and the default model.

  • 31 related node regressions pass (generation-parameter-relevance, provider-compat, robustness-provider-resilience, prompt, connection-test-parameters, game-generation-parameters, open-issues, gpt-6-astra, codex-chatgpt-image, and others).

  • E2e e2e/codex-reasoning-effort.e2e.ts passes on desktop-chromium and mobile-chromium; generation-parameter-controls, gpt6-models and claude-sonnet55 pass on desktop.

  • Not run: CodeRabbit (to be run before ready-for-review).

  • pnpm check passes locally

  • Container (Docker / Podman) built and ran without issue

  • Ran the app, clicked through the changes manually

  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)

  • Above manual verification completed (describe below)

  • Read and followed CONTRIBUTING.md

Manual verification notes

e2e/claude-opus55.e2e.ts (2 tests) fails identically on unmodified staging (checked on 9d3d6154d), so it is not caused by this branch. Local CodeRabbit CLI was rate-limited (shared quota); GitHub CodeRabbit reviews the PR.

  • With a real codex login, open an OpenAI (ChatGPT) connection, turn on Use custom defaults for this connection and check that Reasoning Effort starts at Default.
  • Pick medium on gpt-5.5 and on a GPT-6/GPT-5.6 model, send a chat message, and check in debug logs that the request carries reasoning.effort and Codex accepts it.
  • Pick max on a GPT-6/GPT-5.6 model and xhigh on gpt-5.5; check that Codex accepts both.
  • Set the level back to Default, send a message and check that no reasoning field is sent.
  • In a chat, set a level in Advanced Parameters and check that it overrides the connection's.
  • Check that gpt-4o and chatgpt-4o-latest don't show Reasoning Effort.
  • Create a chat through the setup wizard with a Codex connection, turn on Customize parameters, and check that Reasoning Effort starts at Default.
  • Check that a new Codex connection starts on gpt-5.5.
  • Check the control and help text in light and dark mode and at mobile width.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation). Needed for docs/connections/subscription-clis.md and docs/connections/providers-reference.md.
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

  • Screenshot of the Codex Reasoning Effort control to be attached (the e2e saves codex-reasoning-effort.png).

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7090 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/5/2026 **Status:** ✅ Merged **Merged:** 10/5/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/codex-thinking-level-7083` --- ### 📝 Commits (7) - [`db0bf04`](https://github.com/Pasta-Devs/Marinara-Engine/commit/db0bf04e98182cc11d29763442cdb5da5b6a6d66) fix(codex): let Codex connections set the thinking level - [`ba6aa93`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ba6aa93fba1efd070e439754ee9c6a40e17a4797) fix(codex): keep Codex levels valid and Default unchanged - [`18809f3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/18809f3a9d8ca5674c2e344223b69d941f4f23a2) Merge remote-tracking branch 'origin/staging' into fix/codex-thinking-level-7083 - [`da15c47`](https://github.com/Pasta-Devs/Marinara-Engine/commit/da15c471667d51acfeb399bbb44a85ff7f41c429) Merge remote-tracking branch 'origin/staging' into fix/codex-thinking-level-7083 - [`c597878`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c5978781306b5ae58ebcb3def04cbd88a491212d) Merge branch 'staging' into fix/codex-thinking-level-7083 - [`b04ce52`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b04ce52f4df884519aefbc183c3af8c20748ed77) Merge remote-tracking branch 'origin/staging' into fix/codex-thinking-level-7083 - [`100bfdb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/100bfdbdb072c08e97b86b7ce7dea8d49d1b06e8) Merge remote-tracking branch 'origin/fix/codex-thinking-level-7083' into fix/codex-thinking-level-7083 ### 📊 Changes **19 files changed** (+498 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `docs/connections/providers-reference.md` (+1 -1) 📝 `docs/connections/subscription-clis.md` (+2 -0) ➕ `e2e/codex-reasoning-effort.e2e.ts` (+94 -0) 📝 `packages/client/src/components/chat/ChatSetupWizard.tsx` (+14 -4) 📝 `packages/client/src/components/connections/ConnectionEditor.tsx` (+6 -2) 📝 `packages/client/src/components/game/GameSetupWizard.tsx` (+8 -2) 📝 `packages/client/src/components/ui/GenerationParametersEditor.tsx` (+8 -1) 📝 `packages/client/src/localization/locales/en.json` (+1 -0) 📝 `packages/server/src/routes/generate/dry-run-route.ts` (+5 -1) 📝 `packages/server/src/routes/generate/parameter-preview-route.ts` (+2 -0) 📝 `packages/server/src/services/generation/generation-parameters.ts` (+12 -0) 📝 `packages/server/src/services/generation/provider-generation-runtime.ts` (+12 -2) 📝 `packages/server/src/services/llm/connection-fallback-provider.ts` (+10 -7) 📝 `packages/server/src/services/llm/providers/openai.provider.ts` (+14 -2) 📝 `packages/shared/src/constants/generation-parameter-relevance.ts` (+17 -16) 📝 `packages/shared/src/constants/model-lists.ts` (+10 -1) ➕ `scripts/regressions/codex-reasoning-effort.regression.ts` (+279 -0) 📝 `scripts/regressions/generation-parameter-relevance.regression.ts` (+1 -1) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #7083 ## Why this change - Codex (OpenAI ChatGPT login) connections had no way to set the thinking level, although the Codex client supports it. The request sent to Codex dropped the reasoning field and the panel hid **Reasoning Effort** for this provider. - Codex users who never picked a level should keep Codex's own default, not suddenly get the preset's built-in Maximum (more plan usage, slower replies). ## What changed - Codex requests send the chosen level as `reasoning: { effort }`, converted to one the model accepts (GPT-5.5: low–xhigh; GPT-5.6/GPT-6: low–max, per Codex's model catalog). Nothing is sent when the level is unset or Default, the send switch is off, or the model doesn't reason or isn't known. - The existing Reasoning Effort control now shows for Codex reasoning models in the connection's **Default Chat Parameters** and in a chat's **Advanced Parameters**, with **Default** instead of **Off** and one plain help sentence (new `en.json` key). - Codex follows a level only once the connection or the chat picks one; the preset, the built-in Maximum and scene chats leave Codex on its default until then. Parameter editors and the Chat/Game setup wizards start Codex at **Default**. - A Codex fallback uses only its own saved level; levels from fallbacks and agent packages are converted for the Codex model. - Parameter preview and dry-run match what generation sends. - The built-in Codex model list adds the GPT-6 and GPT-5.6 models Codex offers; GPT-5.5 stays the default for new connections. - Docs: `docs/connections/subscription-clis.md`, `docs/connections/providers-reference.md`. CHANGELOG entry under [Unreleased]. Known behaviour changes (in the CHANGELOG): - Codex connections or chats that already had custom parameters saved a Reasoning Effort that was never sent before; it now applies. Maintainer decision: keep the CHANGELOG warning, or clear those saved values. - When a Codex connection on Default falls back to a connection with no Reasoning Effort of its own, the fallback no longer gets the preset's level. ## Validation Agent-run (no real OpenAI/Codex endpoint was called; tests use a temporary `CODEX_HOME`, a local stub server and a stubbed model list): - `pnpm check` passes (includes `localization:check`, format, lint, e2e types, build). - New node regression `scripts/regressions/codex-reasoning-effort.regression.ts` fails on staging and passes here. It sends each level through a stub and checks the request body, the cases where the field is left out, conversion for gpt-5.5, the Codex fallback, the order of preset/connection/chat/scene, the panel choices and the default model. - 31 related node regressions pass (generation-parameter-relevance, provider-compat, robustness-provider-resilience, prompt, connection-test-parameters, game-generation-parameters, open-issues, gpt-6-astra, codex-chatgpt-image, and others). - E2e `e2e/codex-reasoning-effort.e2e.ts` passes on desktop-chromium and mobile-chromium; `generation-parameter-controls`, `gpt6-models` and `claude-sonnet55` pass on desktop. - Not run: CodeRabbit (to be run before ready-for-review). - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes `e2e/claude-opus55.e2e.ts` (2 tests) fails identically on unmodified staging (checked on 9d3d6154d), so it is not caused by this branch. Local CodeRabbit CLI was rate-limited (shared quota); GitHub CodeRabbit reviews the PR. - [ ] With a real `codex login`, open an OpenAI (ChatGPT) connection, turn on **Use custom defaults for this connection** and check that **Reasoning Effort** starts at **Default**. - [ ] Pick **medium** on gpt-5.5 and on a GPT-6/GPT-5.6 model, send a chat message, and check in debug logs that the request carries `reasoning.effort` and Codex accepts it. - [ ] Pick **max** on a GPT-6/GPT-5.6 model and **xhigh** on gpt-5.5; check that Codex accepts both. - [ ] Set the level back to **Default**, send a message and check that no `reasoning` field is sent. - [ ] In a chat, set a level in **Advanced Parameters** and check that it overrides the connection's. - [ ] Check that gpt-4o and chatgpt-4o-latest don't show Reasoning Effort. - [ ] Create a chat through the setup wizard with a Codex connection, turn on **Customize parameters**, and check that Reasoning Effort starts at **Default**. - [ ] Check that a new Codex connection starts on gpt-5.5. - [ ] Check the control and help text in light and dark mode and at mobile width. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation). Needed for `docs/connections/subscription-clis.md` and `docs/connections/providers-reference.md`. - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) - Screenshot of the Codex Reasoning Effort control to be attached (the e2e saves `codex-reasoning-effort.png`). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:20:06 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7469
No description provided.