fix(server): use Linux home for Codex probe cwd on WSL drvfs mounts #8956
main fromrefs/pull/8956/head·opened View on GitHubSummary#
Fixes Codex provider status timeouts on T3 Code desktop when the WSL backend runs with process.cwd() on a Windows profile mounted at /mnt/c/....
Closes #8955
When probing Codex app-server status, skills/list can hang for many seconds on drvfs paths. T3's auth probe times out after 10s, which surfaces as "Timed out while checking Codex app-server provider status." even though Codex is installed and authenticated.
This change introduces resolveCodexProbeCwd() and uses $HOME (or Node homedir) for Codex provider probes when the server cwd is under /mnt/.
Test plan#
-
bun run test src/provider/Layers/codexProbeCwd.test.ts -
bun run test src/provider/Layers/ProviderRegistry.test.ts -t "uses Linux home for Codex probe cwd" - Manual: T3 Code desktop on WSL-only backend → Codex provider shows Ready instead of timing out
Made with Cursor
Note
Use Linux home as Codex probe cwd on WSL /mnt/ drvfs mounts#
- Introduces
resolveCodexProbeCwdin codexProbeCwd.ts, which returns the server cwd as-is unless it starts with/mnt/, in which case it prefers the expandedHOMEenv var (falling back toNodeOS.homedir()whenHOMEis blank) - Updates
checkCodexProviderStatusin CodexProvider.ts to pass the resolved cwd to the probe instead ofprocess.cwd() - Adds unit tests for
resolveCodexProbeCwdedge cases and an integration test that spies onprocess.cwdto verifyHOMEis used on/mnt/paths - Risk: if
HOMEis unset andNodeOS.homedir()also returns empty on a/mnt/path, the original/mnt/cwd is returned unchanged — probe behavior on drvfs stays as before in that edge case
Summary by CodeRabbit#
Bug Fixes
- Improved Codex provider detection when the server runs from a Windows-mounted path in WSL.
- Probes now use the appropriate home directory, including support for configured and fallback home paths.
- Preserved existing behavior for native Linux paths and expanded home-directory shortcuts.
Tests
- Added coverage for WSL-mounted paths, home-directory resolution, tilde expansion, and fallback behavior.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
One finding: the new diagnostic suppression in
Posted via Macroscope — Effect Service Conventionsapps/server/src/provider/Layers/codexProbeCwd.tslacks an adjacent rationale comment.@@ -0,0 +1 @@1+// @effect-diagnostics nodeBuiltinImport:offThis new diagnostic suppression has no adjacent explanation of why the diagnostic must be disabled here (the JSDoc below documents the WSL behavior, not the suppression). Consider adding a trailing rationale, matching the repo pattern in e.g.
apps/server/scripts/t3-sqlite-state.ts.Suggested change1-// @effect-diagnostics nodeBuiltinImport:off1+// @effect-diagnostics nodeBuiltinImport:off - node:os resolves the Linux home fallback in a pure helper that runs outside any Effect runtime.Posted via Macroscope — Effect Service ConventionsApprovability#
Verdict: Not approved
Macroscope's review found this PR not approvable — This is a narrowly scoped WSL-specific Codex probe fix with focused tests and limited runtime blast radius. It also adds a production-file static-analysis suppression directive, which requires human review under the repository’s review policy.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Bugbot is paused — on-demand spend limit reached
Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.
A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.
Thanks for the PR. We're not taking changes to the orchestration and provider layers right now: that part of the server is being rewritten for V2, and merging into the current code would either conflict with or be thrown away by that work.
Closing for now. If this is still an issue once V2 lands, please reopen (or open a fresh PR against the new code) and we'll take a proper look.
juliusmarminge closed this
Sign in to join this conversation.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Team
Run ID:
404a7b25-4be1-47ec-8a3b-8c445f0bd73d📥 Commits
Reviewing files that changed from the base of the PR and between 31c1c5996f88e3acf1566adc11c9b51ac7561554 and 892f7a4d685c8d92a4ab15d84f1881b059f29985.
📒 Files selected for processing (4)
apps/server/src/provider/Layers/CodexProvider.tsapps/server/src/provider/Layers/ProviderRegistry.test.tsapps/server/src/provider/Layers/codexProbeCwd.test.tsapps/server/src/provider/Layers/codexProbeCwd.tsIncluded review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
📝 Walkthrough
Walkthrough#
The Codex provider status check now resolves
/mnt/working directories to a Linux home directory before probing. Tests cover native paths,HOMEhandling, tilde expansion, fallback behavior, and provider integration.Changes#
Codex provider probe working directory
apps/server/src/provider/Layers/codexProbeCwd.ts,apps/server/src/provider/Layers/codexProbeCwd.test.tsresolveCodexProbeCwd, which preserves native paths and resolves/mnt/paths throughHOMEor the Node home directory. Tests cover the supported path and fallback cases.apps/server/src/provider/Layers/CodexProvider.ts,apps/server/src/provider/Layers/ProviderRegistry.test.tscheckCodexProviderStatuspasses the resolved cwd to the Codex probe. Integration coverage verifies that a/mnt/cwd uses the configured Linux home directory.Estimated code review effort: 2 (Simple) | ~10 minutes
Merge Risk: ⚪ Minimal · up to
892f7This localized change redirects Codex status probes to the Linux home directory on WSL-mounted paths, with targeted tests covering the behavior; no actionable merge-blocking risk remains beyond normal checks and review.
Suggested reviewers:
t3dotgg,juliusmarminge🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
#8955by using the Linux home directory for Codex probes when the server cwd is under /mnt/, while preserving existing behavior for other paths.Full details: Docstring Coverage
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 4 files.
✨ Finishing Touches
🧪 Generate unit tests (beta)
Warning
Your free Security trial is over. An organization admin can activate Security or dismiss this notice.
Comment `@coderabbitai help` to get the list of available commands.