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)
✨ 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 introduces a new configuration setting ( 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.
The Effect Service Conventions check found one issue with how the spawn error captures the launch command. See the inline comment.
Posted via Macroscope — Effect Service Conventions
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
User-supplied CLI tokens change how Codex child processes are spawned for sessions, probes, and exec; mistakes could break Codex connectivity but args are not shell-executed.
Overview
Adds a Launch arguments field to Codex provider settings (schema, patch trimming, and settings UI) so users can pass extra Codex CLI flags without changing the binary path.
Configured args are tokenized on whitespace and forwarded into
codex app-serverfor provider status probes and live session startup (CodexAdapter→CodexSessionRuntime), with helperscodexAppServerArgs/codexSessionAppServerArgskeeping theapp-serversubcommand first. Forcodex execgit/text generation,codexExecLaunchArgsforwards only exec-safe flags (e.g.--strict-config,--config/-c,--enable/--disable) and drops app-server-only options like--listen.Includes focused tests for argv construction, probe/runtime propagation, and exec filtering. Also hoists connection catalog encode/decode in the mobile catalog store (no behavior change).
Reviewed by Cursor Bugbot for commit 006c9f5. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add
launchArgssetting to Codex provider configurationlaunchArgsstring field toCodexSettings(trimmed, default empty) andCodexSettingsPatchin settings.ts, exposing it to clients and forms.launchArgsthrough the Codex adapter and session runtime so the spawnedapp-serverprocess receives additional CLI arguments.codexExecLaunchArgsin CodexProvider.ts to filter launch args to exec-safe flags only (e.g.--strict-config,--config), dropping app-server-only flags like--listen.codex execcommands in CodexTextGeneration.ts and propagates them through provider status checks.Macroscope summarized 006c9f5.
Summary by CodeRabbit