Skip to content

fix: redesign compaction with tree branching and add thinking support#20

Merged
urmzd merged 1 commit intomainfrom
fix/thinking
Mar 30, 2026
Merged

fix: redesign compaction with tree branching and add thinking support#20
urmzd merged 1 commit intomainfrom
fix/thinking

Conversation

@urmzd
Copy link
Copy Markdown
Owner

@urmzd urmzd commented Mar 30, 2026

Summary

  • Redesign compaction to use tree branching: instead of mutating history in-place, compaction now forks a new branch off the tree root with summarized history, preserving the original branch untouched
  • Add thinking support to Ollama generation (falls back to thinking content when response is empty)
  • Fix sliding window compactor to preserve tool-call/tool-result pairs
  • Add configurable KeepLast parameter to SummarizeCompactor
  • Replace custom joinStrings with strings.Join in compressing assembler
  • Remove unused WithStore tree option

Test plan

  • Added persistCompacted unit tests (branch creation, too-short error)
  • Added tryCompact unit tests (no compactor, below threshold, success)
  • Added sliding window tool-pair integrity tests
  • Added SummarizeCompactor KeepLast configuration tests
  • Added MessagesToText tool use content tests
  • Updated existing integration test to verify branch forking behavior

Add support for Ollama's thinking field which allows models to
expose their reasoning process. When the model response is empty
but thinking is present, use the thinking as the response. This
enables better visibility into the model's reasoning for deep-
reasoning tasks.
@urmzd urmzd merged commit 0b9cdd3 into main Mar 30, 2026
6 checks passed
@urmzd urmzd deleted the fix/thinking branch March 30, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant