Repository navigation
feat(rpc): tell hosts when the prompt cache expires - #59
Merged
Merged
Conversation
An assistant reply's message_end now carries promptCache: the tier, touch time and lifetime of the prompt-cache entry its response confirmed, while the next request would still read it. The session already tracks this entry for the status line and the cache warmer. Scient Desktop compacts an idle thread just before a one-hour entry expires, so the summary reads a warm cache instead of the next message re-writing the whole context. It needs the expiry to do that. The field is left out for an inferred entry, a changed conversation and a cache that never expires (logged-in Codex). The agent's own idle compaction stays a terminal feature, so the two never race. Hosts that do not read the field are unaffected. Scient-Divergence: SA-PROMPT-CACHE Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Scient-Generator: rpc Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 14, 2026
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.
An assistant reply's RPC
message_endframe now carriespromptCache: the tier, touch time and lifetime of the prompt-cache entry its response confirmed. Scient Desktop needs this to compact an idle thread just before a one-hour cache expires, so the summary reads a warm cache instead of re-writing the whole context on the next message.What's new
message_endfor an assistant reply getspromptCache: { tier: "short" | "long", touchedAt, ttlMs }while the next request would still read the entry.src/scient/prompt-cache.ts; one marked hook inrpc-mode.tsandwire/events.ts. Clients regenerated in a separate(generated)commit.Desktop: ScientFactory/scient-desktop#923 (idle compaction). Plan mode on top: #60 here, ScientFactory/scient-desktop#925. Desktop sets an expiry only for
longentries.Checked
bun test test/scient/prompt-cache.test.ts test/rpc-prompt-result.test.tspass, with the rest of the stack's tests (49).bun run check:tspasses (no warnings in touched files). Divergence check (stack top): 34 commits, all accounted for, 7 generated commits match their generators.reviews/scient-agent-next-20261111/build-all-20261113/agentmodes-RECORD.mdin the ScientFactory workspace.Platforms: no platform-specific code. Tested on macOS only; Windows and Linux run the same code, covered by CI.
Release: ships in the next Scient Agent release, which is held until #53 merges.
Scient-Divergence: SA-PROMPT-CACHE
🤖 Generated with Claude Code