TUIからPauseする実装
This commit is contained in:
@@ -20,6 +20,13 @@ pub enum Method {
|
||||
PodEvent(PodEvent),
|
||||
Resume,
|
||||
Cancel,
|
||||
/// Stop the in-flight turn and transition to `Paused`.
|
||||
///
|
||||
/// Unlike `Cancel` (which discards and returns to `Idle`), a paused
|
||||
/// Pod can resume the interrupted work via `Resume`, or start a
|
||||
/// fresh turn via `Run` (orphan `tool_use` items are closed with a
|
||||
/// synthetic tool result before the new user message is appended).
|
||||
Pause,
|
||||
Shutdown,
|
||||
GetHistory,
|
||||
}
|
||||
@@ -265,6 +272,15 @@ mod tests {
|
||||
assert!(matches!(method, Method::Resume));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn method_pause_roundtrip() {
|
||||
let json = r#"{"method":"pause"}"#;
|
||||
let method: Method = serde_json::from_str(json).unwrap();
|
||||
assert!(matches!(method, Method::Pause));
|
||||
let serialized = serde_json::to_string(&method).unwrap();
|
||||
assert_eq!(serialized, json);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn event_text_delta_format() {
|
||||
let event = Event::TextDelta {
|
||||
|
||||
Reference in New Issue
Block a user