Prefer the Codex home socket for Unix IDE context (#32302)

## What changed

- Look for the Unix IDE context socket at `CODEX_HOME/ipc/ipc.sock` first.
- Fall back to the existing per-user temp-directory socket paths, including both legacy paths for UID 0.
- Apply one request deadline across all connection attempts, and stop fallback after a timeout or a protocol error on a connected socket.

## Testing

- Added coverage for socket path selection, primary preference, legacy fallbacks, and timeout and protocol-error behavior.

GitOrigin-RevId: 560c827ad3d446a82ec503779995757096ac33e0
This commit is contained in:
Eric Traut authored and copyberry committed 2026-07-11 01:15:48 +00:00
1 parent 076a110eb8
commit dfefd8aa8b
2 files changed
+285 -19

No files matched your search

+2 -2
View File
@@ -69,7 +69,7 @@ impl ChatWidget {
return;
}
match crate::ide_context::fetch_ide_context(&self.config.cwd) {
match crate::ide_context::fetch_ide_context(&self.config.cwd, &self.config.codex_home) {
Ok(context) => {
self.ide_context.mark_available();
self.sync_ide_context_status_indicator();
@@ -95,7 +95,7 @@ impl ChatWidget {
return;
}
match crate::ide_context::fetch_ide_context(&self.config.cwd) {
match crate::ide_context::fetch_ide_context(&self.config.cwd, &self.config.codex_home) {
Ok(context) => {
self.ide_context.mark_available();
self.sync_ide_context_status_indicator();