Fix codex binary path setting having no effect #493
main fromrefs/pull/493/head·merged by t3dotgg(GitHub profile, opens in a new tab) View on GitHubWhat#
Wire the Settings UI "Codex binary path" and "Codex home path" fields through the full orchestration pipeline so they reach the codex process spawn.
Why#
The server-side code to consume a custom binary path already existed (readCodexProviderOptions in codexAppServerManager.ts), but the orchestration layer had no providerOptions field on its commands or events. The web app stored the setting in localStorage with no channel to deliver it.
Key Changes#
- Export
ProviderStartOptionsfrom contracts and addproviderOptionstoThreadTurnStartCommand,ClientThreadTurnStartCommand, andThreadTurnStartRequestedPayload - Define an inline copy in
orchestration.tsto avoid a circular dependency withprovider.ts - Send
codexBinaryPath/codexHomePathfrom ChatView dispatch calls - Thread
providerOptionsthrough decider, ProviderCommandReactor, ProviderService, and CodexAdapter - Cache
providerOptionsper thread so runtime mode changes preserve the custom path - Persist
providerOptionsin the session binding'sruntimePayloadso server restarts restore it
Closes #486
Note
Pass codex provider start options end-to-end and run Windows build/publish via shell in ProviderCommandReactor.make and cli.ts to fix codex binary path setting having no effect#
Introduce ProviderStartOptions across commands, events, and session lifecycle, persist and reuse codex binaryPath/homePath, propagate options from ChatView, and run bun tsdown/npm publish with shell: process.platform === 'win32'. Key entry points are ProviderService.startSession/recoverSession and ProviderCommandReactor.ensureSessionForThread.
📍Where to Start#
Start with ProviderService.make focusing on startSession, recoverSession, and upsertSessionBinding in provider.ts, then follow option propagation in ProviderCommandReactor.make in ProviderCommandReactor.ts and schemas in orchestration.ts.
📊 Macroscope summarized ec7664e. 7 files reviewed, 3 issues evaluated, 2 issues filtered, 0 comments posted
🗂️ Filtered Issues#
apps/server/src/orchestration/Layers/ProviderCommandReactor.ts — 0 comments posted, 2 evaluated, 1 filtered
- line 282: In
ensureSessionForThread, the logic for reusing an existing session explicitly ignoresoptions.providerOptions. If a user updates their provider configuration (e.g., changing an invalid API key) and retries an action, the system will reuse the existing failed/configured session instead of restarting it with the new options. This happens because the condition!runtimeModeChanged && !providerChanged && !shouldRestartForModelChange(lines 282) returns the existing session ID early, bypassing thestartProviderSessioncall that would apply the newproviderOptions. This effectively locks the thread into a broken configuration until the session is manually stopped or expires. [ Out of scope ]
apps/server/src/provider/Layers/ProviderService.ts — 0 comments posted, 1 evaluated, 1 filtered
- line 233: In
recoverSessionForThread, thepersistedProviderOptionsare retrieved and used to resume the session, but they are not passed toupsertSessionBindingwhen persisting the resumed state. [ Cross-file consolidated ]
- 1
t3dotgg(GitHub profile, opens in a new tab) approved these changes
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
0a80e08b-f442-440d-8b93-e7f03d58cbc3You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip
Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Share your feedback on Discord.
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.
❤️ Share