Add Codex as an external agent for Maple tasks - #934
Conversation
A Maple task can now hand work to the Codex CLI installed on the machine through five generic tools: agent_start, agent_send, agent_status, agent_cancel, and list_agent_providers. Goose stays the engine; Codex runs as one `codex app-server` child per thread, under the user's own Codex account and configuration, driven over its JSON-RPC stdio protocol. Codex's approval requests come to the user through Maple's existing permission card, with a new origin on the pending-permission table so the decision routes back to the waiting agent instead of Goose. In Allow all Maple accepts on the user's behalf. Questions, blocking in plan mode or asynchronous in the default mode, open Maple's question card; an asynchronous answer that lands after the turn ended starts a follow-up turn on the same thread. The tool call's transcript row streams the agent's text, commands, file changes, and todo list, and a row above the composer carries a Stop control. A background turn persists its activity so a reopened task still shows it, then tells the task to read the result. Stopping an agent interrupts it and kills its process group, because Codex does not always end a sandboxed command on interrupt; the thread stays on disk and the next send resumes it in a fresh process. Children die on runtime stop, logout, and task delete. The integration is off by default. Enabling it in Settings installs the handoff, committee, and advisor skills into the account's Goose skills directory; disabling removes only what Maple wrote. The tools are always allowed because the agent's own actions are what get gated. Driver tests run against a fake app-server fixture: the test binary re-executed behind a shell shim, so the driver resolves and spawns it exactly as it would the real CLI. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Show the Codex row even before the CLI is installed, so the card can say how to get it, and draw it with the OpenAI mark (simple-icons, CC0) instead of the generic plug. Enabling stays gated on a detected, new-enough installation; sign-in state is reported on the card but does not gate the toggle, because the tool itself says what to do when a sign-in is missing. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Describe the tools, the skills, how Codex is driven, who answers its approvals in each Maple mode, how questions and background turns reach the transcript, and the current limits. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
End-to-end tested this branch on macOS in an isolated full-stack dev environment (local OpenSecret + billing, Pro fixture account, real Codex CLI 0.154.0-alpha.6.2 signed in via ChatGPT). Found one bug — fix committed locally on top of this branch — plus two friction points worth addressing. Fixed: macOS PATH mismatch between Settings and task tools. Needs fixing: the model cannot recall truncated agent output. Friction: |
|
Filed the follow-ups from testing as #940 (assigned to you): the truncated agent output has no recall path, and the follow-up tools require a redundant The macOS PATH fix described above is pushed to |
AnthonyRonning
left a comment
There was a problem hiding this comment.
End-to-end tested on macOS in an isolated full-stack dev environment: integration detection, real Codex CLI delegation, permissions plumbing, and component CI all verified. Follow-ups filed as #940; the macOS PATH fix comes as a follow-up PR.
Summary
Lets a Maple Agent (GPUI) task hand work to the Codex CLI installed on the machine, the way Paseo lets one harness drive another. Codex is the first provider; the tool contract is generic so another harness can slot in.
agent_start,agent_send,agent_status,agent_cancel,list_agent_providers. Blocking or background per call; threads round-trip so a follow-up keeps context; at most four agents per task.codex app-serverchild per thread, spoken to over its JSON-RPC stdio protocol, under the user's own Codex account and configuration. Codex's ownsandbox_modeandapproval_policygovern what it may do. Maple sends only the prompt, the working directory, and the feature flag that enables Codex's question tool outside plan mode.handoff,committee, andadvisorskills into the account's Goose skills directory; disabling removes only what Maple wrote.Design decisions are recorded in
apps/maple-agent/docs/external-agents.md.Testing
just ciinapps/maple-agent: fmt, four clippy sets, workspace build and tests, headless tests./menu.Not covered
codex.exepreferred over the npmcodex.cmdshim; the driver fixture tests are Unix only.🤖 Generated with Claude Code