Skip to content

TUI: prefer CODEX_HOME for IDE IPC#31347

Open
etraut-openai wants to merge 3 commits into
mainfrom
etraut/tui-ide-ipc-codex-home
Open

TUI: prefer CODEX_HOME for IDE IPC#31347
etraut-openai wants to merge 3 commits into
mainfrom
etraut/tui-ide-ipc-codex-home

Conversation

@etraut-openai

@etraut-openai etraut-openai commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Why

The IDE extension is moving its Unix IPC socket from /tmp/codex-ipc/ipc-<uid>.sock to $CODEX_HOME/ipc/ipc.sock to avoid ownership collisions on multi-user hosts. The TUI must discover the new socket without breaking compatibility with older extension versions.

What changed

  • On Unix, try $CODEX_HOME/ipc/ipc.sock first, resolving $CODEX_HOME through the existing helper.
  • Fall back to the legacy socket only when primary path resolution, validation, or connection fails.
  • Share one timeout budget across both attempts and do not fall back after a successful primary connection encounters a protocol, send, read, or request error.
  • Preserve the existing ownership and permission checks and Windows named-pipe behavior.

Manual validation

  • Built the modified CLI and configured an isolated VS Code Extension development host to use it with an isolated CODEX_HOME. After selecting a file containing CODEX_IPC_E2E_PRIMARY_PATH_MARKER and enabling /ide, the TUI returned that exact marker through $CODEX_HOME/ipc/ipc.sock. The extension-created IPC directory and socket had modes 0700 and 0600.
  • Repeated the IDE-selection check with a second CODEX_HOME that had no primary socket and a controlled legacy <tmp>/codex-ipc/ipc-<uid>.sock proxy. The TUI returned the same exact marker, confirming the legacy fallback path works with the updated extension.

Fixes #22966.

@etraut-openai etraut-openai changed the title [codex] TUI: prefer CODEX_HOME for IDE IPC TUI: prefer CODEX_HOME for IDE IPC Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[VS Code extension / Linux] IpcRouterManager fails to start: EACCES creating /tmp/codex-ipc/ipc-<uid>.sock when directory is owned by another user

1 participant