Skip to content
Source
Sign inSign up
pingdotgg/t3code

Fix codex binary path setting having no effect #493

Mergedchuks-qua(GitHub profile, opens in a new tab)merged 6 commits intomain fromrefs/pull/493/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

What

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 ProviderStartOptions from contracts and add providerOptions to ThreadTurnStartCommand, ClientThreadTurnStartCommand, and ThreadTurnStartRequestedPayload
  • Define an inline copy in orchestration.ts to avoid a circular dependency with provider.ts
  • Send codexBinaryPath/codexHomePath from ChatView dispatch calls
  • Thread providerOptions through decider, ProviderCommandReactor, ProviderService, and CodexAdapter
  • Cache providerOptions per thread so runtime mode changes preserve the custom path
  • Persist providerOptions in the session binding's runtimePayload so 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 ignores options.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 the startProviderSession call that would apply the new providerOptions. 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, the persistedProviderOptions are retrieved and used to resume the session, but they are not passed to upsertSessionBinding when persisting the resumed state. [ Cross-file consolidated ]
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: 0a80e08b-f442-440d-8b93-e7f03d58cbc3

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • ✅ Review completed - (🔄 Check again to review again)
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Post copyable unit tests in a comment

      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
      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    2. t3dotgg(GitHub profile, opens in a new tab) approved these changes

Sign in to join this conversation.