Skip to content

fix(compaction): handle immutable session history#192

Merged
alexk-dev merged 1 commit intomainfrom
fix/compact-immutable-session-history
Mar 18, 2026
Merged

fix(compaction): handle immutable session history#192
alexk-dev merged 1 commit intomainfrom
fix/compact-immutable-session-history

Conversation

@alexk-dev
Copy link
Owner

Summary

  • fix /compact so compaction no longer mutates session.getMessages() in place
  • switch the mutation path to AgentSession.mutableMessages() before clearing/rebuilding history
  • add a regression test covering immutable session message lists

Root Cause

CompactionOrchestrationService assumed session.getMessages() was always mutable and called clear() directly. When the session history list was immutable, /compact failed with java.lang.UnsupportedOperationException.

Testing

  • ./mvnw -Dmaven.gitcommitid.skip=true -Dtest=CompactionOrchestrationServiceTest,CommandRouterTest test

@sonarqubecloud
Copy link

@alexk-dev alexk-dev merged commit 6f62222 into main Mar 18, 2026
17 checks passed
@alexk-dev alexk-dev deleted the fix/compact-immutable-session-history branch March 18, 2026 17:22
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