{"record":{"id":"fe5bf966d69ef76e","repo":"Hmbown/CodeWhale","slug":"fixture-catalog-parses","errorCode":null,"errorMessage":"fixture catalog parses","messagePattern":"fixture catalog parses","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/client.rs","lineNumber":7897,"sourceCode":"            .expect(1)\n            .mount(&server)\n            .await;\n\n        // Seed the account catalog through the same refresh seam the runtime\n        // uses, so the wire choice comes from the row's stated protocol.\n        let fingerprint = base_url_fingerprint(&server.uri());\n        let offerings = codewhale_catalog_offerings_from_body(\n            r#\"{\"object\":\"list\",\"data\":[\n                {\"id\":\"openai/gpt-5.6\",\"object\":\"model\",\"owned_by\":\"openai\",\n                 \"codewhale\":{\"provider\":\"openai\",\"model\":\"gpt-5.6\",\n                              \"protocol\":\"responses\",\"endpoint\":\"/v1/responses\",\n                              \"default\":true,\"usable\":true}}\n            ]}\"#,\n            \"codewhale\",\n            &fingerprint,\n            now_unix(),\n        )\n        .expect(\"fixture catalog parses\");\n        crate::provider_catalog_live::record_success(ProviderCatalogDelta {\n            provider: \"codewhale\".to_string(),\n            base_url_fingerprint: fingerprint,\n            fetched_at: now_unix(),\n            offerings,\n        });\n\n        let mut client = codewhale_client(&server, \"openai/gpt-5.6\");\n        assert_eq!(client.wire_format, WireFormat::Responses);\n        client.retry.enabled = false;\n        let response = client\n            .create_message(minimal_zen_request(\"openai/gpt-5.6\"))\n            .await\n            .expect(\"Codewhale responses request should succeed\");\n\n        // Responses usage arrives on the terminal `response.completed` event —\n        // the dialect's equivalent of chat's `stream_options.include_usage`.\n        assert_eq!(response.usage.input_tokens, 3);","sourceCodeStart":7879,"sourceCodeEnd":7915,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/client.rs#L7879-L7915","documentation":"This `expect` panics when the fixture catalog JSON string fails to deserialize into the expected offerings type, aborting with 'fixture catalog parses' at crates/tui/src/client.rs:7897. The test feeds a hand-written catalog JSON to the parser and requires it to be schema-valid before recording a success delta.","triggerScenarios":"Calling the catalog parse function with a fixture string whose JSON shape no longer matches the catalog struct — a renamed field like `usable`/`default`, a missing `offerings` array, or wrong enum casing for the provider name.","commonSituations":"The catalog schema evolved (new required field, stricter serde deny_unknown_fields) after the fixture was written; a typo in the embedded JSON literal; serde attributes changed from default to required.","solutions":["Print the serde error (`unwrap_or_else(|e| panic!(\"fixture catalog parses: {e}\"))`) to see the exact field/path mismatch","Update the fixture string to match the current `ProviderCatalogDelta`/offerings schema","Check whether new required fields were added to the catalog model","Validate the fixture JSON with a quick `serde_json::from_str::<Value>` to separate syntax from schema errors"],"exampleFix":"// before\n.parse(...)\n.expect(\"fixture catalog parses\");\n// after\n.parse(...)\n.unwrap_or_else(|e| panic!(\"fixture catalog parses: {e}\"));","handlingStrategy":"validation","validationCode":"let parsed: serde_json::Value = serde_json::from_str(FIXTURE)\n    .expect(\"fixture is syntactically valid JSON\");\nassert!(parsed.get(\"offerings\").is_some(), \"fixture missing offerings\");","typeGuard":null,"tryCatchPattern":"let offerings = parse_catalog(FIXTURE)\n    .unwrap_or_else(|e| panic!(\"fixture catalog parses: {e}\"));","preventionTips":["Regenerate fixtures whenever the catalog schema changes","Include new required fields in fixture JSON immediately","Validate fixtures with a schema check in CI"],"tags":["rust","serde","schema"],"backgroundTag":"schema-validation-failed","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-22T11:17:16.035Z"}