Closed
Conversation
4aa734a to
395b76b
Compare
Contributor
|
Not really in favour of changing the defaults, new behaviour ought be opt-in IMO. |
41c4df7 to
e51bdba
Compare
Contributor
Author
Fixed it. Thank you for the feedback. |
Contributor
Author
|
Removed. |
34f527b to
42de421
Compare
Adds a new 'collapse' compaction mode that preserves recent context while summarizing older messages. Unlike standard compaction which summarizes the entire conversation, collapse extracts the oldest 65% of tokens, summarizes them at a breakpoint, and leaves the newest 35% untouched. Changes: - Add processCollapse() for breakpoint-based summarization - Add Identifier.createLike() for inserting messages at past timestamps - Add detectFormat() for backward compatibility with existing sessions - Add configurable ratios: trigger (0.85), extractRatio (0.65), recentRatio (0.15) - Add TUI toggle for switching between standard/collapse modes - Fix isOverflow() to include cache.write tokens - Fix link.tsx underline prop error from anomalyco#6317 Default remains 'standard' - users can opt-in to collapse via config or TUI toggle.
Adds support for merging historical context from previous compaction summaries into new collapse summaries. This prevents loss of important information across multiple compaction cycles. New config options: - summaryMaxTokens: target token count for summary output (default: 10000) - previousSummaries: number of previous summaries to include (default: 3) Changes: - Add getPreviousSummaries() to fetch historical summaries from unfiltered messages - Add extractSummaryText() to extract text content from summary parts - Update collapse prompt to include previous summaries section - Add merge instructions to preserve historical context
…arent-child message references When forking a session, message IDs are regenerated but parentID references in assistant messages were not updated to point to the new IDs. This broke features that rely on parent-child relationships, such as compaction breakpoints. ## Problem Forking a compacted session would fail with: ``` prompt is too long: 203573 tokens > 200000 maximum ``` The forked session didn't honor the compaction breakpoint because the parent-child message relationships were broken. ## Fix Added an ID mapping that tracks old ID -> new ID, then updates parentID references when cloning assistant messages. ## Changes - packages/opencode/src/session/index.ts - Add ID mapping in fork function to preserve parent-child relationships
…cture - Calculate available token budget before fetching previous summaries - Use XML-style delimiters for clearer prompt structure - Add debug logging with [BUDGET_CALC] tag for troubleshooting - Prevents context overflow when including previous summaries
5556eef to
61694c4
Compare
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. |
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.
Removed.