Hmbown/CodeWhale · error · anyhow::Error

Failed to list models

Error message

Failed to list models: {reason:?}

What it means

Interactive model listing converts a catalog refresh failure into a user-facing error; the debug-formatted reason distinguishes catalog-level failures (auth, network, provider errors) from ordinary interactive request failures.

Solutions

  1. Inspect the CatalogRefreshError debug payload in the message to see whether the catalog fetch or its parsing failed.
  2. Retry after fixing connectivity/credentials; the interactive model list falls back only when this error is converted.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/tui/src/client.rs:898 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

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

    timeout: NON_STREAMING_HTTP_TIMEOUT,
};

#[derive(Clone, Copy)]
enum ModelsRequestMode {
    Interactive,
    Refresh,
}

#[derive(Debug)]
enum ModelsFetchError {
    Catalog(CatalogRefreshError),
    Interactive(anyhow::Error),
}

impl ModelsFetchError {
    fn into_interactive(self) -> anyhow::Error {
        match self {
            Self::Catalog(reason) => anyhow::anyhow!("Failed to list models: {reason:?}"),
            Self::Interactive(error) => error,
        }
    }

    fn into_catalog(self) -> CatalogRefreshError {
        match self {
            Self::Catalog(reason) => reason,
            Self::Interactive(_) => CatalogRefreshError::Network,
        }
    }
}

impl From<CatalogRefreshError> for ModelsFetchError {
    fn from(reason: CatalogRefreshError) -> Self {
        Self::Catalog(reason)
    }
}

View on GitHub (pinned to 73e0f67d83)