Codex Desktop exits when inherited OTEL metrics exporter config is invalid
What version of the Codex App are you using (From “About Codex” dialog)?
Reproduced against codex-cli 0.143.0-alpha.29 app-server.
What subscription do you have?
Enterprise
What platform is your computer?
macOS arm64
What issue are you seeing?
Codex Desktop can fail to start when it inherits globally configured OTEL_* environment variables from the user's interactive shell.
The local app-server exits with code 1 and Desktop surfaces:
Codex failed to start.
(code=1, signal=null).
Most recent error: Error: error loading otel config: failed to build OTLP metrics exporter
Telemetry exporter construction is auxiliary and should not prevent Codex from starting.
What steps can reproduce the bug?
Run app-server with an isolated Codex home and an invalid inherited OTLP compression setting:
env \
CODEX_HOME=/tmp/codex-otel-repro \
OTEL_METRICS_EXPORTER=otlp \
OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4317 \
OTEL_EXPORTER_OTLP_PROTOCOL=grpc \
OTEL_EXPORTER_OTLP_COMPRESSION=snappy \
codex app-server --analytics-default-enabled
Observed:
Error: error loading otel config: failed to build OTLP metrics exporter
The process exits with code 1.
What is the expected behavior?
App-server should warn, disable or skip OTEL, and continue startup.
This should match the existing TUI/exec behavior, which catches OTEL provider construction failures and continues with telemetry disabled.
Additional information
The fatal boundary is in codex-rs/app-server/src/lib.rs, where build_provider(...) errors are mapped to InvalidData and propagated with ?.
The equivalent TUI/exec paths catch exporter errors and continue with None.
Suggested regression coverage: invalid inherited OTLP environment must not make app-server --analytics-default-enabled exit during startup.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