Description
Adds OpenAI Codex CLI as a developer agent. doc-0002 “Codex” has the facts: amazon-bedrock provider on bedrock-mantle, hooks-based plugin with one generation per turn, managed hooks in /etc/codex/config.toml to avoid the interactive trust step the Grafana guide mentions, native OTel that needs logs:write, and several UNVERIFIED items. Start with a spike on a throwaway box (not the demo host) and record the answers in this task before building. The spike decides the Bedrock region and whether MCP works on the Bedrock provider; if MCP does not, record which prompts are excluded for Codex.
Acceptance Criteria
- #1 Spike notes record: a working mantle region and model; whether stdio and HTTP MCP servers work on the Bedrock provider; that system-layer managed hooks (or the bypass-trust fallback) fire in codex exec and exec resume including Stop; the tool_name the PreToolUse payload carries for apply_patch; the thread.started id field; the provider, model and cost a generation lands with; the real Prometheus names of Codex OTel metrics
- #2 The dev-workstation image installs a pinned Codex release verified by checksum and sigstore, bakes /etc/codex/config.toml with the agento11y hooks, and a check fails if those hooks drift from plugins/codex/hooks/hooks.json at the pinned agento11y tag
- #3 A Codex developer runs corpus sessions unattended with codex exec –json, follow-ups via exec resume, no –ephemeral, and writes event=dev_session lines with agent=codex
- #4 Codex native OTel reaches Grafana Cloud with a separate scoped token that has logs:write and is documented in docs/security.md; the ingest token never enters a developer container
- #5 A Codex session appears in the Coding agents view with the chosen agent name, user, team, model and token counts, and any missing cost is explained or fixed (for example an upstream InferProvider fix for the openai. prefix)
Definition of Done
- #1 just check
Implementation Plan
Verify pinned Codex 0.162.1 against live Bedrock before image integration. Signed /openai/v1/models returns 404; /v1/models succeeds and lists openai.gpt-5.6-luna in us-east-1, but POST /v1/responses rejects that model as unsupported. Discriminate inference routing before choosing any provider workaround; do not promote catalog availability to executable proof.
Implementation Notes
2026-10-15 live signed streaming inference succeeded: us-east-1 /openai/v1/responses, openai.gpt-5.6-luna, reasoning low, returned touchline-spike-ok and response.completed. Model discovery is /v1/models; its path differs intentionally from OpenAI inference. Initial nonstream timeout does not establish endpoint incompatibility. Keep pinned Codex default provider route.
Live throwaway ARM64 container proved scoped Mantle initial/resume, same thread, real apply_patch and mcp__time__get_current_time, two ingested generations with correct user/team/model/tokens. Plugin reports provider codex and omits cost; runner estimates cumulative cost separately. Native metrics initially absent: pinned core/src/otel_init.rs gates custom metrics on analytics.enabled. Corrected to true only with explicit Grafana exporters; live rerun now exposes codex_turn_token_usage_{bucket,count,sum}, codex_tool_call_total, codex_hooks_run_total, and latency families. No browser proof claimed.
Additional live transport proof: Codex called a streamable-HTTP MCP fixture and returned its exact marker; stdio MCP was already proven. Managed hooks work in initial and resumed sessions without trust bypass. Actual hook/output vocabulary includes apply_patch and Bash. Native metric namespace touchline confirmed.
All spike facts now recorded: working region/model, real stdio and HTTP MCP, initial/resume managed hooks and Stop-derived generations, actual thread_id, apply_patch/Bash vocabulary, provider/cost limitation and actual native metric names. Runtime image checksum/Sigstore verified and hooks parity checked. Visual Coding agents criterion remains unverified by maintainer decision.
Implementation and required runtime/API evidence complete; resume for the explicitly deferred Coding agents visual verification and final host rollout after AIO-0007 (unpatched braces advisory disposition). No browser proof claimed.