{"record":{"id":"9cfad1aab19d9bf5","repo":"Hmbown/CodeWhale","slug":"recorded-requests","errorCode":null,"errorMessage":"recorded requests","messagePattern":"recorded requests","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"info","filePath":"crates/tui/src/client.rs","lineNumber":7687,"sourceCode":"                expected,\n                \"HTTP {status}: {message}\"\n            );\n        }\n    }\n\n    /// Concentrate's `GET /v1/models` is unauthenticated, so a 2xx must not\n    /// count as key verification. Guided setup treats the probe as unobserved;\n    /// health_check must not issue the request either.\n    #[tokio::test]\n    async fn concentrate_health_check_does_not_treat_unauthenticated_models_as_key_proof() {\n        let server = MockServer::start().await;\n        let client = concentrate_client(&server, DEFAULT_CONCENTRATE_MODEL);\n\n        assert!(client.health_check().await.expect(\"health check\"));\n        assert!(!provider_api_key_verification_is_observed(\n            ApiProvider::Concentrate\n        ));\n        let requests = server.received_requests().await.expect(\"recorded requests\");\n        assert!(\n            requests.is_empty(),\n            \"Concentrate must not treat unauthenticated GET /v1/models as key verification\"\n        );\n    }\n\n    /// `GET /v1/models` needs no key and answers the OpenAI list shape; rows\n    /// are provider-scoped, the default is marked, and unknowns stay unclaimed.\n    /// https://concentrate.ai/docs/api-reference/endpoint/list-models\n    #[tokio::test]\n    async fn concentrate_live_catalog_is_provider_scoped_and_marks_the_default() {\n        let server = MockServer::start().await;\n        Mock::given(method(\"GET\"))\n            .and(path(\"/v1/models\"))\n            .respond_with(ResponseTemplate::new(200).set_body_json(json!({\n                \"object\": \"list\",\n                \"data\": [\n                    {\"id\": \"claude-fable-5\", \"object\": \"model\", \"owned_by\": \"anthropic\"},","sourceCodeStart":7669,"sourceCodeEnd":7705,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/client.rs#L7669-L7705","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nlet requests = server.received_requests().await.expect(\"recorded requests\");\n// after\nlet requests = server\n    .received_requests()\n    .await\n    .unwrap_or_default();\nassert!(requests.is_empty(), \"Concentrate must not treat unauthenticated GET /v1/models as key verification\");","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// tolerate a missing recording log in tests\nlet requests = server.received_requests().await.unwrap_or_default();\nassert!(requests.is_empty(), \"expected no requests, got {}\", requests.len());","preventionTips":["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."],"tags":["rust","test","wiremock","mock-server"],"backgroundTag":"unexpected-response-shape","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}