Skip to content

feat(agents): Codex bots, experimental (A3a of spec 30) - #249

Merged
httpsphl merged 2 commits into
mainfrom
feat/codex-agent
Oct 10, 2026
Merged

httpsphl merged 2 commits into
mainfrom
feat/codex-agent

Conversation

@httpsphl

Copy link
Copy Markdown
Owner

First slice of Codex bots, off unless experimental_agents = ["codex"] is in config.toml (codex_path to point at the executable).

What it does. One codex app-server per bot over stdio JSON-RPC. CodexControl wraps the process: it takes Botloft's neutral turn line, does the handshake (initialize, thread/start or thread/resume) and sends turn/start when the thread exists and no turn runs, queuing the rest. The decoder maps item/*, turn/* and thread/tokenUsage/updated onto the chat: replies and live text, tools (shown as Bash, Write/Edit and mcp__botloft__*), read receipt, turn end with the turn's tokens, the conversation to resume, the exact context window and the model.

Team and isolation. Botloft's MCP server goes into the thread's config with the bot's token; AGENTS.md holds the rules. The owner's MCP servers, plugins, hooks and notifier are switched off with -c; the login is used as is (shared CODEX_HOME, no token copy).

Limits (spec 30.3.2). read-only sandbox and approvalPolicy: never: the bot reads and answers, it cannot change files or run commands that write. Reads are not fenced; the owner's global AGENTS.md and personal skills stay visible. No model picker or images yet. The dialog says so in the three languages. Approvals through Botloft's cards are A3b.

Why read-only. With workspace-write the sandbox's command hung on this machine (spec 30.4); read-only plus approvals is also the model that gives the owner the usual 'ask before acting'.

Interface. Agent gains attach (wrap the process and make its decoder); Claude and agy keep the default.

Checked with the real codex 0.148.0-alpha.9 in a dev daemon: the bot knew its name and crew from AGENTS.md, listed and called the crew's tools, and its attempt to write a file failed as a failed Bash tool.

Tests: codex_bot.rs (handshake and the owner's things off, chat/tokens/context, answers to requests, resume and lost thread), codex_wire unit tests, an app test for the dialog; fmt, clippy -D warnings, cargo test --workspace and pnpm check pass.

One codex app-server per bot, spoken to in JSON-RPC: a wrapper (CodexControl)
turns Botloft's turn line into turn/start once the thread exists and no turn
runs; the decoder maps item/turn/tokenUsage notifications onto the chat, the
exact context window and the turn's tokens. Botloft's MCP server goes in the
thread config with the bot's token; the owner's MCP servers, plugins, hooks
and notifier are switched off with -c. Read-only sandbox, nothing asked, so
the bot reads and answers; approvals are A3b.

Agent gains attach (wrap the process). Checked with the real codex
0.148.0-alpha.9 in a dev daemon.
@httpsphl
httpsphl merged commit c60dcad into main Oct 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant