Skip to content

fix(native-chat): chats ignore saved Arguments; they are for terminal launches - #26506

Draft
brennanb2025 wants to merge 7 commits into
mainfrom
brennanb2025/native-chat-ignore-arguments
Draft

brennanb2025 wants to merge 7 commits into
mainfrom
brennanb2025/native-chat-ignore-arguments

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Settings → Agents → Arguments holds the command-line flags your terminal tabs (and the default, terminal-backed chat) start an agent with. The updated (structured) native chat (Settings → Experimental → "Use updated structured native chat") also tried to reuse them: it guessed, flag by flag, which ones a Claude or Codex chat could use. That went wrong in confusing ways:

  • some flags were silently dropped;
  • some were placed where Codex ignores them;
  • some valid flags stopped the chat from starting.

Now the updated (structured) native chat doesn't read Arguments at all. They apply to terminal tabs and terminal-backed chats, as before. The program path (Command) and the agent's environment settings still apply to chats.

What Changed

Before: the updated (structured) native chat translated your terminal Arguments per agent.

  • Claude: flags went to the SDK one value each, and some were skipped silently.
  • Codex: an allow/deny list went in front of app-server, where Codex ignores most options.

Some results:

  • --oss silently used the cloud provider;
  • -m did nothing;
  • --disallowedTools was dropped;
  • --mcp-config a.json b.json refused the chat with "give --mcp-config more than one value".

