aboutsummaryrefslogtreecommitdiff
path: root/src/api/schema/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/schema/tests.rs')
-rw-r--r--src/api/schema/tests.rs26
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]