Using ACP-compatible harnesses in the AI SDK harness layer
Key point
The AI SDK harness layer now supports ACP-compatible harnesses via the new @ai-sdk/harness-acp package.
Details
The AI SDK harness layer has started supporting Agent Client Protocol (ACP)-compatible harnesses through the new @ai-sdk/harness-acp package.
Previously, each harness adapter had to individually wrap specific runtimes (such as Claude Code, Codex, Pi, etc.). In contrast, the new package acts as a meta adapter that wraps the protocol itself. This allows for the flexible construction of adapters for any harness that provides an ACP-compatible package.
The implementation is as follows:
- Use createACP to pass in the package and configure the basic harness mapping.
- Pass the configured harness to HarnessAgent for use.
However, for cases where direct adapters already exist, such as Claude Code or Codex, it is recommended to use the dedicated adapters (@ai-sdk/harness-claude-code, @ai-sdk/harness-codex) for tighter integration. @ai-sdk/harness-acp is best utilized when working with harnesses that do not have dedicated adapters.