fix(session): compact finished overflowed turns#27730
Conversation
|
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. |
|
The following comment was made by an LLM, it may be inaccurate: Based on the search results, I found one related PR that may be worth reviewing alongside this one: Related PR:
The other PRs found (#15130, #14743, #10123, #20491, #21567) are related to compaction more broadly but don't appear to be duplicates of the current PR's specific fix. No true duplicate PRs found for this specific issue (the current PR #27730 is correctly excluded from the results). PR #20247 is the closest related work on overflow compaction logic. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
48f3e3b to
7d74948
Compare
|
Rebased on the latest dev and resolved the conflict. Local validation passed:\n\n- bun test test/session/prompt.test.ts test/session/compaction.test.ts --timeout 30000\n- pre-push typecheck via bun turbo typecheck\n\nThe required CI workflows are still waiting for maintainer approval. Would appreciate approval/review when you get a chance. Thanks! |
Issue for this PR
Fixes #15533
Related: #20247
Type of change
What does this PR do?
Auto-compaction had two adjacent edge cases when the assistant had already finished normally:
Continue...prompt and start another agent response instead of waiting for the next real user message.This PR moves the finished-turn overflow check before the normal loop exit and skips synthetic auto-continue when the last non-summary assistant has already finished with a non-tool-call finish reason.
How did you verify your code works?
bun test test/session/prompt.test.ts --timeout 30000bun test test/session/compaction.test.ts --timeout 30000bun run typecheckScreenshots / recordings
N/A — not a UI change.
Checklist