feat(acp): advertise and switch llm models

This commit is contained in:
Yichen Jiang
2026-07-15 13:33:42 +08:00
parent 75331f03a6
commit f1d39921c9
94 changed files with 1657 additions and 191 deletions

View File

@@ -126,7 +126,7 @@ Durability is a plugin concern. Persistence backends buffer synchronous `session
Messages are arrays of typed content blocks (`text`, `reasoning`, `tool-call`, `tool-result`). The union derives from the merge-extensible `ContentBlockMap`; the same pattern types `MessageSource`, `FinishReason`, `TurnTrigger`, and `TurnEndReason`. New block types are coordinated across adapters, UI bridges, compaction pricing, and persistence, so block types remain a repo-wide contract.
Streaming uses raw chunks (`block-start` through `finish`) and `BlockAssembler`. The loop logs and assembles chunks, storing assistant provider/model provenance plus replay state. An `LlmAdapter` implements `stream()` and registers routes with `ctx.llm.registerAdapter(providers, adapter)`; requests route by `provider`, while the adapter resolves `model`. Replay state reaches a target only when both routes map to the same adapter instance, which owns validation and conversion. The contract lives in [llm-streaming.md](core-data-structures/llm-streaming.md).
Streaming uses raw chunks (`block-start` through `finish`) and `BlockAssembler`. The loop logs and assembles chunks, storing assistant provider/model provenance plus replay state. An `LlmAdapter` implements `stream()`, registers provider routes, and may expose advisory selector metadata; the adapter still resolves and validates model ids. Replay state reaches a target only when both routes map to the same adapter instance, which owns validation and conversion. The contract lives in [llm-streaming.md](core-data-structures/llm-streaming.md).
## Extension And Composition