Harness adapters
How native harnesses fit the shared server and WebUI contract.
Claude Code, Codex, OpenCode, pi, Hermes, and OpenClaw are peers inside one application. A conversation selects one adapter; no harness owns a separate page, port, package, or message store.
Adapter boundary
Each implementation in artifacts/src/server/harnesses exposes discovery metadata, optional Profile options, native turn startup, cancellation, approvals, and capability flags. Its native events are converted to AI SDK UI-message chunks without flattening text, reasoning, tool input, or approval boundaries.
| Harness | Connection | Distinctive behavior |
|---|---|---|
| Claude Code | Agent SDK | Fine-grained text/thinking/tool events and native permission callback |
| Codex | codex app-server JSON-RPC | Native plans, command/file/network approvals, and native Profile files |
| OpenCode | Local OpenCode SDK server | Text/reasoning deltas, tool snapshots, and provider/model overrides |
| pi | Bundled pi SDK | Raw tool argument deltas and SDK-level execution approval hook |
| Hermes | Headless JSON-RPC gateway | Session resume, reasoning/tool events, and gateway approvals |
| OpenClaw | Pinned Gateway client | Gateway sessions and guarded metadata enrichment |
Profiles
The Profile API is shared, while each adapter owns its fields. Codex reads and preserves native <name>.config.toml files; Claude Code supports main and subagent models, effort, Base URL, and API credentials; OpenCode and pi expose provider/model settings; Hermes and OpenClaw expose gateway and model overrides. Profile edits are captured for the next turn and never rewrite unrelated native configuration.
Metadata generation uses a disposable branch or fork with tools disabled. It cannot change the main session's history, files, or provider affinity. If metadata fails, the main response remains intact.