Repository navigation
fix(core): use the compaction agent's model for summaries - #52875
Closed
sergiopadure wants to merge 1 commit into
Closed
sergiopadure wants to merge 1 commit into
sergiopadure wants to merge 1 commit into
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
Author
|
Closing in favour of #53276, which merged a simpler version of this change for #44094. Thanks for picking it up, @rekram1-node. |
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.
Issue for this PR
Fixes #44094
Type of change
What does this PR do?
agents.compaction.modelis merged into thecompactionagent and shows up indebug agents, but nothing reads it: every compaction runs on the session model. Titles already honour their agent's model throughselectTitle; compaction had no equivalent.This adds
SessionContext.selectCompaction, which resolves the compaction agent's model the same wayselectTitledoes, and passes it assummaryModelon the manual, auto and overflow triggers. Incompact, only the summary request moves to that model: the transcript lowering, request, usage/cost and the recorded compaction message use it, and the request budget is capped by its window too. The decision when to compact stays on the session model, and provider-native compaction is unchanged (its window belongs to the session's provider). With no compaction model configured, or one that cannot be resolved, behaviour is the same as before.@kitlangton I saw the issue is assigned to you; happy to adjust or close this if you already have a fix in progress.
How did you verify your code works?
session-compaction.test.ts(request, output limit, cost and recorded model use the compaction model; native compaction ignores it) and a runner scenario insession-runner.test.ts(manual/compactsummarizes with the compaction model, the next prompt goes back to the session model). Auto and overflow pass the same value through the same call; only manual is covered end to end.bun typecheckinpackages/core, andsession-compaction,session-compact,session-native-compaction,session-title,session-compaction-transportandsession-runnertests all pass.Screenshots / recordings
Not a UI change.
Checklist