feat: handle PostCompact hook event #225

Closed
opened 2026-03-20 08:25:46 -07:00 by hikari · 0 comments
Owner

Background

CLI v2.1.76 added a PostCompact hook that fires after context compaction completes.

Why It Matters for Hikari Desktop

Hikari Desktop tracks context window usage and has a disable_1m_context toggle. However, the UI currently has no signal that compaction has occurred mid-session. When compaction runs silently:

  • Token/cost counters in the stats panel may appear to reset unexpectedly
  • The character may stay in an active state during the compaction pause
  • Users are unaware that their context has been compacted, which can be surprising

Handling PostCompact allows us to:

  1. Show a brief toast or status-bar notice ("Context compacted")
  2. Refresh the context window stats display
  3. Potentially show a distinct character animation for compaction (or briefly use the success state)

Acceptance Criteria

  • PostCompact event parsed in wsl_bridge.rs and emitted to the frontend
  • Toast/notice displayed when compaction completes
  • Stats display refreshed after compaction
  • Tests for the new event type

This issue was created with help from Hikari~ 🌸

## Background CLI v2.1.76 added a `PostCompact` hook that fires after context compaction completes. ## Why It Matters for Hikari Desktop Hikari Desktop tracks context window usage and has a `disable_1m_context` toggle. However, the UI currently has no signal that compaction has occurred mid-session. When compaction runs silently: - Token/cost counters in the stats panel may appear to reset unexpectedly - The character may stay in an active state during the compaction pause - Users are unaware that their context has been compacted, which can be surprising Handling `PostCompact` allows us to: 1. Show a brief toast or status-bar notice ("Context compacted") 2. Refresh the context window stats display 3. Potentially show a distinct character animation for compaction (or briefly use the `success` state) ## Acceptance Criteria - [ ] `PostCompact` event parsed in `wsl_bridge.rs` and emitted to the frontend - [ ] Toast/notice displayed when compaction completes - [ ] Stats display refreshed after compaction - [ ] Tests for the new event type ✨ This issue was created with help from Hikari~ 🌸
naomi closed this issue 2026-03-23 14:28:09 -07:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/hikari-desktop#225