複数クライアント間でのRunメソッドの同期漏れ

This commit is contained in:
2026-04-21 23:59:49 +09:00
parent d3ba0a299a
commit ef294eeb68
3 changed files with 48 additions and 5 deletions
+12 -5
View File
@@ -72,11 +72,10 @@ impl App {
}
return None;
}
self.turn_index += 1;
self.blocks.push(Block::TurnHeader {
turn: self.turn_index,
});
self.blocks.push(Block::UserMessage { text: text.clone() });
// TurnHeader / UserMessage blocks are pushed in response to
// `Event::UserMessage` (single source of truth, shared by every
// client subscribed to the Pod). Locally we only clear the
// input buffer and forward the method.
self.input.clear();
Some(Method::Run { input: text })
}
@@ -91,6 +90,14 @@ impl App {
pub fn handle_pod_event(&mut self, event: Event) {
match event {
Event::UserMessage { text } => {
self.turn_index += 1;
self.blocks.push(Block::TurnHeader {
turn: self.turn_index,
});
self.blocks.push(Block::UserMessage { text });
self.assistant_streaming = false;
}
Event::TurnStart { .. } => {
self.running = true;
self.paused = false;