chore: handle fast_mode_state field in stream-json messages (v2.1.81) #245

Closed
opened 2026-03-23 14:22:33 -07:00 by hikari · 1 comment
Owner

Context

Claude Code v2.1.81 stream-json output now includes a "fast_mode_state" field in init, assistant, and result messages. Example:

{ "type": "assistant", ..., "fast_mode_state": "off" }
{ "type": "result", ..., "fast_mode_state": "off" }
{ "type": "system", "subtype": "init", ..., "fast_mode_state": "off" }

Why This Matters

Rust's serde ignores unknown fields by default, so this won't cause a parse failure — but we should decide whether to:

  1. Explicitly add fast_mode_state to our type definitions in src-tauri/src/types.rs
  2. Surface it in the UI (e.g. a "fast mode" indicator, or use it to adjust character state)
  3. Simply confirm it's safely ignored and document that decision

Tasks

  • Review src-tauri/src/types.rs structs for init, assistant, and result messages
  • Decide whether to model fast_mode_state explicitly
  • If surfacing in UI, add indicator to the frontend
  • Add tests for any new type fields

References

  • Claude Code v2.1.81 stream-json sample output
  • src-tauri/src/types.rs

This issue was created with help from Hikari~ 🌸

## Context Claude Code v2.1.81 stream-json output now includes a `"fast_mode_state"` field in `init`, `assistant`, and `result` messages. Example: ```json { "type": "assistant", ..., "fast_mode_state": "off" } { "type": "result", ..., "fast_mode_state": "off" } { "type": "system", "subtype": "init", ..., "fast_mode_state": "off" } ``` ## Why This Matters Rust's `serde` ignores unknown fields by default, so this won't cause a parse failure — but we should decide whether to: 1. Explicitly add `fast_mode_state` to our type definitions in `src-tauri/src/types.rs` 2. Surface it in the UI (e.g. a "fast mode" indicator, or use it to adjust character state) 3. Simply confirm it's safely ignored and document that decision ## Tasks - [ ] Review `src-tauri/src/types.rs` structs for `init`, `assistant`, and `result` messages - [ ] Decide whether to model `fast_mode_state` explicitly - [ ] If surfacing in UI, add indicator to the frontend - [ ] Add tests for any new type fields ## References - Claude Code v2.1.81 stream-json sample output - `src-tauri/src/types.rs` ✨ This issue was created with help from Hikari~ 🌸
Author
Owner

Resolved in PR #263. Added fast_mode_state: Option<String> to ClaudeMessage::Result in types.rs with #[serde(default)] for forward-compatibility. Field is destructured in the wsl_bridge.rs Result match arm and logged at debug level. Tests included.

Resolved in PR #263. Added `fast_mode_state: Option<String>` to `ClaudeMessage::Result` in `types.rs` with `#[serde(default)]` for forward-compatibility. Field is destructured in the `wsl_bridge.rs` Result match arm and logged at debug level. Tests included. ✨
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#245