opencode
opencode copied to clipboard
Separate context window and session stats in sidebar
Issue
On some /compact instances the session costs would be reset and the token count isn't ongoing which is nice for visuals.
Summary
- Split the sidebar Context section into two: Context (current window) and Session (cumulative)
- Context shows tokens and % used from the last assistant message (resets on compaction)
- Session shows total tokens across all messages and cumulative spend (only increases)
- Improves visibility into both current context usage and overall session costs
Changes
- Added
sessionTokensmemo that sums tokens from all assistant messages - Moved spend to Session section alongside total tokens
- Kept Context section focused on current LLM context window