Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
a3224ce
docs: spec + plan for ModelMessage durable-compaction altitude
MyPrototypeWhat Jun 17, 2026
9f12c83
refactor(ai-sdk-middleware): export stringifyToolOutput for reuse
MyPrototypeWhat Jun 17, 2026
0b402ef
docs(plan): fix Task 2 round-trip fixtures to valid histories (ensure…
MyPrototypeWhat Jun 17, 2026
65259c9
feat(ai-sdk-middleware): ModelMessage <-> IR adapter
MyPrototypeWhat Jun 17, 2026
1ea8b41
test+docs(ai-sdk-middleware): pin approval-part ordering + clarify mo…
MyPrototypeWhat Jun 17, 2026
a47e0b2
refactor(ai-sdk-middleware): accept ai's LanguageModel in createCompr…
MyPrototypeWhat Jun 17, 2026
a020b0d
feat(ai-sdk-middleware): compactModelMessages + planCompactionModelMe…
MyPrototypeWhat Jun 17, 2026
a2ea1ae
feat(ai-sdk-middleware): summarizeModelMessages
MyPrototypeWhat Jun 17, 2026
9ee4880
feat(ai-sdk-middleware): export ModelMessage durable API; deprecate V…
MyPrototypeWhat Jun 17, 2026
df1bebf
docs(ai-sdk-middleware): ModelMessage durable API + deprecate V3 prom…
MyPrototypeWhat Jun 17, 2026
6c2654e
test+docs(ai-sdk-middleware): harden modified-tool-result tests; docu…
MyPrototypeWhat Jun 17, 2026
e453488
fix(ai-sdk-middleware): preserve inline tool-results, tool-msg provid…
MyPrototypeWhat Jun 17, 2026
8459eaf
docs(ai-sdk-middleware): repoint CompressOptions JSDoc to compactMode…
MyPrototypeWhat Jun 17, 2026
95bf00f
style(ai-sdk-middleware): biome-format new test files (CI lint fix)
MyPrototypeWhat Jun 17, 2026
55d5c27
chore(changeset): ai-sdk-middleware minor — ModelMessage durable comp…
MyPrototypeWhat Jun 17, 2026
ffc458c
docs(ai-sdk-middleware): clarify keepRecentTurns is message-level tur…
MyPrototypeWhat Jun 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/model-message-durable-compaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@context-chef/ai-sdk-middleware': minor
---

Add ModelMessage-altitude durable compaction.

`compactModelMessages`, `planCompactionModelMessages`, and `summarizeModelMessages` operate on `ModelMessage[]` — the message type `generateText`/`prepareStep` actually use — so you can run durable compaction directly against your own message store, or inside a `ToolLoopAgent` `prepareStep`. They reuse the provider-agnostic core engine, and `compactModelMessages` preserves the no-op reference-identity contract (returns the input array unchanged when there is nothing old enough to compact, so callers can skip persistence).

`createCompressionAdapter` now accepts `ai`'s `LanguageModel` (a model id string, or a V3/V2 model) — matching what `prepareStep`/`generateText` hand you — instead of only `LanguageModelV3`.

Deprecates the `LanguageModelV3Prompt`-typed `compactHistory` / `planCompaction` (still exported and fully working) in favor of the ModelMessage variants; they are slated for removal in the next major. `summarizeMessages` is unchanged.

Also fixes three round-trip issues in both AI-SDK adapters (V3 and ModelMessage): provider-executed (inline) tool-results no longer trigger a spurious `[No tool result available]` placeholder; tool-message-level `providerOptions` (e.g. Anthropic cache control) is now preserved; and a tool-call with `undefined` input serializes to `"{}"` instead of a non-string value.
Loading
Loading