espnet3.bin.atlas.agents.providers.codex.CodexProvider
espnet3.bin.atlas.agents.providers.codex.CodexProvider
class espnet3.bin.atlas.agents.providers.codex.CodexProvider(config: DictConfig)
Bases: Provider
Call codex exec and read its JSON-lines output.
build_command(request: AgentRequest, prompt: str, , cwd: Path, output_path: Path, schema_path: Path) → Invocation
Build the codex exec argv for one request.
Uses codex exec resume <thread_id> when request.resume_thread_id is set, otherwise a fresh codex exec in cwd; applies the configured sandbox/model/config overrides and writes the final message to output_path. A request’s schema is passed as --output-schema, so the final message is constrained to it. The prompt goes to stdin.
build_env(recipe_dir: Path) → dict[str, str]
Give Codex a workspace-local home while retaining user credentials.
parse(stdout: str, output_path: Path) → ParsedOutput
Read the final message file, else the last agent_message event.
record_usage(artifact_dir: Path, request: AgentRequest, argv: list[str], stdout: str) → None
Write the call’s token usage to agent_usage.json and its history.
