Add Codex launch arguments setting#2892
Conversation
📝 WalkthroughWalkthroughAdds a trimmed ChangesCodex Launch Arguments
🎯 3 (Moderate) | ⏱️ ~20 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review This PR adds a new user-configurable feature that passes CLI arguments to the codex subprocess. The new capability modifies runtime behavior in subprocess spawning and introduces potential security considerations with arbitrary argument passing that warrant human review. You can customize Macroscope's approvability policy. Learn more. |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/contracts/src/settings.ts (1)
209-213: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winAdd
"launchArgs"to theorderarray for consistency.The
orderarray should include"launchArgs"to ensure the field appears in the intended position in the settings form.ClaudeSettings(line 255) includeslaunchArgsin its order array, and the test expectation inProviderSettingsForm.test.ts(line 21) assumeslaunchArgsappears aftershadowHomePath.♻️ Proposed fix
}, { - order: ["binaryPath", "homePath", "shadowHomePath"], + order: ["binaryPath", "homePath", "shadowHomePath", "launchArgs"], }, );🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/contracts/src/settings.ts` around lines 209 - 213, The settings schema object currently sets order: ["binaryPath", "homePath", "shadowHomePath"] but omits "launchArgs", causing form ordering and tests to fail; update that object's order array to include "launchArgs" after "shadowHomePath" so it matches ClaudeSettings and the expectation in ProviderSettingsForm.test.ts, ensuring the "order" array change is applied to the same settings object in packages/contracts/src/settings.ts.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/server/src/provider/Layers/CodexSessionRuntime.ts`:
- Around line 721-724: The CodexAppServerSpawnError message currently logs a
hardcoded "${options.binaryPath} app-server" which can mismatch the actual
command; update the error construction where CodexAppServerSpawnError is thrown
(after the spawner.spawn call) to include the computed appServerArgs (from
codexAppServerArgs(options.launchArgs)) along with options.binaryPath so the
logged command reflects ChildProcess.make(options.binaryPath, appServerArgs,
...) and any flags from options.launchArgs; ensure you reference appServerArgs
and options.binaryPath in the error message so spawn failures show the real
command invoked.
---
Outside diff comments:
In `@packages/contracts/src/settings.ts`:
- Around line 209-213: The settings schema object currently sets order:
["binaryPath", "homePath", "shadowHomePath"] but omits "launchArgs", causing
form ordering and tests to fail; update that object's order array to include
"launchArgs" after "shadowHomePath" so it matches ClaudeSettings and the
expectation in ProviderSettingsForm.test.ts, ensuring the "order" array change
is applied to the same settings object in packages/contracts/src/settings.ts.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: b83f8476-9f14-45be-9c09-5bab8a90c3d4
📒 Files selected for processing (12)
apps/server/src/provider/Layers/CodexAdapter.test.tsapps/server/src/provider/Layers/CodexAdapter.tsapps/server/src/provider/Layers/CodexProvider.tsapps/server/src/provider/Layers/CodexSessionRuntime.tsapps/server/src/provider/Layers/ProviderInstanceRegistryLive.test.tsapps/server/src/provider/Layers/ProviderRegistry.test.tsapps/server/src/provider/Layers/codexLaunchArgs.test.tsapps/server/src/serverSettings.test.tsapps/web/src/components/KeybindingsToast.browser.tsxapps/web/src/components/settings/ProviderSettingsForm.test.tspackages/contracts/src/settings.test.tspackages/contracts/src/settings.ts
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
1470597 to
e051516
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@macroscope-app run |
|
Code review triggered. Results will be posted as check runs when complete. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8939411. Configure here.

What Changed
launchArgssetting to the shared settings schema and provider settings form.codex app-serverfor provider probes and live session startup.Why
Codex instances need the same kind of configurable launch arguments Claude already exposes, so users can pass app-server CLI flags like
-c model_provider="codex-lb"without changing the binary path. The field is split into argv tokens directly and never shell-executed.UI Changes
Adds a small
Launch argumentstext field to Codex provider settings.Screenshots will be added separately.
Checklist
UI changes:

Validation:
bun fmtbun lintbun typecheckNote
Medium Risk
Changes how Codex child processes are spawned across probes, sessions, and exec; incorrect user-supplied flags could break connectivity, though exec uses a filtered argv subset.
Overview
Adds a Launch arguments field to Codex provider settings (schema, patches, settings form) so users can pass extra CLI flags without changing the binary path. Values are trimmed and stored as a single string, then split into argv tokens for
child_process.spawn(not shell execution).codexAppServerArgsappends those tokens afterapp-serverfor provider status probes and live sessions (CodexSessionRuntime,CodexAdapter).codexExecLaunchArgsreuses only exec-safe flags (--strict-config,--config/-c,--enable/--disable) and drops app-server-only options such as--listenwhen invokingcodex execfor git/title text generation.Tests cover argv helpers, schema trimming, form field visibility, probe/adapter/runtime propagation, and exec argument filtering.
Reviewed by Cursor Bugbot for commit 518e65d. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add
launchArgssetting to Codex provider configurationlaunchArgsstring field toCodexSettings(default'') that lets users pass extra CLI flags to the Codex binary.launchArgsthrough via a newcodexAppServerArgshelper.codex exectext-generation path filterslaunchArgsto only exec-safe flags (e.g.--strict-config,--config,--enable,--disable) via a newcodexExecLaunchArgshelper, stripping app-server-only flags like--listen.Macroscope summarized 518e65d.
Summary by CodeRabbit