{"record":{"id":"b8120e24103aec9a","repo":"Hmbown/CodeWhale","slug":"default-row","errorCode":null,"errorMessage":"default row","messagePattern":"default row","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"info","filePath":"crates/tui/src/client.rs","lineNumber":7724,"sourceCode":"                    {\"id\": DEFAULT_CONCENTRATE_MODEL, \"object\": \"model\", \"owned_by\": \"deepseek\"},\n                    {\"id\": \"gpt-5.6-sol\", \"object\": \"model\", \"owned_by\": \"openai\"}\n                ]\n            })))\n            .expect(1)\n            .mount(&server)\n            .await;\n\n        let delta = concentrate_client(&server, DEFAULT_CONCENTRATE_MODEL)\n            .fetch_catalog_delta()\n            .await\n            .expect(\"Concentrate catalog delta\");\n        assert_eq!(delta.provider, \"concentrate\");\n        assert_eq!(delta.offerings.len(), 3);\n        let default = delta\n            .offerings\n            .iter()\n            .find(|offering| offering.wire_model_id == DEFAULT_CONCENTRATE_MODEL)\n            .expect(\"default row\");\n        assert!(default.default_for_provider);\n        let unknown = delta\n            .offerings\n            .iter()\n            .find(|offering| offering.wire_model_id == \"claude-fable-5\")\n            .expect(\"unclaimed row\");\n        assert!(!unknown.default_for_provider);\n        assert_eq!(unknown.canonical_model, None);\n        assert_eq!(\n            unknown.cost, None,\n            \"no pricing claim from a gateway catalog\"\n        );\n        assert!(matches!(unknown.source, CatalogSource::Live { .. }));\n    }\n\n    /// A Codewhale-route client pointed at a loopback stub.\n    ///\n    /// `base_url` goes through the provider table rather than","sourceCodeStart":7706,"sourceCodeEnd":7742,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/client.rs#L7706-L7742","documentation":"This .expect(\"default row\") is in crates/tui/src/client.rs:7724. It unwraps an Iterator::find over delta.offerings looking for the offering whose wire_model_id equals DEFAULT_CONCENTRATE_MODEL; it panics when no such offering exists in the fetched catalog delta. The subsequent assert then checks that this row is marked default_for_provider.","triggerScenarios":"fetch_catalog_delta() succeeded but its offerings list lacks the default model id — the mock catalog payload was edited, the DEFAULT_CONCENTRATE_MODEL constant was renamed, or the provider→default mapping logic stopped flagging the row.","commonSituations":"Renaming a model id in the fixture JSON or in DEFAULT_CONCENTRATE_MODEL; a regression in the code that sets default_for_provider so the row exists but the flag test moves elsewhere; trimming the mock to fewer than the 3 offerings the test expects.","solutions":["Print or debug-log delta.offerings wire_model_id values to see what the catalog actually returned.","Align the mock catalog fixture so it includes DEFAULT_CONCENTRATE_MODEL (the test expects 3 offerings total).","If DEFAULT_CONCENTRATE_MODEL changed, update either the constant or the fixture consistently.","If the default-flagging logic regressed, fix the classification code — the next assertion (default.default_for_provider) covers that separately."],"exampleFix":"// before\n.find(|offering| offering.wire_model_id == DEFAULT_CONCENTRATE_MODEL)\n.expect(\"default row\");\n// after\n.find(|offering| offering.wire_model_id == DEFAULT_CONCENTRATE_MODEL)\n.unwrap_or_else(|| panic!(\"default row {} missing from offerings: {:?}\", DEFAULT_CONCENTRATE_MODEL, delta.offerings));","handlingStrategy":"validation","validationCode":"// verify presence before find/expect\nassert!(delta.offerings.iter().any(|o| o.wire_model_id == DEFAULT_CONCENTRATE_MODEL), \"default model missing from catalog delta\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When renaming DEFAULT_CONCENTRATE_MODEL, grep fixtures for the old id in the same change.","Keep the catalog fixture at the offering count the test asserts (3) so removals fail loudly at len, not silently at find.","Log the full offerings list in the panic message to shorten diagnosis."],"tags":["rust","test","catalog","assertion"],"backgroundTag":"record-not-found","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"}