Codex A2A runtime adapter
Project description
codex-a2a
Expose Codex through A2A.
codex-a2a adds an A2A runtime layer to the local Codex runtime, with auth, streaming, session continuity, interrupt handling, a built-in outbound A2A client, and a clear deployment boundary.
What This Is
- An A2A adapter service for the local Codex runtime, with inbound runtime exposure plus outbound peer calling.
- It supports both roles in one process: serving as an A2A Server and hosting an embedded A2A Client for
a2a_calland CLI-driven peer calls.
Architecture
flowchart TD
External["A2A Clients / a2a-client-hub / Gateways"]
subgraph Adapter["codex-a2a Runtime"]
Ingress["Inbound A2A Surface\nHTTP+JSON + JSON-RPC"]
Codex["Codex Runtime / Executor"]
Outbound["Embedded A2A Client\nCLI call + a2a_call"]
end
subgraph Peers["Peer A2A Services"]
PeerA2A["Peer A2A Agent"]
PeerRuntime["Peer Runtime"]
PeerA2A --> PeerRuntime
end
External -->|message/send,\nmessage:stream| Ingress
Ingress -->|task execution| Codex
Codex -->|stream events / tool results| Ingress
Codex -->|a2a_call tool| Outbound
Outbound -->|message/send,\nmessage:stream| PeerA2A
PeerA2A -->|task / stream result| Outbound
Quick Start
Install the released CLI with uv tool:
uv tool install codex-a2a
Upgrade later with:
uv tool upgrade codex-a2a
Install an exact release with:
uv tool install "codex-a2a==<version>"
Before starting the runtime:
- Install and verify the local
codexCLI itself. - Configure Codex with a working provider/model setup and any required credentials.
codex-a2adoes not provision Codex providers, login state, or API keys for you.- Startup fails fast if the local
codexruntime is missing or cannot initialize.
Self-start the released CLI against a workspace root:
A2A_BEARER_TOKEN="$(python -c 'import secrets; print(secrets.token_hex(24))')" \
A2A_HOST=127.0.0.1 \
A2A_PORT=8000 \
A2A_PUBLIC_URL=http://127.0.0.1:8000 \
A2A_DATABASE_URL=sqlite+aiosqlite:///./codex-a2a.db \
CODEX_WORKSPACE_ROOT=/abs/path/to/workspace \
codex-a2a
Agent Card: http://127.0.0.1:8000/.well-known/agent-card.json
Authenticated extended card:
- JSON-RPC:
agent/getAuthenticatedExtendedCard - HTTP:
GET /v1/card
Outbound peer auth is configured with A2A_CLIENT_BEARER_TOKEN or A2A_CLIENT_BASIC_AUTH; see the Usage Guide for the complete client-side matrix.
Highlights
- A2A HTTP+JSON endpoints such as
/v1/message:sendand/v1/message:stream - A2A JSON-RPC support on
POST / - Embedded client access through
codex-a2a call - Autonomous outbound peer calls through the
a2a_calltool - SSE streaming with normalized
text,reasoning, andtool_callblocks - Session continuity and session query extensions
- Interrupt lifecycle mapping and callback validation
- Transport selection, Agent Card discovery, timeout control, and bearer/basic auth for outbound A2A calls
- Payload logging controls, secret-handling guardrails, and released-CLI startup / source-based runtime paths
Boundaries
Portable vs Private Surface:
- Treat the core A2A send / stream / task methods plus Agent Card discovery as the portable baseline.
- Treat
codex.*methods andmetadata.codex.directoryas the Codex-specific control plane for Codex-aware clients. - Treat one deployed instance as a single-tenant trust boundary, not a hardened multi-tenant runtime.
The normative compatibility split and deployment model live in Compatibility Guide and Security Policy.
When To Use It
Use this project when:
- you want to keep Codex as the runtime
- you need A2A transports and Agent Card discovery
- you want a thin service boundary instead of building your own adapter
- you want inbound serving and outbound peer access in one deployable unit
Look elsewhere if:
- you need hard multi-tenant isolation inside one shared runtime
- you want this project to manage your process supervisor or host bootstrap
- you want a general client integration layer rather than a runtime adapter
Recommended Client Side
If you want a broader application-facing client integration layer, prefer a2a-client-hub.
It is a better place for higher-level client concerns such as A2A consumption, upstream adapter normalization, and application-facing integration, while codex-a2a stays focused on the runtime boundary around Codex plus embedded peer calling.
Further Reading
- Usage Guide Runtime configuration, outbound access, transport usage, and client examples.
- Extension Specifications Stable extension URI/spec index plus public-vs-extended card disclosure rules.
- Architecture Guide System structure, boundaries, and request flow.
- Compatibility Guide Supported Python/runtime surface, extension stability, and ecosystem-facing compatibility expectations.
- Security Policy Threat model, deployment caveats, and vulnerability disclosure guidance.
Development
For contributor workflow, validation, release handling, and helper scripts, see Contributing Guide and Scripts Reference. Use that workflow to create a PR from the working branch and merge into main after human review.
License
Apache License 2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codex_a2a-0.5.1.tar.gz.
File metadata
- Download URL: codex_a2a-0.5.1.tar.gz
- Upload date:
- Size: 284.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0ad847f8ab7adafed41b34bad76267aeec985b40ed73f92745a26086feac4e2
|
|
| MD5 |
2a592f852018aceb1ddd7a28dbb3d4c0
|
|
| BLAKE2b-256 |
3d248bf36b643379265510d42a5ab14c5518e579f32364b4bb59e6a5a2027e37
|
Provenance
The following attestation bundles were made for codex_a2a-0.5.1.tar.gz:
Publisher:
publish.yml on liujuanjuan1984/codex-a2a
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codex_a2a-0.5.1.tar.gz -
Subject digest:
a0ad847f8ab7adafed41b34bad76267aeec985b40ed73f92745a26086feac4e2 - Sigstore transparency entry: 1202161649
- Sigstore integration time:
-
Permalink:
liujuanjuan1984/codex-a2a@43501c25dec7c6ca2879d2bea792e164158f017e -
Branch / Tag:
refs/tags/v0.5.1 - Owner: https://github.com/liujuanjuan1984
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@43501c25dec7c6ca2879d2bea792e164158f017e -
Trigger Event:
push
-
Statement type:
File details
Details for the file codex_a2a-0.5.1-py3-none-any.whl.
File metadata
- Download URL: codex_a2a-0.5.1-py3-none-any.whl
- Upload date:
- Size: 149.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7861d763c7aefc40e54fdadcaa1981f8a995e49ca6498b51b909f6652d4a5e2
|
|
| MD5 |
acfc06906c7c87699cac7629a5edc72b
|
|
| BLAKE2b-256 |
cdcd7cdf6fb0a12b05ff8641035a989bf009da01f8f8c1c26498e78ce3179d69
|
Provenance
The following attestation bundles were made for codex_a2a-0.5.1-py3-none-any.whl:
Publisher:
publish.yml on liujuanjuan1984/codex-a2a
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codex_a2a-0.5.1-py3-none-any.whl -
Subject digest:
b7861d763c7aefc40e54fdadcaa1981f8a995e49ca6498b51b909f6652d4a5e2 - Sigstore transparency entry: 1202161650
- Sigstore integration time:
-
Permalink:
liujuanjuan1984/codex-a2a@43501c25dec7c6ca2879d2bea792e164158f017e -
Branch / Tag:
refs/tags/v0.5.1 - Owner: https://github.com/liujuanjuan1984
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@43501c25dec7c6ca2879d2bea792e164158f017e -
Trigger Event:
push
-
Statement type: