{"record":{"id":"982061d0e0189e5f","repo":"Hmbown/CodeWhale","slug":"http","errorCode":null,"errorMessage":"HTTP {}","messagePattern":"HTTP \\{\\}","errorType":"http","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/tui/src/local_ollama.rs","lineNumber":151,"sourceCode":"        ProviderCatalogDelta {\n            provider: \"ollama\".into(),\n            base_url_fingerprint: fingerprint,\n            fetched_at,\n            offerings,\n        },\n    );\n}\n\nasync fn fetch_text(url: &str) -> anyhow::Result<String> {\n    // The first-run probe can run before any provider client has installed\n    // the rustls crypto provider; the shared builder installs it (the bare\n    // `reqwest::Client::builder()` panics under `rustls-no-provider`).\n    let client = crate::tls::reqwest_client_builder()\n        .timeout(TAGS_PROBE_TIMEOUT)\n        .build()?;\n    let response = client.get(url).send().await?;\n    if !response.status().is_success() {\n        anyhow::bail!(\"HTTP {}\", response.status());\n    }\n    Ok(response.text().await?)\n}\n\n/// Probe local Ollama for a live catalog. Prefers native `/api/tags`, falls\n/// back to OpenAI-compat `/v1/models`. Returns `None` when nothing useful\n/// answered — never invents a tag.\npub(crate) async fn probe_live_local_ollama_catalog(\n    config: &Config,\n) -> Option<LiveLocalOllamaCatalog> {\n    let endpoint_v1 = ollama_v1_base_url(config);\n    let origin = ollama_native_origin(&endpoint_v1);\n    let tags_url = format!(\"{origin}/api/tags\");\n\n    let tags = match fetch_text(&tags_url).await {\n        Ok(body) => match parse_ollama_tags_response(&body) {\n            Ok(tags) if !tags.is_empty() => tags,\n            Ok(_) => return None,","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/local_ollama.rs#L133-L169","documentation":"During a live probe of a local Ollama server, fetch_text issues an HTTP GET to the catalog endpoint and requires a 2xx response. Any non-success status (404, 500, etc.) is surfaced as `HTTP <status>`. The caller (probe_live_local_ollama_catalog) treats failed probes as no live catalog and falls back.","triggerScenarios":"GET to /api/tags or /v1/models on the local Ollama base URL returning a non-success status — server not fully started, wrong port, endpoint absent in an older Ollama version, or a proxy returning 4xx/5xx.","commonSituations":"Ollama not running or still booting; misconfigured OLLAMA_HOST port; older Ollama lacking the OpenAI-compat /v1/models route; corporate proxy intercepting localhost requests.","solutions":["Verify Ollama is running and serving on the expected port (curl http://localhost:11434/api/tags)","Upgrade Ollama if /v1/models returns 404 (older versions lack the OpenAI-compat endpoint)","Check for proxy environment variables (HTTP_PROXY) that might intercept localhost traffic","Confirm the URL passed to the probe is the correct base address"],"exampleFix":"# before (wrong port)\nOLLAMA_HOST=http://localhost:8080 codewhale ...\n# after\nOLLAMA_HOST=http://localhost:11434 codewhale ...","handlingStrategy":"fallback","validationCode":"const res = await fetch(`${base}/api/tags`);\nif (!res.ok) console.warn(`ollama probe got HTTP ${res.status}; catalog will be treated as unavailable`);","typeGuard":null,"tryCatchPattern":"try {\n  const catalog = await probeLiveLocalOllamaCatalog(base);\n} catch (e) {\n  if (/^HTTP \\d+$/.test(String(e))) {\n    // fall back to static/local model list; check server health\n  }\n}","preventionTips":["Health-check Ollama (GET /api/tags) before depending on a live catalog","Pin a recent Ollama version that supports both /api/tags and /v1/models","Exclude localhost from HTTP(S)_PROXY settings"],"tags":["http","ollama","network"],"backgroundTag":"http-error-response","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}