feat(snapcompact): implemented model-aware compaction billing and frame-size resolution

- Implemented model-specific frame-size billing for Anthropic, OpenAI, and Google.
- Changed compaction shape resolution to bind model variants to ideal frame sizes.
- Updated tests and docs to reflect new frame-size and budget behavior.
This commit is contained in:
can1357
2026-06-12 09:27:03 +02:00
parent a9229b0f26
commit b845ef6362
8 changed files with 594 additions and 59 deletions
@@ -426,7 +426,7 @@ describe("estimateInlineSavings", () => {
expect(estimate.visionCapable).toBe(true);
expect(estimate.systemPrompt?.applied).toBe(true);
expect(estimate.systemPrompt?.frames).toBe(2);
expect(estimate.systemPrompt?.imageTokens).toBe(2 * 3300);
expect(estimate.systemPrompt?.imageTokens).toBe(2 * snapcompact.SHAPES.anthropic.frameTokenEstimate);
expect(estimate.systemPrompt?.savedTokens).toBe(
estimate.systemPrompt!.textTokens - estimate.systemPrompt!.imageTokens,
);