Repository navigation
Conversation
Ordinary Codex Chat UI sends can race a brief shell-like OSC title and trip handleConfirmedAgentExit → exitChat, switching to Terminal mid-turn. Suppress that handoff while optimistic sends are pending or within a short post-send grace window, and record breadcrumbs when exit is suppressed vs applied for post-hoc triage. Fixes stablyai#10098
- Apply send-grace suppression before eligible-sibling retarget - Breadcrumb the pre-route chat leaf on terminal handoff - Re-evaluate confirmed agent exit after the grace window ends
WSL-hosted Codex reports Linux transcript paths and stores rollouts under the guest managed CODEX_HOME. On Windows the main process treated those paths as missing and only searched host AppData/~/.codex, so Chat UI never loaded the live session and the Chat↔CLI toggle felt broken. Translate guest-absolute Linux hook paths to \\wsl.localhost UNC forms when they exist, include each WSL distro's managed + system Codex session roots in id-based resolve (mirroring AI Vault), and use the host-readable path for exact transcript watches. Residual risk: Win32 existsSync against the WSL 9P share can still falsely report ENOENT while the distro is cold or under load; callers already retry resolve/poll, and live validation needs Windows+WSL. Fixes stablyai#10523 Related: stablyai#10326, stablyai#10128, stablyai#10098
📝 WalkthroughWalkthroughAdds WSL-aware transcript path translation, distro-specific Codex session discovery, and host-readable path handling in transcript resolution and watching. Adds pane-scoped native-chat exit suppression based on pending optimistic sends and a five-second grace period. Routing now accepts 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: e883de4b-57fb-4877-ba0f-c1d4ac951702
📒 Files selected for processing (12)
src/main/native-chat/host-readable-transcript-path.test.tssrc/main/native-chat/host-readable-transcript-path.tssrc/main/native-chat/session-file-resolver.test.tssrc/main/native-chat/session-file-resolver.tssrc/main/native-chat/transcript-watch.tssrc/renderer/src/components/native-chat/native-chat-exit-suppress.test.tssrc/renderer/src/components/native-chat/native-chat-exit-suppress.tssrc/renderer/src/components/native-chat/native-chat-leaf-routing.test.tssrc/renderer/src/components/native-chat/native-chat-leaf-routing.tssrc/renderer/src/components/native-chat/native-chat-pending.test.tssrc/renderer/src/components/native-chat/native-chat-pending.tssrc/renderer/src/components/terminal-pane/TerminalPane.tsx
Skip raw pathExists for Windows guest Linux paths to avoid local collisions; invalidate deferred confirmed-exit timers when title recovers so Chat UI is not forced to Terminal mid-grace.
Sync update (
|
|
Reporter of #11327 here. I verified this PR's approach end to end, and found two things the description doesn't cover: it also fixes the Android app, and the Claude path is still missing. Environment: Orca 1.4.162, Windows 11 26200, WSL2 Ubuntu-24.04, Codex + Claude agents, Orca mobile on Android. Chat UI was broken on both desktop and Android after moving my agent runtime into WSL. Verifying the approachRather than patch the app, I pointed Path translation alone is sufficient. I A/B'd it: remove the symlinks and Chat breaks again immediately; restore them and it recovers — with Chat sitting on the spinner, it finished loading on its own, no interaction. So the loader is already retrying; it is only the path resolution that fails. This is not desktop-onlyThe Android app was fixed by the same host-side change. Nothing touched on the phone, nothing restarted on the PC, no new session — an existing session just opened in Chat and worked, and it broke and recovered in lockstep with the symlinks during the A/B. The mobile relay inherits both the failure and the fix. Worth mentioning in the PR description, since mobile users hitting this may not connect it to a desktop-side path bug. Gap: Claude sessions are still unhandled
Orca stores Claude transcripts as bare Linux paths too — from my So as written, this PR fixes Codex but leaves WSL Claude Chat broken in the same way. My symlink workaround covers both, which is how I noticed. Happy to open a follow-up adding the Claude session root if you'd prefer to keep this PR scoped — just say which you'd rather have. Either way, I can tick the unchecked manual Windows+WSL item from the reporting side. |
|
@6Soo Thanks for the thorough A/B validation. The symlink experiment cleanly isolates the host-path translation this PR changes, and the Android result is useful evidence that the same host-side fix also unblocks mobile relay transcript reads. I agree on scope: let’s keep #10639 focused on Codex. Claude’s I’m leaving the manual patched-build checkbox unchecked because this validated equivalent path mapping rather than this PR build itself, but it materially validates the diagnosis and fix shape. Your offer to test the Claude follow-up would be very helpful — thank you. |
…sponses (#12473) * fix(native-chat): resolve WSL Codex transcripts so Chat UI renders responses Codex reports a guest Linux transcript path. On a Windows host `existsSync` resolved it against the current drive (`C:\home\...`) and discarded it, and the id-based fallback only searched host roots. `resolveSessionFilePath` returned null forever while the watcher reported `watching: true`, leaving Chat UI permanently empty. Translate the guest path to its host-readable UNC twin, classifying **before** any `existsSync` probe on win32 so the `C:\home` false positive cannot fire. Adapted from #10639 with one required correction: it uses the **async cached** WSL seams (`listWslDistrosAsync` / `getWslHomeAsync`) rather than the `execFileSync` ones, which would stall the Electron main thread for up to 5s per tick of the resolve-poll loop on a cold distro. Fixes #10326 Co-authored-by: Orca <help@stably.ai> * fix(native-chat): stop the WSL transcript probe firing every poll tick Three follow-ups from review of the WSL Codex transcript fix: - The UNC translation was retried on every fast resolve-poll tick (measured 10 sync UNC stats per 100ms) because only a successful result was memoized. Gate the retry to the slow fallback cadence. - A non-empty WSL home list was cached for the process lifetime, so a distro that was still booting during the first probe stayed excluded forever. Expire both branches; getWslHomeAsync caches successes, so a refresh only re-spawns wsl.exe for the distros that actually failed. - codexSessionsDirs enumerated every distro's home eagerly, waking distros the user left stopped even for native-Windows panes. Make the WSL roots a lazy tier consulted only after the host's own Codex roots miss. The resolve-poll suite became platform-dependent and only passed off Windows; pin the platform and add explicit win32 coverage. --------- Co-authored-by: Orca <help@stably.ai> Co-authored-by: OrcaWin <alpha-eng@stably.ai>
…sponses (stablyai#12473) * fix(native-chat): resolve WSL Codex transcripts so Chat UI renders responses Codex reports a guest Linux transcript path. On a Windows host `existsSync` resolved it against the current drive (`C:\home\...`) and discarded it, and the id-based fallback only searched host roots. `resolveSessionFilePath` returned null forever while the watcher reported `watching: true`, leaving Chat UI permanently empty. Translate the guest path to its host-readable UNC twin, classifying **before** any `existsSync` probe on win32 so the `C:\home` false positive cannot fire. Adapted from stablyai#10639 with one required correction: it uses the **async cached** WSL seams (`listWslDistrosAsync` / `getWslHomeAsync`) rather than the `execFileSync` ones, which would stall the Electron main thread for up to 5s per tick of the resolve-poll loop on a cold distro. Fixes stablyai#10326 Co-authored-by: Orca <help@stably.ai> * fix(native-chat): stop the WSL transcript probe firing every poll tick Three follow-ups from review of the WSL Codex transcript fix: - The UNC translation was retried on every fast resolve-poll tick (measured 10 sync UNC stats per 100ms) because only a successful result was memoized. Gate the retry to the slow fallback cadence. - A non-empty WSL home list was cached for the process lifetime, so a distro that was still booting during the first probe stayed excluded forever. Expire both branches; getWslHomeAsync caches successes, so a refresh only re-spawns wsl.exe for the distros that actually failed. - codexSessionsDirs enumerated every distro's home eagerly, waking distros the user left stopped even for native-Windows panes. Make the WSL roots a lazy tier consulted only after the host's own Codex roots miss. The resolve-poll suite became platform-dependent and only passed off Windows; pin the platform and add explicit win32 coverage. --------- Co-authored-by: Orca <help@stably.ai> Co-authored-by: OrcaWin <alpha-eng@stably.ai>
Summary
\\wsl.localhost\…so Chat UI can load WSL Codex sessions.Fixes
Closes #10523
Test plan
ELI5
Chat UI couldn't load Codex session transcripts that lived inside WSL because paths weren't translated for Windows. Transcripts map to host-readable paths so Chat UI works for WSL Codex.