feat(readme): document provider prompt caching behavior and SmartAI cache integration

This commit is contained in:
2026-05-15 08:03:15 +00:00
parent 01df877480
commit 7b4184e88d
2 changed files with 8 additions and 0 deletions
+6
View File
@@ -7,6 +7,12 @@
### Features
- document provider prompt caching behavior and SmartAI cache integration (readme)
- Adds provider prompt caching to the feature list in the README
- Clarifies that provider-specific cache metadata is centralized in @push.rocks/smartai
## 2026-05-15 - 3.5.0
### Features
+2
View File
@@ -76,6 +76,7 @@ console.log(result.usage); // { inputTokens, outputTokens, totalTokens, cacheR
-**Parallel tool execution** — multiple tool calls in a single step are executed concurrently
- 🔧 **Auto-retry with backoff** — handles 429/529/503 errors with header-aware retry delays
- 🩹 **Tool call repair** — case-insensitive name matching + invalid tool sink prevents crashes
- 💰 **Provider prompt caching** — uses SmartAI cache helpers for Anthropic breakpoints and OpenAI cache affinity
- 📊 **Token and reasoning streaming**`onToken`, `onReasoning*`, and `onToolCall` callbacks for real-time progress
- 💥 **Context overflow handling** — detects overflow and invokes your `onContextOverflow` callback
@@ -168,6 +169,7 @@ const saved = result.toolCalls.some((call) =>
SmartAgent enables prompt-cache defaults by default:
- Cache behavior is provided by `@push.rocks/smartai`, so provider-specific cache metadata stays centralized there.
- Anthropic-compatible models get cache breakpoints on the first two system messages and the two most recent non-system messages.
- OpenAI models get `store: false` by default and, when `sessionId` is provided, `promptCacheKey: sessionId` with `promptCacheRetention: 'in_memory'`.
- Longer retention is opt-in. Use `cache: { retention: '24h' }` for OpenAI or `cache: { retention: '1h' }` for Anthropic.