Repository navigation
Name the display variables for the tool server Codex starts on Linux - #16
Open
anessbelbati wants to merge 1 commit into
Open
anessbelbati wants to merge 1 commit into
anessbelbati wants to merge 1 commit into
Conversation
Codex starts an MCP server with a fixed short list of environment variables
(HOME, PATH, LANG and a few more), not with its own environment. On Linux
the launcher in .codex/config.toml is the desktop app itself, and without
DISPLAY it exits at startup:
Missing X server or $DISPLAY
The platform failed to initialize. Exiting.
Codex then logs "MCP server startup failed" for video-fs and offers the
model none of its tools. Measured with Codex 0.160.1 on ubuntu-latest
against a stand-in model server: none of the app's tools in the model
request with the entry as it was written before, the video-fs tools in the
request with this change. Started by hand with only the variables Codex
passes, the launcher ended after 1.2 s without answering; with the display
variables added it answered the MCP initialize request.
The entry now lists the display variables under env_vars, the key Codex
reads for variables to pass through from its own environment. Only an X11
display could be tried on the runner. The Wayland names are there so that
a Wayland session can reach its compositor the same way. Claude Code needed
no change: on the same runner it offered the video-fs tools already. What
is written on macOS and Windows does not change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this fix, and what changes for the user?
On Linux, Codex gets none of the Video FS tools. Codex starts an MCP server with a short fixed list of environment variables (
DEFAULT_ENV_VARS), andDISPLAYisn't on it. Thevideo-fsserver is the desktop app itself, and without a display it exits at startup (Missing X server or $DISPLAY), so Codex reports it failed to start and the model gets none of its tools.On Linux the Codex entry now names the display variables to pass on (
env_varsis the key Codex reads for that):Nothing changes on macOS or Windows.
How was it tested?
Real Codex against a stand-in model server on a Linux runner, in a project prepared by
setupAgentProject:.codex/config.tomlvideo-fsin Codexmcp__video_fsenv_varsline taken outThe same with Codex 0.160.1 on Oct 7 and 0.162.0 on Oct 9 (run: https://github.com/anessbelbati/impractical-video/actions/runs/37915846873). The launcher test now checks the line is written on Linux and nowhere else.
CI (
verify), unchanged, passes on this branch on today's main: https://github.com/anessbelbati/impractical-video/actions/runs/38231937746Any remaining limitations or migration steps?
.codex/config.toml, so an existing Linux project needs the line added by hand, or the file deleted and the project opened again.