diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-19 23:52:20 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-19 23:56:07 +0300 |
| commit | 3f80947678a9723434aa7fddfe23750b5393e24c (patch) | |
| tree | 6f463797132acfc51dfb6e135820a052954b4f13 /src/api/schema/tests.rs | |
| parent | f76f895efe5b9f19aa9db909354c6c0f2195630b (diff) | |
feat: make agent automation a first-class cli primitive
Diffstat (limited to 'src/api/schema/tests.rs')
| -rw-r--r-- | src/api/schema/tests.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/api/schema/tests.rs b/src/api/schema/tests.rs index 232c2b73..236d4f12 100644 --- a/src/api/schema/tests.rs +++ b/src/api/schema/tests.rs @@ -86,6 +86,7 @@ fn agent_start_and_prompt_requests_round_trip() { method: Method::AgentPrompt(AgentPromptParams { target: "reviewer".into(), text: "review this".into(), + wait: None, }), }; let prompt_json = serde_json::to_value(&prompt).unwrap(); @@ -94,6 +95,31 @@ fn agent_start_and_prompt_requests_round_trip() { serde_json::from_value::<Request>(prompt_json).unwrap(), prompt ); + + let prompt_and_wait = Request { + id: "prompt-and-wait".into(), + method: Method::AgentPrompt(AgentPromptParams { + target: "reviewer".into(), + text: "review this".into(), + wait: Some(AgentPromptWaitOptions { + until: vec![AgentStatus::Idle, AgentStatus::Done], + timeout_ms: Some(120_000), + }), + }), + }; + let prompt_and_wait_json = serde_json::to_value(&prompt_and_wait).unwrap(); + assert_eq!( + prompt_and_wait_json["params"]["wait"]["until"], + serde_json::json!(["idle", "done"]) + ); + assert_eq!( + prompt_and_wait_json["params"]["wait"]["timeout_ms"], + 120_000 + ); + assert_eq!( + serde_json::from_value::<Request>(prompt_and_wait_json).unwrap(), + prompt_and_wait + ); } #[test] |
