Hmbown/CodeWhale · info

unclaimed row

Error message

unclaimed row

What it means

This .expect("unclaimed row") is in crates/tui/src/client.rs:7730. Like the default-row expect, it finds the offering with wire_model_id "claude-fable-5" and panics when the catalog delta contains no such row. The test then asserts this unknown model is NOT the provider default, has no canonical mapping, and carries no cost — i.e. the gateway must not invent claims for unlisted models.

Solutions

  1. Inspect the mounted mock JSON and confirm an offering with wire_model_id "claude-fable-5" is present.
  2. Check any post-fetch filtering in fetch_catalog_delta and ensure unknown ids pass through with default_for_provider=false, canonical_model=None, cost=None.
  3. Keep the fixture at 3 offerings (default + unknown + one more) as the test's len assertion requires.
  4. If dropping unknown rows is now intended product behavior, rewrite the test to the new contract instead of the fixture.

Example fix

// before
.find(|offering| offering.wire_model_id == "claude-fable-5")
.expect("unclaimed row");
// after
.find(|offering| offering.wire_model_id == "claude-fable-5")
.unwrap_or_else(|| panic!("unclaimed row 'claude-fable-5' missing: {:?}", delta.offerings));
Defensive patterns

Strategy: validation

Validate before calling

assert!(delta.offerings.iter().any(|o| o.wire_model_id == "claude-fable-5"), "unclaimed row missing from catalog delta");

Prevention

When it happens

Trigger: The mock catalog response no longer includes the "claude-fable-5" row (fixture edited/trimmed), or a code change filters/normalizes offerings in a way that drops unknown model ids before they reach the delta.

Common situations: Tightening catalog filtering so only known models are returned, silently removing unclaimed rows; renaming the fixture's wire_model_id; changing the mock to only known models while this contract test still requires an unclaimed entry.

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/ad4814a039a34c53. Report an issue: GitHub.

Appendix: source

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

            .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
    /// `CODEWHALE_API_BASE` so the test does not mutate process env, but it
    /// exercises the same "declared origin" path: the key must follow the
    /// route to whatever origin the operator pointed it at.
    fn codewhale_client(server: &MockServer, model: &str) -> CodewhaleClient {
        let config = Config {
            provider: Some("codewhale".to_string()),

View on GitHub (pinned to 73e0f67d83)