Hmbown/CodeWhale · info

default row

Error message

default row

What it means

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.

Solutions

  1. Print or debug-log delta.offerings wire_model_id values to see what the catalog actually returned.
  2. Align the mock catalog fixture so it includes DEFAULT_CONCENTRATE_MODEL (the test expects 3 offerings total).
  3. If DEFAULT_CONCENTRATE_MODEL changed, update either the constant or the fixture consistently.
  4. If the default-flagging logic regressed, fix the classification code — the next assertion (default.default_for_provider) covers that separately.

Example fix

// before
.find(|offering| offering.wire_model_id == DEFAULT_CONCENTRATE_MODEL)
.expect("default row");
// after
.find(|offering| offering.wire_model_id == DEFAULT_CONCENTRATE_MODEL)
.unwrap_or_else(|| panic!("default row {} missing from offerings: {:?}", DEFAULT_CONCENTRATE_MODEL, delta.offerings));
Defensive patterns

Strategy: validation

Validate before calling

// verify presence before find/expect
assert!(delta.offerings.iter().any(|o| o.wire_model_id == DEFAULT_CONCENTRATE_MODEL), "default model missing from catalog delta");

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/b8120e24103aec9a. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/client.rs:7724

                    {"id": DEFAULT_CONCENTRATE_MODEL, "object": "model", "owned_by": "deepseek"},
                    {"id": "gpt-5.6-sol", "object": "model", "owned_by": "openai"}
                ]
            })))
            .expect(1)
            .mount(&server)
            .await;

        let delta = concentrate_client(&server, DEFAULT_CONCENTRATE_MODEL)
            .fetch_catalog_delta()
            .await
            .expect("Concentrate catalog delta");
        assert_eq!(delta.provider, "concentrate");
        assert_eq!(delta.offerings.len(), 3);
        let default = delta
            .offerings
            .iter()
            .find(|offering| offering.wire_model_id == DEFAULT_CONCENTRATE_MODEL)
            .expect("default row");
        assert!(default.default_for_provider);
        let unknown = delta
            .offerings
            .iter()
            .find(|offering| offering.wire_model_id == "claude-fable-5")
            .expect("unclaimed row");
        assert!(!unknown.default_for_provider);
        assert_eq!(unknown.canonical_model, None);
        assert_eq!(
            unknown.cost, None,
            "no pricing claim from a gateway catalog"
        );
        assert!(matches!(unknown.source, CatalogSource::Live { .. }));
    }

    /// A Codewhale-route client pointed at a loopback stub.
    ///
    /// `base_url` goes through the provider table rather than

View on GitHub (pinned to 73e0f67d83)