| 1 | use super::*; |
| 2 | use reqwest::StatusCode as HttpStatus; |
| 3 | |
| 4 | fn options_fixture() -> PathBuf { |
| 5 | Path::new(env!("CARGO_MANIFEST_DIR")) |
| 6 | .join("../engine/tests/fixtures/acp-options-agent.mjs") |
| 7 | .canonicalize() |
| 8 | .expect("the options fixture agent") |
| 9 | } |
| 10 | |
| 11 | fn with_query(base: &str, pairs: &[(&str, &str)]) -> reqwest::Url { |
| 12 | let mut url = reqwest::Url::parse(base).expect("a url"); |
| 13 | for (key, value) in pairs { |
| 14 | url.query_pairs_mut().append_pair(key, value); |
| 15 | } |
| 16 | url |
| 17 | } |
| 18 | |
| 19 | fn received(workspace: &Path) -> Vec<Value> { |
| 20 | fs::read_to_string(workspace.join("options-received.jsonl")) |
| 21 | .unwrap_or_default() |
| 22 | .lines() |
| 23 | .filter_map(|line| serde_json::from_str(line).ok()) |
| 24 | .collect() |
| 25 | } |
| 26 | |
| 27 | async fn wait_for_usage_total( |
| 28 | manager: &SharedRuntimeThreadManager, |
| 29 | thread_id: &str, |
| 30 | ) -> Result<RuntimeEventRecord> { |
| 31 | for _ in 0..600 { |
| 32 | let events = manager.events_since_async(thread_id, None).await?; |
| 33 | if let Some(event) = events.into_iter().find(|event| { |
| 34 | event.event == "turn.agent_usage" && event.payload["kind"] == "turn_total" |
| 35 | }) { |
| 36 | return Ok(event); |
| 37 | } |
| 38 | sleep(Duration::from_millis(50)).await; |
| 39 | } |
| 40 | bail!("the agent's usage was never recorded") |
| 41 | } |
| 42 | |
| 43 | async fn wait_for_idle_turn( |
| 44 | manager: &SharedRuntimeThreadManager, |
| 45 | thread_id: &str, |
| 46 | completed_turns: usize, |
| 47 | ) -> Result<()> { |
| 48 | for _ in 0..600 { |
| 49 | let events = manager.events_since_async(thread_id, None).await?; |
| 50 | let done = events |
| 51 | .iter() |
| 52 | .filter(|event| event.event == "turn.completed") |
| 53 | .count(); |
| 54 | let active = manager |
| 55 | .running_threads() |
| 56 | .await? |
| 57 | .into_iter() |
| 58 | .any(|row| row.thread_id == thread_id && !row.active_turns.is_empty()); |
| 59 | if done >= completed_turns && !active { |
| 60 | return Ok(()); |
| 61 | } |
| 62 | sleep(Duration::from_millis(25)).await; |
| 63 | } |
| 64 | bail!("the external turn did not settle to idle") |
| 65 | } |
| 66 | |
| 67 | #[tokio::test] |
| 68 | async fn the_options_route_offers_the_agents_choices_and_a_chosen_one_reaches_it() -> Result<()> { |
| 69 | let _env = lock_test_env(); |
| 70 | let _fixture = EnvVarGuard::set("CODEWHALE_ACP_FIXTURE_AGENT", options_fixture()); |
| 71 | let Some((addr, manager, handle)) = spawn_test_server().await? else { |
| 72 | return Ok(()); |
| 73 | }; |
| 74 | let client = codewhale_release::tls::reqwest_client(); |
| 75 | let workspace = tempfile::tempdir()?; |
| 76 | let cwd = workspace.path().canonicalize()?; |
| 77 | let url = format!("http://{addr}/v1/agents/external/fixture/options"); |
| 78 | |
| 79 | let offered: Value = client |
| 80 | .get(with_query(&url, &[("cwd", cwd.to_str().unwrap())])) |
| 81 | .send() |
| 82 | .await? |
| 83 | .error_for_status()? |
| 84 | .json() |
| 85 | .await?; |
| 86 | assert_eq!(offered["agent"]["id"], "fixture"); |
| 87 | let controls = offered["controls"].as_array().unwrap(); |
| 88 | let model = controls.iter().find(|c| c["id"] == "model").unwrap(); |
| 89 | let values: Vec<&str> = model["choices"] |
| 90 | .as_array() |
| 91 | .unwrap() |
| 92 | .iter() |
| 93 | .map(|c| c["value"].as_str().unwrap()) |
| 94 | .collect(); |
| 95 | assert!(values.len() >= 2, "{values:?}"); |
| 96 | let thought = controls |
| 97 | .iter() |
| 98 | .find(|c| c["kind"] == "config" && c["category"] == "thought_level") |
| 99 | .unwrap(); |
| 100 | let thought_values: Vec<&str> = thought["choices"] |
| 101 | .as_array() |
| 102 | .unwrap() |
| 103 | .iter() |
| 104 | .map(|c| c["value"].as_str().unwrap()) |
| 105 | .collect(); |
| 106 | assert_eq!(thought["id"], "config:effort"); |
| 107 | assert_eq!(thought["current"], "low"); |
| 108 | assert_eq!(thought_values, ["low", "high"]); |
| 109 | assert!(controls.iter().any(|c| c["id"] == "mode")); |
| 110 | assert!( |
| 111 | controls.iter().any(|c| c["id"] == "config:verbose" |
| 112 | && c["unavailable"]["code"] == "control_type_unsupported") |
| 113 | ); |
| 114 | assert!( |
| 115 | offered["actions"] |
| 116 | .as_array() |
| 117 | .unwrap() |
| 118 | .iter() |
| 119 | .any(|a| a["action"] == "thought_level_choice" && a["supported"] == true) |
| 120 | ); |
| 121 | assert!( |
| 122 | offered["actions"] |
| 123 | .as_array() |
| 124 | .unwrap() |
| 125 | .iter() |
| 126 | .any(|a| a["action"] == "steering" && a["supported"] == false) |
| 127 | ); |
| 128 | let leaked = fs::read_to_string(cwd.join("options-env.json"))?; |
| 129 | assert!(!leaked.contains("CODEWHALE_ACP_FIXTURE_AGENT")); |
| 130 | |
| 131 | for (query, status, code) in [ |
| 132 | (vec![], HttpStatus::BAD_REQUEST, None), |
| 133 | (vec![("cwd", "relative/dir")], HttpStatus::BAD_REQUEST, None), |
| 134 | ( |
| 135 | vec![("cwd", "/definitely/not/here")], |
| 136 | HttpStatus::NOT_FOUND, |
| 137 | None, |
| 138 | ), |
| 139 | ] { |
| 140 | let response = client.get(with_query(&url, &query)).send().await?; |
| 141 | assert_eq!(response.status(), status, "{query:?}"); |
| 142 | let body: Value = response.json().await?; |
| 143 | assert_eq!(body["error"]["code"].as_str(), code, "{body}"); |
| 144 | } |
| 145 | let unknown = client |
| 146 | .get(with_query( |
| 147 | &format!("http://{addr}/v1/agents/external/nope/options"), |
| 148 | &[("cwd", cwd.to_str().unwrap())], |
| 149 | )) |
| 150 | .send() |
| 151 | .await?; |
| 152 | assert_eq!(unknown.status(), HttpStatus::NOT_FOUND); |
| 153 | let body: Value = unknown.json().await?; |
| 154 | assert_eq!(body["error"]["code"], "unknown_agent"); |
| 155 | let bad_id = client |
| 156 | .get(with_query( |
| 157 | &format!("http://{addr}/v1/agents/external/..%2Fsh/options"), |
| 158 | &[("cwd", cwd.to_str().unwrap())], |
| 159 | )) |
| 160 | .send() |
| 161 | .await?; |
| 162 | assert!(bad_id.status().is_client_error()); |
| 163 | |
| 164 | let chosen = values[1]; |
| 165 | let created: Value = client |
| 166 | .post(format!("http://{addr}/v1/threads")) |
| 167 | .json(&json!({ |
| 168 | "workspace": cwd, |
| 169 | "permission_posture": "ask", |
| 170 | "executor": {"kind": "acp", "agent_id": "fixture", "thought_level": "high", "config": {"model": chosen}} |
| 171 | })) |
| 172 | .send() |
| 173 | .await? |
| 174 | .error_for_status()? |
| 175 | .json() |
| 176 | .await?; |
| 177 | let thread_id = created["id"].as_str().unwrap().to_string(); |
| 178 | assert_eq!(created["executor"]["thought_level"], "high"); |
| 179 | |
| 180 | let native_thread: Value = client |
| 181 | .post(format!("http://{addr}/v1/threads")) |
| 182 | .json(&json!({"workspace": cwd})) |
| 183 | .send() |
| 184 | .await? |
| 185 | .error_for_status()? |
| 186 | .json() |
| 187 | .await?; |
| 188 | let native_id = native_thread["id"].as_str().unwrap(); |
| 189 | let native_thought_refused = client |
| 190 | .patch(format!("http://{addr}/v1/threads/{native_id}")) |
| 191 | .json(&json!({"thought_level": "high"})) |
| 192 | .send() |
| 193 | .await?; |
| 194 | assert_eq!( |
| 195 | native_thought_refused.status(), |
| 196 | HttpStatus::FAILED_DEPENDENCY |
| 197 | ); |
| 198 | let native_thought_body: Value = native_thought_refused.json().await?; |
| 199 | assert_eq!(native_thought_body["error"]["code"], "unsupported_control"); |
| 200 | |
| 201 | let refused = client |
| 202 | .post(format!("http://{addr}/v1/threads/{thread_id}/turns")) |
| 203 | .json(&json!({"prompt": "x", "model": "other"})) |
| 204 | .send() |
| 205 | .await?; |
| 206 | assert_eq!(refused.status(), HttpStatus::FAILED_DEPENDENCY); |
| 207 | let body: Value = refused.json().await?; |
| 208 | assert_eq!(body["error"]["code"], "unsupported_control"); |
| 209 | |
| 210 | client |
| 211 | .post(format!("http://{addr}/v1/threads/{thread_id}/turns")) |
| 212 | .json(&json!({"prompt": "hello"})) |
| 213 | .send() |
| 214 | .await? |
| 215 | .error_for_status()?; |
| 216 | let total = wait_for_usage_total(&manager, &thread_id).await?; |
| 217 | wait_for_idle_turn(&manager, &thread_id, 1).await?; |
| 218 | assert_eq!(total.payload["source"], "agent reported"); |
| 219 | assert_eq!(total.payload["cost"], "unknown"); |
| 220 | assert_eq!(total.payload["tokens"]["total_tokens"], 150); |
| 221 | let log = received(&cwd); |
| 222 | let prompt = log |
| 223 | .iter() |
| 224 | .find(|e| e["method"] == "session/prompt") |
| 225 | .unwrap(); |
| 226 | assert_eq!(prompt["state"]["model"], chosen); |
| 227 | assert_eq!(prompt["state"]["effort"], "high"); |
| 228 | |
| 229 | let summaries: Vec<Value> = client |
| 230 | .get(format!("http://{addr}/v1/threads/summary")) |
| 231 | .send() |
| 232 | .await? |
| 233 | .error_for_status()? |
| 234 | .json() |
| 235 | .await?; |
| 236 | let summary = summaries |
| 237 | .iter() |
| 238 | .find(|row| row["id"] == thread_id) |
| 239 | .expect("thread summary"); |
| 240 | assert_eq!(summary["executor"]["model"], chosen); |
| 241 | assert_eq!(summary["executor"]["thought_level"], "high"); |
| 242 | assert_eq!(summary["model"], chosen); |
| 243 | |
| 244 | let rejected_provider = client |
| 245 | .patch(format!("http://{addr}/v1/threads/{thread_id}")) |
| 246 | .json(&json!({"model_provider": "openai"})) |
| 247 | .send() |
| 248 | .await?; |
| 249 | assert_eq!(rejected_provider.status(), HttpStatus::FAILED_DEPENDENCY); |
| 250 | let rejected_provider_body: Value = rejected_provider.json().await?; |
| 251 | assert_eq!( |
| 252 | rejected_provider_body["error"]["code"], |
| 253 | "unsupported_control" |
| 254 | ); |
| 255 | |
| 256 | let rejected_workspace = client |
| 257 | .patch(format!("http://{addr}/v1/threads/{thread_id}")) |
| 258 | .json(&json!({"model": values[2], "expected_workspace": "/nonexistent/other"})) |
| 259 | .send() |
| 260 | .await?; |
| 261 | assert_eq!(rejected_workspace.status(), HttpStatus::FORBIDDEN); |
| 262 | |
| 263 | let rejected_switch = client |
| 264 | .patch(format!("http://{addr}/v1/threads/{thread_id}")) |
| 265 | .json(&json!({"model": "model-z"})) |
| 266 | .send() |
| 267 | .await?; |
| 268 | assert_eq!(rejected_switch.status(), HttpStatus::FAILED_DEPENDENCY); |
| 269 | let rejected_body: Value = rejected_switch.json().await?; |
| 270 | assert_eq!(rejected_body["error"]["code"], "choice_not_offered"); |
| 271 | |
| 272 | let rejected_thought = client |
| 273 | .patch(format!("http://{addr}/v1/threads/{thread_id}")) |
| 274 | .json(&json!({"thought_level": "ultra"})) |
| 275 | .send() |
| 276 | .await?; |
| 277 | assert_eq!(rejected_thought.status(), HttpStatus::FAILED_DEPENDENCY); |
| 278 | let rejected_thought_body: Value = rejected_thought.json().await?; |
| 279 | assert_eq!(rejected_thought_body["error"]["code"], "choice_not_offered"); |
| 280 | |
| 281 | let switched_to = values[2]; |
| 282 | let switched: Value = client |
| 283 | .patch(format!("http://{addr}/v1/threads/{thread_id}")) |
| 284 | .json(&json!({"model": switched_to})) |
| 285 | .send() |
| 286 | .await? |
| 287 | .error_for_status()? |
| 288 | .json() |
| 289 | .await?; |
| 290 | assert_eq!(switched["executor"]["model"], switched_to); |
| 291 | assert_eq!(switched["executor"]["thought_level"], "high"); |
| 292 | assert_eq!(switched["model"], switched_to); |
| 293 | |
| 294 | let switched_thought: Value = client |
| 295 | .patch(format!("http://{addr}/v1/threads/{thread_id}")) |
| 296 | .json(&json!({"thought_level": "low"})) |
| 297 | .send() |
| 298 | .await? |
| 299 | .error_for_status()? |
| 300 | .json() |
| 301 | .await?; |
| 302 | assert_eq!(switched_thought["executor"]["model"], switched_to); |
| 303 | assert_eq!(switched_thought["executor"]["thought_level"], "low"); |
| 304 | |
| 305 | let updated_summaries: Vec<Value> = client |
| 306 | .get(format!("http://{addr}/v1/threads/summary")) |
| 307 | .send() |
| 308 | .await? |
| 309 | .error_for_status()? |
| 310 | .json() |
| 311 | .await?; |
| 312 | let updated_summary = updated_summaries |
| 313 | .iter() |
| 314 | .find(|row| row["id"] == thread_id) |
| 315 | .expect("updated thread summary"); |
| 316 | assert_eq!(updated_summary["executor"]["model"], switched_to); |
| 317 | assert_eq!(updated_summary["executor"]["thought_level"], "low"); |
| 318 | assert_eq!(updated_summary["model"], switched_to); |
| 319 | let events = manager.events_since_async(&thread_id, None).await?; |
| 320 | assert!(events.iter().any(|event| { |
| 321 | event.event == "thread.updated" |
| 322 | && event.payload["changes"]["executor"]["model"] == switched_to |
| 323 | && event.payload["changes"]["model"] == switched_to |
| 324 | })); |
| 325 | assert!(events.iter().any(|event| { |
| 326 | event.event == "thread.updated" |
| 327 | && event.payload["changes"]["executor"]["thought_level"] == "low" |
| 328 | })); |
| 329 | |
| 330 | client |
| 331 | .post(format!("http://{addr}/v1/threads/{thread_id}/turns")) |
| 332 | .json(&json!({"prompt": "second"})) |
| 333 | .send() |
| 334 | .await? |
| 335 | .error_for_status()?; |
| 336 | wait_for_idle_turn(&manager, &thread_id, 2).await?; |
| 337 | let second_log = received(&cwd); |
| 338 | let second_prompt = second_log |
| 339 | .iter() |
| 340 | .rfind(|e| e["method"] == "session/prompt") |
| 341 | .unwrap(); |
| 342 | assert_eq!(second_prompt["state"]["model"], switched_to); |
| 343 | assert_eq!(second_prompt["state"]["effort"], "low"); |
| 344 | |
| 345 | let long_valid_len = "x".repeat(100); |
| 346 | let long_unoffered = client |
| 347 | .patch(format!("http://{addr}/v1/threads/{thread_id}")) |
| 348 | .json(&json!({"thought_level": long_valid_len})) |
| 349 | .send() |
| 350 | .await?; |
| 351 | assert_eq!(long_unoffered.status(), HttpStatus::FAILED_DEPENDENCY); |
| 352 | let long_unoffered_body: Value = long_unoffered.json().await?; |
| 353 | assert_eq!(long_unoffered_body["error"]["code"], "choice_not_offered"); |
| 354 | |
| 355 | let too_long_thought = client |
| 356 | .patch(format!("http://{addr}/v1/threads/{thread_id}")) |
| 357 | .json(&json!({"thought_level": "x".repeat(129)})) |
| 358 | .send() |
| 359 | .await?; |
| 360 | assert_eq!(too_long_thought.status(), HttpStatus::BAD_REQUEST); |
| 361 | |
| 362 | let combined_failed = client |
| 363 | .patch(format!("http://{addr}/v1/threads/{thread_id}")) |
| 364 | .json(&json!({"model": values[0], "thought_level": "invalid"})) |
| 365 | .send() |
| 366 | .await?; |
| 367 | assert_eq!(combined_failed.status(), HttpStatus::FAILED_DEPENDENCY); |
| 368 | let combined_failed_body: Value = combined_failed.json().await?; |
| 369 | assert_eq!(combined_failed_body["error"]["code"], "choice_not_offered"); |
| 370 | |
| 371 | let after_rollback_summaries: Vec<Value> = client |
| 372 | .get(format!("http://{addr}/v1/threads/summary")) |
| 373 | .send() |
| 374 | .await? |
| 375 | .error_for_status()? |
| 376 | .json() |
| 377 | .await?; |
| 378 | let after_rollback_row = after_rollback_summaries |
| 379 | .iter() |
| 380 | .find(|row| row["id"] == thread_id) |
| 381 | .expect("thread summary after rollback"); |
| 382 | assert_eq!(after_rollback_row["executor"]["model"], switched_to); |
| 383 | assert_eq!(after_rollback_row["executor"]["thought_level"], "low"); |
| 384 | |
| 385 | client |
| 386 | .post(format!("http://{addr}/v1/threads/{thread_id}/turns")) |
| 387 | .json(&json!({"prompt": "after rollback"})) |
| 388 | .send() |
| 389 | .await? |
| 390 | .error_for_status()?; |
| 391 | wait_for_idle_turn(&manager, &thread_id, 3).await?; |
| 392 | let rollback_log = received(&cwd); |
| 393 | let rollback_prompt = rollback_log |
| 394 | .iter() |
| 395 | .rfind(|e| e["method"] == "session/prompt") |
| 396 | .unwrap(); |
| 397 | assert_eq!(rollback_prompt["state"]["model"], switched_to); |
| 398 | assert_eq!(rollback_prompt["state"]["effort"], "low"); |
| 399 | |
| 400 | assert!(manager.stop_external_agent(&thread_id).await?); |
| 401 | let plan_file = cwd.join("options-fixture.json"); |
| 402 | fs::write( |
| 403 | &plan_file, |
| 404 | json!({"efforts_by_model": {(values[0]): null}}).to_string(), |
| 405 | )?; |
| 406 | let stopped_switch: Value = client |
| 407 | .patch(format!("http://{addr}/v1/threads/{thread_id}")) |
| 408 | .json(&json!({"model": values[0]})) |
| 409 | .send() |
| 410 | .await? |
| 411 | .error_for_status()? |
| 412 | .json() |
| 413 | .await?; |
| 414 | assert_eq!(stopped_switch["executor"]["model"], values[0]); |
| 415 | assert!(stopped_switch["executor"]["thought_level"].is_null()); |
| 416 | |
| 417 | client |
| 418 | .post(format!("http://{addr}/v1/threads/{thread_id}/turns")) |
| 419 | .json(&json!({"prompt": "after stopped model switch"})) |
| 420 | .send() |
| 421 | .await? |
| 422 | .error_for_status()?; |
| 423 | wait_for_idle_turn(&manager, &thread_id, 4).await?; |
| 424 | let stopped_switch_log = received(&cwd); |
| 425 | let stopped_switch_prompt = stopped_switch_log |
| 426 | .iter() |
| 427 | .rfind(|e| e["method"] == "session/prompt") |
| 428 | .unwrap(); |
| 429 | assert_eq!(stopped_switch_prompt["state"]["model"], values[0]); |
| 430 | assert!(manager.stop_external_agent(&thread_id).await?); |
| 431 | fs::remove_file(&plan_file)?; |
| 432 | |
| 433 | let default_thread: Value = client |
| 434 | .post(format!("http://{addr}/v1/threads")) |
| 435 | .json(&json!({ |
| 436 | "workspace": cwd, |
| 437 | "executor": {"kind": "acp", "agent_id": "fixture"} |
| 438 | })) |
| 439 | .send() |
| 440 | .await? |
| 441 | .error_for_status()? |
| 442 | .json() |
| 443 | .await?; |
| 444 | let default_id = default_thread["id"].as_str().unwrap().to_string(); |
| 445 | client |
| 446 | .post(format!("http://{addr}/v1/threads/{default_id}/turns")) |
| 447 | .json(&json!({"prompt": "default model turn"})) |
| 448 | .send() |
| 449 | .await? |
| 450 | .error_for_status()?; |
| 451 | wait_for_idle_turn(&manager, &default_id, 1).await?; |
| 452 | let default_summary: Vec<Value> = client |
| 453 | .get(format!("http://{addr}/v1/threads/summary")) |
| 454 | .send() |
| 455 | .await? |
| 456 | .error_for_status()? |
| 457 | .json() |
| 458 | .await?; |
| 459 | let default_row = default_summary |
| 460 | .iter() |
| 461 | .find(|row| row["id"] == default_id) |
| 462 | .expect("default thread summary"); |
| 463 | assert_eq!(default_row["executor"]["model"], values[0]); |
| 464 | assert_eq!(default_row["executor"]["thought_level"], "low"); |
| 465 | assert_eq!(default_row["model"], values[0]); |
| 466 | |
| 467 | let stale = client |
| 468 | .post(format!("http://{addr}/v1/threads")) |
| 469 | .json(&json!({ |
| 470 | "workspace": cwd, |
| 471 | "executor": {"kind": "acp", "agent_id": "fixture", "config": {"model": "model-z"}} |
| 472 | })) |
| 473 | .send() |
| 474 | .await? |
| 475 | .error_for_status()? |
| 476 | .json::<Value>() |
| 477 | .await?; |
| 478 | let stale_id = stale["id"].as_str().unwrap(); |
| 479 | let response = client |
| 480 | .post(format!("http://{addr}/v1/threads/{stale_id}/turns")) |
| 481 | .json(&json!({"prompt": "x"})) |
| 482 | .send() |
| 483 | .await?; |
| 484 | assert_eq!(response.status(), HttpStatus::FAILED_DEPENDENCY); |
| 485 | let body: Value = response.json().await?; |
| 486 | assert_eq!(body["error"]["code"], "choice_not_offered"); |
| 487 | |
| 488 | let model_scoped: Value = client |
| 489 | .get(with_query( |
| 490 | &url, |
| 491 | &[("cwd", cwd.to_str().unwrap()), ("model", chosen)], |
| 492 | )) |
| 493 | .send() |
| 494 | .await? |
| 495 | .error_for_status()? |
| 496 | .json() |
| 497 | .await?; |
| 498 | assert_eq!( |
| 499 | model_scoped["controls"] |
| 500 | .as_array() |
| 501 | .unwrap() |
| 502 | .iter() |
| 503 | .find(|c| c["id"] == "model") |
| 504 | .unwrap()["current"], |
| 505 | values[0] |
| 506 | ); |
| 507 | assert!( |
| 508 | model_scoped["controls"] |
| 509 | .as_array() |
| 510 | .unwrap() |
| 511 | .iter() |
| 512 | .any(|c| c["id"] == "mode") |
| 513 | ); |
| 514 | let invalid_model_query = client |
| 515 | .get(with_query( |
| 516 | &url, |
| 517 | &[("cwd", cwd.to_str().unwrap()), ("model", "bad\nmodel")], |
| 518 | )) |
| 519 | .send() |
| 520 | .await?; |
| 521 | assert_eq!(invalid_model_query.status(), HttpStatus::BAD_REQUEST); |
| 522 | |
| 523 | handle.abort(); |
| 524 | Ok(()) |
| 525 | } |
| 526 |