# Plexum-openai-provider Plexum ProviderPlugin that wraps the local `codex` CLI binary (OpenAI Codex CLI ≥ 0.135). Same CLI-driven pattern as `Plexum-gemini-provider` and `Plexum-anthropic-provider`'s contractor mode. ## Status **v0.1**: subprocess-per-turn, JSONL stream parsing, per-workspace session continuity via `codex exec resume `. Single model `codex` advertised by default; operator can override. ## Auth No API key in this plugin's config. The `codex` CLI handles auth via `~/.codex/` (ChatGPT login OR `OPENAI_API_KEY`). Run `codex login` once (or set env) and this plugin just shells out. ## Install ```bash cd ~/Plexum-openai-provider ./scripts/install.sh ``` Operator notes in `~/.plexum/plugins/plexum-openai-provider/config.json`: ```json { "binary": "/home//.local/bin/codex", "extra_args": [] } ``` (absolute path is required when the daemon runs under systemd — systemd doesn't inherit shell PATH). Then `.plugins.allow += ["plexum-openai-provider"]` and: ```bash plexum agent-add --model codex my-agent systemctl --user restart plexum plexum say --agent-id my-agent --session-id $(plexum new-session --agent-id my-agent) "hello" ``` ## How it works Per Plexum turn: ``` codex exec [resume ] \ --skip-git-repo-check \ --dangerously-bypass-approvals-and-sandbox \ --json \ [--model ] \ "" ``` cwd = ``, stdin = `/dev/null` (codex would otherwise hang waiting for additional input). Codex emits JSONL: ```jsonl {"type":"thread.started","thread_id":"..."} {"type":"turn.started"} {"type":"item.completed","item":{"id":"...","type":"agent_message","text":"..."}} {"type":"turn.completed","usage":{"input_tokens":...,...}} ``` `thread.started.thread_id` is captured into `/.plexum-codex-session` so the next turn passes `exec resume ` instead of `exec`. `item.completed` of type `agent_message` becomes `text_delta`; `turn.completed.usage` populates the canonical Usage on `message_end`. ## ChatGPT account vs API key ChatGPT-account installs only support the default model; explicit `--model gpt-5-codex` etc. returns `400 invalid_request_error`. With an API key install, operator can declare more model ids via `config.supported_models` + `config.model_args`. ## License Same as Plexum.