Implement pure Rust visual snapshots (#132)
Some checks failed
CI / rust-skia (Rust only) (push) Successful in 2m48s
CI / required (push) Failing after 54s

This commit is contained in:
2026-08-18 11:57:50 +02:00
parent 64edd8df46
commit 11a8c37f21
16 changed files with 1793 additions and 17 deletions

View File

@@ -503,6 +503,45 @@ async fn retry_classification_retry_after_timeout_and_cancellation_are_bounded()
assert_eq!(request.await.expect_err("cancelled"), LlmError::Cancelled);
}
#[tokio::test]
async fn multimodal_capability_rejection_is_typed_and_never_retried() {
let mut server = fake_server(vec![ResponsePlan::status(415)]).await;
let mut retry_limits = limits();
retry_limits.max_retries = 2;
let image = CompletionMessage {
role: MessageRole::Avatar,
content: metacrate_grid_agent::BoundedVec::try_from_vec(
"message.content",
vec![ContentPart::Image {
url: metacrate_grid_agent::BoundedText::new(
"image.url",
"data:image/png;base64,iVBORw0KGgo=",
)
.unwrap(),
detail: ImageDetail::Low,
}],
)
.unwrap(),
tool_call_id: None,
proposed_calls: metacrate_grid_agent::BoundedVec::new(),
};
assert_eq!(
client(&server.url, retry_limits)
.complete(&[image], &[], &CancellationToken::default())
.await
.expect_err("multimodal rejection"),
LlmError::MultimodalUnsupported
);
server.requests.recv().await.expect("one image request");
assert!(
!matches!(
tokio::time::timeout(Duration::from_millis(100), server.requests.recv()).await,
Ok(Some(_))
),
"capability rejection must not resend the large image"
);
}
#[tokio::test]
async fn concurrent_slow_sessions_respect_the_shared_semaphore() {
let plans = (0..6)