mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-26 01:39:51 +01:00
style(runner): rustfmt the sidecar rejection tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3cbfa500f4
commit
a11d23a7e9
2 files changed
+42
-11
No files matched your search
@@ -2553,7 +2553,10 @@ mod mode_tests {
|
||||
let open = session_open_params(&swarm, &[]);
|
||||
assert_eq!(open["candidateAdmission"], json!(admission));
|
||||
assert_eq!(open["mode"], json!("swarm"));
|
||||
assert_eq!(initialize_params(&swarm)["candidateAdmission"], json!(admission));
|
||||
assert_eq!(
|
||||
initialize_params(&swarm)["candidateAdmission"],
|
||||
json!(admission)
|
||||
);
|
||||
for (field, value) in [
|
||||
("run", "different-run"),
|
||||
("session", "different-session"),
|
||||
|
||||
+38
-10
@@ -305,23 +305,48 @@ fn session_open_rejection_keeps_the_sidecar_code_and_reason_outside_the_error_te
|
||||
let mut sidecar = transport("remote-error", Duration::from_secs(1));
|
||||
for (code, classification) in [
|
||||
("ACPX_SIDECAR_REQUEST_INVALID", "sidecar_request_invalid"),
|
||||
("ANTIGRAVITY_SWARM_UNAVAILABLE", "antigravity_swarm_unavailable"),
|
||||
("ANTIGRAVITY_SWARM_SIGN_IN_REQUIRED", "antigravity_swarm_sign_in_required"),
|
||||
("ANTIGRAVITY_SWARM_RECEIPT_MISMATCH", "antigravity_swarm_receipt_mismatch"),
|
||||
("ANTIGRAVITY_SWARM_WORKSPACE_ESCAPE", "antigravity_swarm_workspace_escape"),
|
||||
("ANTIGRAVITY_SWARM_HELPERS_TIMEOUT", "antigravity_swarm_helpers_timeout"),
|
||||
("ACPX_CANDIDATE_ADMISSION_INVALID", "candidate_admission_invalid"),
|
||||
(
|
||||
"ANTIGRAVITY_SWARM_UNAVAILABLE",
|
||||
"antigravity_swarm_unavailable",
|
||||
),
|
||||
(
|
||||
"ANTIGRAVITY_SWARM_SIGN_IN_REQUIRED",
|
||||
"antigravity_swarm_sign_in_required",
|
||||
),
|
||||
(
|
||||
"ANTIGRAVITY_SWARM_RECEIPT_MISMATCH",
|
||||
"antigravity_swarm_receipt_mismatch",
|
||||
),
|
||||
(
|
||||
"ANTIGRAVITY_SWARM_WORKSPACE_ESCAPE",
|
||||
"antigravity_swarm_workspace_escape",
|
||||
),
|
||||
(
|
||||
"ANTIGRAVITY_SWARM_HELPERS_TIMEOUT",
|
||||
"antigravity_swarm_helpers_timeout",
|
||||
),
|
||||
(
|
||||
"ACPX_CANDIDATE_ADMISSION_INVALID",
|
||||
"candidate_admission_invalid",
|
||||
),
|
||||
("acpx_sidecar_command_failed", "unclassified"),
|
||||
] {
|
||||
let error = sidecar
|
||||
.request(GeneratedAcpxSidecarCommand::SessionOpen, json!({ "errorCode": code }))
|
||||
.request(
|
||||
GeneratedAcpxSidecarCommand::SessionOpen,
|
||||
json!({ "errorCode": code }),
|
||||
)
|
||||
.unwrap_err();
|
||||
let message = error.to_string();
|
||||
assert!(message.ends_with(&format!("retryable=false, classification={classification})")));
|
||||
assert!(message.ends_with(&format!(
|
||||
"retryable=false, classification={classification})"
|
||||
)));
|
||||
assert!(!message.contains("violet-circuit-4821"));
|
||||
assert_eq!(
|
||||
error.sidecar_rejection(),
|
||||
Some(json!({ "command": "session.open", "code": code, "message": "violet-circuit-4821" }))
|
||||
Some(
|
||||
json!({ "command": "session.open", "code": code, "message": "violet-circuit-4821" })
|
||||
)
|
||||
);
|
||||
}
|
||||
// A provider cause has its own channel: the sidecar message is not copied.
|
||||
@@ -343,7 +368,10 @@ fn session_open_rejection_keeps_the_sidecar_code_and_reason_outside_the_error_te
|
||||
// A code outside the closed identifier shape fails the frame contract and is never echoed.
|
||||
let mut invalid = transport("remote-error", Duration::from_secs(1));
|
||||
let error = invalid
|
||||
.request(GeneratedAcpxSidecarCommand::SessionOpen, json!({ "errorCode": "token=amber secret" }))
|
||||
.request(
|
||||
GeneratedAcpxSidecarCommand::SessionOpen,
|
||||
json!({ "errorCode": "token=amber secret" }),
|
||||
)
|
||||
.unwrap_err();
|
||||
assert!(error.sidecar_rejection().is_none());
|
||||
assert!(!error.to_string().contains("amber"));
|
||||
|
||||
Reference in new issue
Block a user