Skip to content

fix: update sidebar context size after /compact#5923

Closed
code-yeongyu wants to merge 1 commit into
anomalyco:devfrom
code-yeongyu:fix/compact-context-sidebar-refresh
Closed

fix: update sidebar context size after /compact#5923
code-yeongyu wants to merge 1 commit into
anomalyco:devfrom
code-yeongyu:fix/compact-context-sidebar-refresh

Conversation

@code-yeongyu

Copy link
Copy Markdown
Contributor

Summary

  • Re-fetches session messages when session.compacted event is received, ensuring sidebar context size reflects post-compaction state

Root Cause

The TUI's sync.tsx event handler was missing a case for session.compacted event. After /compact completed, the new compaction message (with reduced token count) wasn't being fetched, leaving the sidebar showing stale pre-compaction context size.

Fix

Added a handler for session.compacted that calls sdk.client.session.messages() to refresh the message list, which the sidebar uses to calculate context size.

Closes #5760


🤖 GENERATED WITH ASSISTANCE OF OhMyOpenCode

Added a handler for session.compacted event that re-fetches messages after
compaction completes. This ensures the sidebar context size is properly updated
when the /compact command is executed.

🤖 Generated with assistance of OhMyOpenCode
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.

Context size in sidebar not updated after /compact

1 participant