Hmbown/CodeWhale · info
recorded requests
Error message
recorded requests
What it means
This .expect("recorded requests") is in the same test in crates/tui/src/client.rs:7687, unwrapping wiremock's MockServer::received_requests(). It panics if the mock server fails to return its recorded request log. The declaration `let requests = ...` is the variable the expect message is attached to; the app-server references shown are an unrelated same-named fixture elsewhere.
Solutions
- Ensure the MockServer outlives all awaits that use it (bind it to a local variable in the test, not a dropped scope).
- Keep the assertion order: query received_requests() before any code that could abort the runtime.
- Pin/upgrade wiremock to a compatible version and re-run the test.
- If the server genuinely recorded nothing, note this test expects an EMPTY list — an Err here is still a harness failure, distinct from the is_empty assertion below it.
Example fix
// before
let requests = server.received_requests().await.expect("recorded requests");
// after
let requests = server
.received_requests()
.await
.unwrap_or_default();
assert!(requests.is_empty(), "Concentrate must not treat unauthenticated GET /v1/models as key verification"); Defensive patterns
Strategy: try-catch
Try / catch
// tolerate a missing recording log in tests
let requests = server.received_requests().await.unwrap_or_default();
assert!(requests.is_empty(), "expected no requests, got {}", requests.len()); Prevention
- Bind MockServer to a variable that outlives every await using it.
- Query received_requests() only after all client calls complete and before any early return.
- Pin the wiremock dependency version and re-check its API after upgrades.
When it happens
Trigger: server.received_requests().await returning Err — happens when the wiremock server has shut down or its internal recording channel failed by the time the test queries it; typically a test-ordering/lifecycle problem rather than a client bug.
Common situations: Server dropped or tokio runtime torn down before received_requests() is awaited; mock server started but a panic elsewhere in the test left it in a bad state; wiremock version incompatibilities in the recording API.
Related errors
- recorded request
- health check
- Codewhale chat request should succeed
- Codewhale client should resolve its model route
- Concentrate catalog delta
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/9cfad1aab19d9bf5.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tui/src/client.rs:7687
expected,
"HTTP {status}: {message}"
);
}
}
/// Concentrate's `GET /v1/models` is unauthenticated, so a 2xx must not
/// count as key verification. Guided setup treats the probe as unobserved;
/// health_check must not issue the request either.
#[tokio::test]
async fn concentrate_health_check_does_not_treat_unauthenticated_models_as_key_proof() {
let server = MockServer::start().await;
let client = concentrate_client(&server, DEFAULT_CONCENTRATE_MODEL);
assert!(client.health_check().await.expect("health check"));
assert!(!provider_api_key_verification_is_observed(
ApiProvider::Concentrate
));
let requests = server.received_requests().await.expect("recorded requests");
assert!(
requests.is_empty(),
"Concentrate must not treat unauthenticated GET /v1/models as key verification"
);
}
/// `GET /v1/models` needs no key and answers the OpenAI list shape; rows
/// are provider-scoped, the default is marked, and unknowns stay unclaimed.
/// https://concentrate.ai/docs/api-reference/endpoint/list-models
#[tokio::test]
async fn concentrate_live_catalog_is_provider_scoped_and_marks_the_default() {
let server = MockServer::start().await;
Mock::given(method("GET"))
.and(path("/v1/models"))
.respond_with(ResponseTemplate::new(200).set_body_json(json!({
"object": "list",
"data": [
{"id": "claude-fable-5", "object": "model", "owned_by": "anthropic"},View on GitHub (pinned to 73e0f67d83)