From a6db465e46166ef5e3578162d95452ec64b39220 Mon Sep 17 00:00:00 2001 From: Bohan Jiang <52446949+Bohan-J@users.noreply.github.com> Date: Sat, 18 Apr 2026 14:25:58 +0800 Subject: [PATCH] fix(ui/agents): drop Codex-incompatible --model example from custom args tab (#1310) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(agent/codex): route custom_args -m/--model to thread/start payload Codex agents spawn via `codex app-server --listen stdio://`, which does not accept `-m` / `--model` (those belong to the normal Codex CLI). When a user's custom_args still carried those tokens the process exited before the JSON-RPC initialize handshake with `codex process exited`, with no actionable error. Extract `-m `, `--model `, and `--model=` from opts.CustomArgs before invoking app-server and promote the value into opts.Model, so that startOrResumeThread can pass it through the `thread/start` payload where Codex actually reads the field. Fixes #1308. * fix(ui/agents): drop Codex-incompatible --model example from custom args tab The helper text and placeholder suggested `--model claude-sonnet-4-…` as a custom CLI argument, which is valid for Claude but crashes Codex agents (its `app-server` subcommand does not accept model flags). Swap in provider-agnostic copy so the UI no longer steers users into an invalid configuration for non-Claude runtimes. Refs #1308. * revert "fix(agent/codex): route custom_args -m/--model to thread/start payload" This reverts f18355b2. After review, extracting `-m`/`--model` out of opts.CustomArgs and promoting them into the thread/start payload is the wrong shape of fix: agent CLIs have many flags their non-interactive modes don't accept, and hand-translating a subset case-by-case doesn't scale — it pushes us toward an ever-growing list of per-backend arg rewriters. The preferred direction is to teach users via the UI what command their custom_args extend (see the launch_header preview in #1312) and let bad configurations fail loudly. If the resulting error is hard to read that's a separate improvement we should make on the failure path, not by silently rewriting user input. Refs #1308. --- packages/views/agents/components/tabs/custom-args-tab.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/views/agents/components/tabs/custom-args-tab.tsx b/packages/views/agents/components/tabs/custom-args-tab.tsx index c56fa271a..36ec733c6 100644 --- a/packages/views/agents/components/tabs/custom-args-tab.tsx +++ b/packages/views/agents/components/tabs/custom-args-tab.tsx @@ -81,8 +81,8 @@ export function CustomArgsTab({ Custom Arguments

- Additional CLI arguments appended to the agent command at launch - (e.g. --model claude-sonnet-4-20250514) + Additional CLI arguments appended to the agent command at launch. + Supported flags depend on the agent's CLI.

{launchHeader && (

@@ -111,7 +111,7 @@ export function CustomArgsTab({ updateEntry(index, e.target.value)} - placeholder="--model claude-sonnet-4-20250514" + placeholder="--flag value" className="flex-1 font-mono text-xs" />