After:

  • A structured Codex chat starts as plain codex app-server.
  • A structured Claude chat gets no Arguments-derived flags or extra folders.
  • Structured Grok, OpenCode and OMP chats already ignored Arguments.
  • Terminal-backed chats are unchanged. That is the default chat, plus WSL/SSH chats and chats created before the toggle; they still launch the CLI with Arguments.
  • Your agents' own config files still apply in chat: ~/.claude settings and .mcp.json, and ~/.codex/config.toml.
  • The model and effort come from the chat's picker.
  • Command (the program path, fix(native-chat): refuse a Command that can't run instead of silently running the stock CLI #25667) and the environment setting are unchanged.

Settings → Agents: each agent that has native chat now shows one line under its Arguments field, in all 6 languages:

  • Claude: "Used when Claude CLI is launched. Native chat does not use these; put its settings in ~/.claude/settings.json."
  • Codex, Grok and OpenCode: the same sentence, with ~/.codex/config.toml, ~/.grok/config.toml and ~/.config/opencode/opencode.json.
  • OMP: "Used when OMP CLI is launched. Native chat does not use these." (no file named)
  • Agents without native chat get no line, and the row's existing summary is unchanged.

Unchanged:

  • Permissions. Agent Permissions still stores its full-access choice inside Arguments, and chat still reads that one setting until the chat permission setting (feat(native-chat): each Claude/Codex chat gets its own permission mode #26116) replaces it.
  • Older hosts. A chat connected to an older host can still receive that host's "Saved Arguments …" refusals, so the wording for them stays.

Mechanism: this removes the per-agent translators (claude-structured-launch-args.ts, codex-structured-launch-args.ts), the shared reader that fed them, the Arguments-only error type and its emitters, and the runtime plumbing that carried Arguments into chat. That includes a launchArgs field on chat records, which current builds no longer write (builds before #20944 did). The Codex model-list probe already ignored Arguments; a test now pins that.

Why

The common pattern is a per-agent program-path setting for chat, with no reuse of a terminal arguments field. Agent CLIs keep their real configuration in their own config files, which chats already load. Translating terminal flags into a chat session needs per-CLI tables that drift with every CLI release, and it fails in ways users can't see. Ignoring them is the standard behavior and the simplest.

Differences from the common pattern:

Linked Issue

Merge order: after #26116 (chat permission setting). Then the Settings line is exactly true, because the chat reads its own permission setting instead of the Agent Permissions flag kept in Arguments.

Supersedes #26059 (Codex), #26127 (Claude) and #26367 (Grok). It reverses the Arguments half of #25721; the Command half stays.

Visual Proof

QA ran on Windows (low spec), driven by a non-Claude agent over the DevTools protocol against a hidden window, with stand-in CLIs. The box's real agent configs were unchanged at every step.

Settings → Agents: the new line under Arguments (untouched profile). Agents with native chat get the line; Gemini, which has none, gets nothing:
Claude
Codex
Grok
Gemini

The updated chat ignores saved Arguments.

  • A Codex chat with saved -m qa-x -c foo.bar=1 --profile work --oss starts as exactly app-server and replies. Before, --profile and --oss were refused or silently changed what ran.
  • A Claude chat with saved --mcp-config a.json --worktree feat --append-system-prompt "- x" starts and replies, and none of those reach the CLI.
    Codex chat
    Claude chat

Permissions still follow Agent Permissions. Untouched Arguments give full access; Manual gives on-request / workspace-write:
Full access
Manual

With the updated chat toggle off, the terminal-backed chat still launches with the saved Arguments (verified from the launch command line; the terminal tab itself wasn't captured).

Testing

  • Targeted tests (explicit files, final head before the end-of-PR main merge: 6083afa). The full affected set, 491 files, passed at 53b2364; the locale and i18n tests (76 files) passed at a1f08ab; the Claude start and Fast-mode tests (38 files) passed at 6083afa. Among them:
    • Codex chat argv is exactly app-server with non-empty saved Arguments;
    • Claude extraArgs carry nothing from saved Arguments;
    • the Codex model probe ignores saved Arguments;
    • an older host's Arguments refusal still renders.
  • orca-ci-checks: CI's lint, code-quality, localization and typecheck steps, 23/23 pass.
  • Real Claude CLI suite: runs once on the final head, after the end-of-PR main merge.
  • Electron QA on Windows (low spec), driven by a non-Claude agent with stand-in CLIs. With the updated chat on, a Codex chat started as exactly app-server despite saved -m qa-x -c foo.bar=1 --profile work --oss, and a Claude chat's launch carried none of --mcp-config a.json --worktree feat --append-system-prompt "- x". Both replied. Permissions still followed Agent Permissions. With the toggle off, the terminal-backed chat still launched with the saved Arguments. See Visual Proof.

Review

Pending.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Mixed versions: no new wire content. An older host may still send an Arguments refusal, and newer clients still render it.
  • SSH/WSL: unchanged. Chats run where they ran.
  • Mobile: unchanged.
  • Persisted data: the unused launchArgs record field is dropped. Old records that carry it are read without it; native chat has no real users yet.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

… launches

Settings -> Agents -> Arguments holds a terminal launch's options, but
native chat tried to apply them too: Claude squeezed them into the SDK's
one-value-per-option record (dropping some flags silently and refusing a
chat over a valid repeat), and Codex placed them before `app-server`, where
Codex ignores most of them. A user could not tell which saved option did
anything in a chat.

Native chat now ignores saved Arguments for every agent: Codex chat runs
plain `app-server`, and Claude chat gets only Orca's own options. The
Command setting still picks the program, and Agent Permissions' posture
(which it keeps in the Arguments field) is still read for the chat's
permissions.

Removed with it: the Claude and Codex Arguments translators, the
configured-Arguments reader, the host-side Arguments refusal and its error
class, the runtime's Arguments resolver, the pinned launch-arguments
helper, and the record's never-launched `launchArgs` field and its
carry-through. The shared reader and copy for an Arguments refusal stay,
so a chat on an older host still words one it sends.
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Merge-order note: #26116 (per-chat permission modes) is merged as 2233fd3. It was rebuilt before merging: the mode is now a chat option applied at launch, so live Claude switching and the old Codex per-turn overrides are gone, and permission flags typed into Arguments are still stripped. This PR was written against the earlier version of #26116, so check it against current main before taking it out of draft.

This branch has not been deployed

No deployments
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.

1 participant