feat: handle new StopFailure hook event for API error turns #224

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

Background

CLI v2.1.78 added a StopFailure hook event that fires when a turn ends due to an API-level error (rate limit, authentication failure, etc.) rather than a normal completion.

Why It Matters for Hikari Desktop

Currently Hikari Desktop has no dedicated signal for "turn ended because of an API error" versus "turn ended normally". When an API error terminates a turn:

  • The character remains in whatever active state it was in (thinking, coding, etc.) instead of transitioning to the error state
  • No toast or status-bar message is surfaced to tell the user why the session stopped
  • The user may try to re-send a message without understanding the session has failed

Handling StopFailure allows us to:

  1. Transition the character to the error state
  2. Display an informative toast/notification (e.g. "Session stopped: rate limit reached")
  3. Update the status bar to reflect the failure

Acceptance Criteria

  • StopFailure event parsed in wsl_bridge.rs
  • Character transitioned to error state on receipt
  • Toast displayed with the error reason when available
  • Status bar updated
  • Tests for the new event type

This issue was created with help from Hikari~ 🌸

## Background CLI v2.1.78 added a `StopFailure` hook event that fires when a turn ends due to an API-level error (rate limit, authentication failure, etc.) rather than a normal completion. ## Why It Matters for Hikari Desktop Currently Hikari Desktop has no dedicated signal for "turn ended because of an API error" versus "turn ended normally". When an API error terminates a turn: - The character remains in whatever active state it was in (thinking, coding, etc.) instead of transitioning to the `error` state - No toast or status-bar message is surfaced to tell the user why the session stopped - The user may try to re-send a message without understanding the session has failed Handling `StopFailure` allows us to: 1. Transition the character to the `error` state 2. Display an informative toast/notification (e.g. "Session stopped: rate limit reached") 3. Update the status bar to reflect the failure ## Acceptance Criteria - [ ] `StopFailure` event parsed in `wsl_bridge.rs` - [ ] Character transitioned to `error` state on receipt - [ ] Toast displayed with the error reason when available - [ ] Status bar updated - [ ] 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#224