Sync rollback model-visible mode state across core and tui

This commit is contained in:
Charles Cunningham
2026-02-02 22:29:40 -08:00
parent c6dca12acf
commit 4b7b5cd7cc
9 changed files with 333 additions and 65 deletions
+12
View File
@@ -1979,6 +1979,18 @@ pub struct UndoCompletedEvent {
pub struct ThreadRolledBackEvent {
/// Number of user turns that were removed from context.
pub num_turns: u32,
/// Model-visible session state after rollback.
///
/// This lets clients synchronize UI mode/model indicators with core after history rewind.
/// Optional for backward compatibility with older persisted events.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub model_visible_state: Option<ModelVisibleState>,
}
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS)]
pub struct ModelVisibleState {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub collaboration_mode: Option<CollaborationMode>,
}
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)]