Skip to content

feat: structured codex and acp agents on main, and the linux fixes for structured agents - #81

Merged
sean-brydon merged 3 commits into
mainfrom
codex-driver
Oct 13, 2026
Merged

sean-brydon merged 3 commits into
mainfrom
codex-driver

Conversation

@sean-brydon

@sean-brydon sean-brydon commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

#79 and #80 were stacked PRs. They merged into their stacked bases (resume-conversations and codex-driver), not into main, because GitHub only retargets a stacked PR when the branch below it is deleted. main therefore has #78 (resume) but not the Codex or ACP drivers.

This PR brings codex-driver to main:

All structured tests pass 5/5 under -race on Linux and on macOS, and the full go test -race ./... passes on macOS.

🤖 Generated with Claude Code

sean-brydon and others added 3 commits October 13, 2026 14:09
With Labs › Structured agents on (it covered Claude Code alone before), a
new Codex agent runs as `codex app-server` under `berthd agent-host`, and
the new Codex driver (internal/box/codexdriver.go) speaks its JSON-RPC:

- it opens the thread (initialize, thread/start, or thread/resume with the
  conversation's thread id when it is carried on)
- prompts go in as turn/start, carrying the session's mode (approval
  policy and sandbox), model and effort; interrupt is turn/interrupt
- command and file-change approvals come to the chat as Allow / Always
  allow / Deny, Codex's questions as question cards, and anything else
  Codex asks gets an error so no turn waits for ever
- turn state comes from turn and item notifications, the draft from
  agentMessage deltas, and berthd's own Codex hooks stay quiet
- the conversation is read from the host's log
  (internal/transcript/codexhost.go), tool details included
- resume and the conversation list work for Codex conversations as for
  Claude's

Boxes list driver.codex; sessions and tasks take driver: "codex".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gh the agent client protocol

A generic ACP driver (internal/box/acpdriver.go) runs any agent whose
preset says how it speaks the Agent Client Protocol (AgentPreset.ACP:
opencode "acp", gemini "--acp", cursor-agent "acp"; a repository's own
agent can have one) under `berthd agent-host`:

- it opens the session: initialize, then session/resume or session/load
  with the conversation's id when it is carried on, else session/new,
  calling authenticate first when the agent asks for it (Cursor Agent)
- prompts are session/prompt, whose answer is the turn's end; Stop is
  session/cancel
- the agent's own modes (its mode config option, or session/set_mode)
  are offered with bypass beside them
- permission requests come to the chat as Allow / Always allow / Deny,
  picked by option kind since each agent names them its own way; bypass
  has berthd allow them, and opencode is started asking so that it does
- what else it asks of its client gets an error; streamed chunks make the
  draft and, gathered, the reply in the conversation
  (internal/transcript/acphost.go), with a tool's label updated once the
  agent says what it runs

Boxes list driver.acp; sessions and tasks take driver: "acp". The Labs
switch starts these agents structured too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat: opencode, gemini cli and cursor agent run structured too, through the agent client protocol
@vercel

vercel Bot commented Oct 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
berth Ready Ready Preview Oct 13, 2026 1:35pm UTC
berth-docs Ready Ready Preview Oct 13, 2026 1:35pm UTC

Request Review

@sean-brydon
sean-brydon merged commit c5dc94d into main Oct 13, 2026
7 of 8 checks passed
@linear-code

linear-code Bot commented Oct 13, 2026

Copy link
Copy Markdown

ENG-6011

@sean-brydon sean-brydon changed the title feat: structured codex and acp agents (lands #79 and #80 on main) feat: structured codex and acp agents on main, and the linux fixes for structured agents Oct 13, 2026

This branch was successfully deployed

2 active deployments
Preview – berth-docs — 8dcb8965 Deployed Oct 13, 2026 by vercel[bot]
Preview – berth — 8dcb8965 Deployed Oct 13, 2026 by vercel[bot]
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