Foundry. CodexProvider
(foundry v0.1.4)
Copy Markdown
Spawns OpenAI Codex CLI as a subprocess and streams responses.
Uses codex exec --json so the LiveView can consume structured events while
Codex runs with the target project as its working root.
Summary
Functions
Runs a conversation through Codex CLI.
Runs a conversation through Codex CLI and calls on_event as text arrives.
Functions
Runs a conversation through Codex CLI.
Options
:system_prompt- Foundry's system prompt:timeout_ms- max wait time in milliseconds:model- model override; nil uses Codex config/default:profile- Codex profile override:project_root- working directory for Codex:sandbox- Codex sandbox mode, defaults toworkspace-write:executable- executable name/path, defaults tocodex
Returns
{:ok, text, metadata} or {:error, reason}
Runs a conversation through Codex CLI and calls on_event as text arrives.
Events are:
{:delta, text}- newly streamed assistant text{:trace, event}- structured Codex JSON event{:result, text, metadata}- final successful response