Troubleshooting¶
Common issues and how to resolve them.
When to use this page¶
You get an exception from acodex and want the next step.
The Codex CLI executable is not found or fails to run.
Structured output parsing/validation fails.
Executable not found¶
If you see CodexExecutableNotFoundError:
Ensure the Codex CLI is installed and
codexis onPATH.Or pass
codex_path_override="/path/to/codex"toCodex(...)/AsyncCodex(...).
Executable exits with a non-zero code¶
If you see CodexExecError:
The exception message now includes captured
STDOUTandSTDERRsections when available.You can also inspect
error.stdoutanderror.stderrdirectly when logging or re-raising.This is the fastest way to see why the underlying
codexprocess failed.
Structured output errors¶
If you see CodexStructuredResponseError when accessing turn.structured_response:
Ensure your prompt actually returns JSON matching the schema/model.
If using
output_type, ensure you installed the extra:uv add "acodex[structured-output]"(orpip install "acodex[structured-output]").
Streamed result accessed too early¶
If you see CodexThreadStreamNotConsumedError:
Consume the full
streamed.eventsiterator (or async iterator) before accessingstreamed.result.