Skip to content

Agent adapter architecture

Each provider gets its own adapter under src/main/agents, owning transport-specific launch, event-mapping, and interaction-response behavior behind one shared interface.

Claude Code, Codex, and Antigravity each have their own adapter directory (src/main/agents/claude, codex, antigravity), and each is genuinely different under the hood — an adapter is not a thin wrapper over one common transport, it's the place where that difference is absorbed.

What an adapter owns

  • Launch options — how a session actually starts for this provider (SDK session creation for Claude Code and Codex, a node-pty spawn with specific launch flags for Antigravity).
  • Event mapping — translating the provider's native output into the shared agent event model.
  • Interaction response — how a permission or choice response gets sent back (a real SDK callback for Claude Code, none at all for Codex, a synthesized keystroke for Antigravity's PTY).
  • Stop/resume semantics — what "stop this task" and "resume this conversation" actually mean for that provider's transport.

Declared capabilities

An adapter declares what it supports (live model switching, live permission-mode switching, image attachments) rather than the UI assuming a uniform feature set — see Agent capabilities for what that looks like from the user side.