Repository navigation
Conversation
Every Claude call now goes through an AI SDK middleware that sets two Anthropic cache breakpoints: the last system message (covers tool definitions and the system prompt) and the last message (rolling, so each step and each turn reads the previous prefix from cache). The production key showed zero cache reads over two months, so every step paid full input price. Wire tests capture the request body and check the breakpoints land. Sonnet 5 is the default model in the server, shared settings and the client store, per Ibraheem; Opus stays a per-chat choice. The budget note no longer calls tier 1 "the Opus budget", since a Sonnet-only student can use it up too. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AbJwLPGAUb8rEEDz2ZR2iq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PI currently defaults to Opus and sends reusable prompt prefixes without cache markers. This makes Sonnet 5.5 the default and adds Haiku 5.5, including the request in TIG-311.
Stacked on #34, which depends on #33. Merge order is #33, #34, then this PR.
Validation passed with the repository's example development variables.
npx wrangler typesnpm run typechecknpm test, 78 passed and 0 failednpm run buildgit diff --checkTests capture real SDK request bodies for all three models, including streaming and tool results, and cover budget selection and Haiku pricing thresholds. Provider responses are mocked. Live inference, signed-in UI behavior, and actual cache hits have not been verified. The installed Anthropic SDK accepts Haiku 5.5 through its compatibility path and emits an informational 128,000-token output-limit warning.
Implemented with Codex assistance.