fix(opencode): reject empty compaction summaries - #42063
fix(opencode): reject empty compaction summaries#42063vladislav-miroshnikov wants to merge 1 commit into
Conversation
Treat a successful compaction processor result without non-empty text as a failed summary. Persist an error and stop before tail, replay, auto-continue, or compacted-event side effects so a fresh failed attempt cannot hide history. Add a reasoning-only regression and make the successful processor test fake persist a valid summary.
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one potentially related PR: Related PR:
All other results either returned the current PR itself (#42063) or are unrelated to compaction summary handling. |
|
Really miss that fix! |
|
missed many i have fixed all these in #41663 ... entropy is fast ... conflicts already heading down the wrong path |
|
@josephtingiris |
|
thx. it closes many others too just haven't had the time to link it all up here. hoping for help from the community. deterministic is more reliable in the long run. |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #41571
Type of change
What does this PR do?
A compaction model can finish with reasoning but no text summary. V1 currently treats that as success, which can hide the previous history behind an empty summary boundary.
This marks the summary as errored and stops before tail, replay, auto-continue, or the compacted event — so a fresh failed attempt cannot filter away earlier messages. It's limited to the safety invariant; #41663 explores the larger structured-input alternative.
How did you verify your code works?
cd packages/opencode && bun test test/session/compaction.test.ts— 54 pass, 1 skip, 0 failcd packages/opencode && bun typecheckgit diff --checkThe regression drives a reasoning-only processor response and verifies the error state, stopped result, absent compacted event, and retained history.
Checklist