mirror of
https://github.com/cline/cline.git
synced 2026-09-21 13:21:23 +08:00
When a provider returns a model-not-found error (e.g. Anthropic's HTTP 404 for a retired model such as claude-3-haiku-20240307), the SDK strips the status and delivers only the terse body, which collapses to the bare label "model: <id>". reshapeErrorForWebview fell through to returning that raw string, so ErrorRow rendered a label-like fragment in red with no hint that the model is gone or how to recover. Detect these in the plain-text branch of reshapeErrorForWebview and rewrite them into a sentence that names the model and tells the user to switch models in API Configuration settings, then retry. The model switch is framed as a precondition rather than a parallel option so users don't loop on Retry. Detection is text-based because the HTTP status is unavailable at this point. The keyword match is anchored to the word "model" with a not-found signal in the same sentence, so unrelated errors that merely mention a model (plan gating, deprecated features) are left untouched. Adds tests for the bare label form, a generic "does not exist" form, and two negative cases (plan gating and an auth error mentioning a model) that must pass through unchanged.