Repository navigation
feat(server): compact idle Scient Agent threads before the cache expires - #923
Merged
2 commits merged intoNov 14, 2026
Merged
2 commits merged into
2 commits merged into
Conversation
Scient Agent now reports the prompt-cache entry each reply confirmed (tier, touch time, lifetime) on its message_end. Desktop turns a one-hour entry into promptCacheExpiresAt on the turn's token usage, the field the Claude path already fills. Idle compaction then works for Scient Agent as it does for Claude: "Before the cache expires" sends /compact two minutes before the cache lapses on a thread over 200,000 tokens, and "When you return" offers the Compact chip once the cache has expired. A five-minute entry carries no expiry, so a short pause never triggers a compaction, and a cache that never expires reports none. Scient Agent instances get the same "Compact idle threads" override as Claude ones, and the setting text names both. Agents that do not report the entry keep today's behaviour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The event schemas dropped promptCache, so idle compaction never saw the cache expiry in the live app. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Other scenariosAll 64 scenario measurements match All 64 scenario measurements
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
This was referenced Nov 14, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 14, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to it being already merged
Nov 14, 2026
92a8b80
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.
Platforms: the same server code on macOS, Windows and Linux; no platform-specific parts. Tested live on macOS only.
What
"Compact idle threads" now works for Scient Agent as it does for Claude.
message_end(feat(rpc): tell hosts when the prompt cache expires scient-agent#59). Desktop turns a one-hour entry intopromptCacheExpiresAton the turn's token usage, the field the Claude path already fills (provider/omp/OmpPromptCache.ts).IdleCompaction/IdleCompactionServiceand the composer's resume check now accept Scient Agent instances (compactsIdleThreadsin contracts)./compacttwo minutes before the cache lapses on a thread over 200,000 tokens. When you return offers the Compact chip, as for Claude.effect-omp-rpcevent schemas keep the newpromptCachefield; before this they dropped it.Older agents: today's agent (0.1.10) sends no
promptCache, so nothing changes until the next agent release.T3 files change only inside SCIENT-FORK seams.
Merge order: #923 → #924 → #925 → #926, all based on
mainand queued in that order; each branch sits on the one before it, so its diff shrinks to its own change as they merge.Tests
IdleCompaction.scient.test.ts: compaction two minutes before a one-hour cache the agent reported expires; never for a five-minute cache or an agent that reports none; the per-instance override.contextWindow.scient.test.ts: the Compact-on-return chip for Scient Agent.IdleCompaction*.test.ts,serverSettings.test.ts,OmpAdapterV2.test.ts,contextWindow.scient.test.ts(308 pass), rootpnpm run typecheck,vp fmt --check,vp lint, seam check and provenance.reviews/scient-agent-next-20261111/build-all-20261113/agentmodes-RECORD.mdin the ScientFactory workspace.🤖 Generated with Claude Code