Skip to main content
This guide assumes familiarity with Axons and the Broker architecture.
The examples on this page use the object-oriented SDK surface: AsyncRunloopSDK in Python and RunloopSDK in TypeScript.

Overview

The Codex adapter connects Broker to a Codex CLI subprocess running in app-server mode inside your devbox. Broker speaks JSON-RPC to the Codex CLI and republishes Codex notifications into Axon.
Generate TypeScript types for the Codex protocol schema with codex app-server generate-ts --out ./schemas.

Broker mount configuration

{
  "type": "broker_mount",
  "axon_id": "<axon-id>",
  "protocol": "codex_app_server"
}
FieldTypeDescription
typestringMust be broker_mount
axon_idstringRequired. The Axon stream Broker reads from and writes to
protocolstringMust be codex_app_server

How Broker uses Codex

  • Broker launches Codex CLI in app-server mode when the Devbox starts
  • Codex initializes and sets up the session
  • Publish user.message to the Axon to start a turn
  • Broker forwards that message as a turn/start JSON-RPC request
  • Codex output is republished to Axon as turn.codex.<method> events
  • Broker auto-approves command execution and file change requests
  • Use broker.control.cancel to stop the active turn
Full examples coming soon.