Expand description
Codex app-server JSON-RPC implementation of AI6’s AgentHandler contract.
§ai6-agent-codex
ai6-agent-codex implements AI6’s Guatiao AgentHandler for the Codex app-server
JSON-RPC protocol. The daemon supplies a terminal Run; this handler owns Codex
initialization, thread start/resume, turn submission and event decoding.
§Features
- Starts a Codex app-server thread with Mission context and prompt.
- Resumes using the provider-issued thread identifier, verifies the returned ID, and preserves the Mission working directory.
- Sends later messages as turns and emits provider events as AI6
AgentEventvalues. - Reports a usage-limit error, with the reset time of the exhausted quota window, as an
AgentEventof kindlimitso AI6 can park the Run instead of failing it. - Reports token usage per model request (Codex reports no cost) and names the web-search and tool calls a turn makes.
- Uses per-process app-server configuration to connect to the AI6 Cable MCP endpoint; the bearer token is read from the launch environment.
- Answers Codex’s command approval requests with the green ink gate: a push to a protected ref, a merge or a release is declined until a live approval covers it. A file change inside the working directory is accepted, one reaching outside it declined.
- Marks the working directory an untrusted project unless AI6 allows its settings, so a
checkout’s
.codex/config, hooks and rules do not load. - Starts an answer-only thread (
AgentStart::answer_only, for a Chief of Staff review) in the read-only sandbox, never asking, with web search off and no MCP servers. - Before an answer-only or assistant thread starts, switches off every Codex feature but
four, renders what the model would be offered (
codex debug prompt-input) and refuses to start unless that is exactly the thread’s MCP tools (with scripts, code mode’sexecandwait, and only the expected tools nested inexec);AI6_CODEX_TOOL_CHECK=warnstarts it anyway and reports a weakening.
§Installation
The provider library contains its Guatiao entry point and builds as both an ordinary
Rust library and a dynamically loadable provider. Build it with
cargo build -p ai6-agent-codex from the AI6 workspace root.
§API overview
| Module | Purpose |
|---|---|
ai6_agent_codex | CodexHandler, CodexConfig and app-server JSON-RPC Run implementation |
§Development
Run cargo fmt --all --check, cargo test -p ai6-agent-codex, and
cargo clippy --workspace --all-targets --all-features -- -D warnings from the AI6
workspace root. Workspace-wide Clippy keeps the AI6 provider dependency’s feature-gated
library code in its intended build context.
§License
MPL-2.0. See LICENSE.
Structs§
- Codex
Config - Codex app-server AgentHandler configuration.
- Codex
Handler - Starts and resumes Codex through its app-server protocol.
Constants§
- KEPT_
FEATURES - Features a restricted thread keeps: how Codex stores its login and reaches its service,
none of which offers the model a tool, and
incremental_tools. Every other enabled feature is switched off. - RECORD_
FORMAT - The format of Codex’s rollout file.
- TOOL_
CHECK_ ENV - The environment variable that chooses what a failed tool check does:
strict(the default) refuses to start,warnstarts and reports a weakening.
Statics§
- guatiao_
declares - What this library declares, read by a scanner as data.
Functions§
- guatiao_
library_ ⚠entry - The symbol a
guatiaohost loads this library by.