[PR #5923] fix: update sidebar context size after /compact #11644

Closed
opened 2026-02-16 18:16:32 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/5923

State: closed
Merged: No


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

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/5923 **State:** closed **Merged:** No --- ## 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](https://github.com/code-yeongyu/oh-my-opencode)
yindo added the pull-request label 2026-02-16 18:16:32 -05:00
yindo closed this issue 2026-02-16 18:16:32 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11644