Files
AirCoding/AirPlan/docs/architecture/adr/ADR-0008-use-anthropic-canonical-messages-with-provider-adapters.md
AirCoding 33a76a1ebc Move project from external drive to local NVMe
迁移路径: /run/media/airlongdian/EasyU/AirCoding -> /home/airlongdian/DataDevices/AirWorkSpace/AirCoding

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-02 09:51:49 +08:00

901 B
Executable File

ADR-0008: Use Anthropic Canonical Messages With Provider Adapters

  • Status: Accepted
  • Date: 2026-05-27

Context

AirCoding needs provider flexibility while preserving a stable internal representation for prompts, tools, messages, context compaction, and session persistence.

Decision

Use Anthropic canonical content blocks internally. ContextAssembler emits Anthropic canonical messages. Provider adapters convert at the LLM boundary to Anthropic, OpenAI, OpenRouter, ollama, or compatible endpoints.

Provider capability matrix controls whether a model can satisfy the task and whether conversion is lossless, lossy, or unsupported.

Consequences

  • Same-provider model switching has low conversion cost.
  • Cross-provider differences are localized to adapters.
  • Unsupported required features block before model call.
  • Tool/result/message persistence remains stable across providers.