Skip to content

feat(codex): add synced default model and reasoning effort controls - #546

Merged
Ark0N merged 3 commits into
Ark0N:masterfrom
shenlvkang-collab:feat/codex-launch-defaults
Oct 9, 2026
Merged

Ark0N merged 3 commits into
Ark0N:masterfrom
shenlvkang-collab:feat/codex-launch-defaults

Conversation

@shenlvkang-collab

@shenlvkang-collab shenlvkang-collab commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex sessions already accept model and reasoning-effort launch options, but App Settings only exposed approval bypass and animations. Add synced default model and reasoning-effort controls to the existing Codex group, including Chinese labels.

Both session creation and quick-start resolve defaults on the server. Explicit per-launch fields win; empty defaults defer to Codex's own configuration. Custom endpoint, Docker and remote launches retain their own commands/configuration. Defaults apply to local sessions, including WSL. No Codex configuration files are rewritten; launch flags use the existing registry implementation.

Validation: 51 focused tests passed, including settings save/clear/validation, both local launch routes, explicit overrides, Docker/remote exclusions, custom endpoint handling and emitted CLI flags. Typecheck and scoped TypeScript lint passed. Includes a changeset and user documentation.

Real Chromium verification: both fields save with HTTP 200 and survive reload; controls fit a 390px viewport and Chinese labels render. Combined local deployment gate passed 9,147 tests with 12 skipped before the final guard correction; the correction is covered by the 51 focused tests.

@Ark0N
Ark0N merged commit 5c08e29 into Ark0N:master Oct 9, 2026
2 checks passed
Ark0N pushed a commit that referenced this pull request Oct 9, 2026
App Settings now refuses a Default Codex model that the server would reject,
before anything is written to localStorage. SettingsUpdateSchema is .strict()
and checks codexModel with ^[a-zA-Z0-9._\-/]*$, so a value like gpt-oss:20b
400'd the whole settings PUT while the toast still said "Settings saved", and
because the bad value was already in the local blob every later save from that
device failed the same way. The client check uses the same pattern, shows an
error toast, focuses the field and keeps the modal open. The toast has a zh-CN
translation in i18n.js.

src/web/codex-launch-defaults.ts gets an @fileoverview (fill only unset fields,
re-validate persisted values, callers decide scope, never writes Codex config
files), as every module in src carries one.

Both new Codex rows in index.html carry has-field, like every other App
Settings field row, so on phones the input and the select stack under their
label instead of squeezing it into a narrow column.

The Agent CLIs wiki paragraph said the defaults apply to every local launch.
Scheduled (cron) codex jobs are built without a codexConfig and never get
them, while Resume goes through POST /api/sessions and does, so the sentence
now names the Run menu, Resume, POST /api/sessions and /api/quick-start, and
says cron jobs do not use them.

The Settings Reference lists the two new rows in the Agents & CLIs table. The
neighbouring "Bypass approvals and sandbox" row described Pi's project trust;
it is the Codex --dangerously-bypass-approvals-and-sandbox toggle, so its note
says that now.

The PR's own changeset is removed: the release writes one consolidated
changeset at COM, and the PR's text overstated the scope (it included cron).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Ark0N pushed a commit that referenced this pull request Oct 9, 2026
Pin the App Settings codexModel guard to the schema. The 28df21f landing fix
added a client check in saveAppSettings() that copies the pattern of
SettingsUpdateSchema.codexModel, so one bad character no longer 400s the whole
.strict() settings PUT behind a "Settings saved" toast. Nothing tied the copy
to the schema: a looser copy would bring the silent 400 back, and a stricter
one would refuse valid model ids.

The new test extracts the client pattern from the saveAppSettings() body,
checks it agrees with the schema on eight samples (empty, dotted, slashed,
colon, space, semicolon, leading dash, non-ASCII), and asserts the guard runs
before the localStorage write. Length is left out on purpose, since the
input's maxlength="100" covers .max(100). Both a loosened pattern and a guard
moved after the write turn the test red.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Ark0N pushed a commit that referenced this pull request Oct 9, 2026
Thirteen contributor PRs, each re-checked against its GitHub head, merged
with its own merge commit and landing fixes, reviewed, and gated together
(524 test files, 10194 tests): #559, #552, #550, #556, #551, #546, #542,
#540, #555, #543, #541, #502, #432.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Ark0N

Ark0N commented Oct 9, 2026

Copy link
Copy Markdown
Owner

Merged in 1.40.0, thanks @shenlvkang-collab! Filling only unset fields and keeping the defaults to local sessions left custom endpoints, Docker and remote launches exactly as they were. Applied on the way in (28df21f, 432bd5f): App Settings refuses a model id the server's schema would reject before anything is saved (a value like gpt-oss:20b used to fail the whole settings save behind a "Settings saved" toast), with a test pinning the client check to the schema; the two rows stack under their labels on phones; and the wiki says scheduled (cron) jobs do not use the defaults. In the final review the two mode === 'codex' checks in session-routes.ts became registry data, a capabilities.launchDefaults entry on codex resolved by web/launch-defaults.ts (ecd5771), to keep the no-CLI-id-branching rule. Behaviour is unchanged.

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.

2 participants