Skip to content

isModelNotFoundErrorMessage does not match "Not supported model" error format #92118

Description

@pikaqqqqqq

Description

isModelNotFoundErrorMessage() in src/agents/live-model-errors.ts does not recognize the error format "Not supported model <model-id>" returned by some OpenAI-compatible providers (e.g. internal gateways that proxy multiple model backends).

This causes the error to fall through to isSchemaErrorMessage() → classified as "schema" → user sees:

LLM request failed: provider rejected the request schema or tool payload.

instead of the correct model-not-found handling.

Steps to reproduce

  1. Configure an OpenAI-compatible provider with an invalid model ID
  2. The provider returns HTTP 400 with body like:
    {"error":{"code":"400","message":"Param Incorrect","param":"Not supported model some-model-id"}}
  3. The error is classified as "schema" instead of "model_not_found"

Expected behavior

The error should be classified as "model_not_found" and displayed as a model configuration issue, not a schema/tool payload rejection.

Root cause

isModelNotFoundErrorMessage() handles patterns like:

  • "model not found"
  • "unknown model"
  • "invalid model"
  • "model does not exist"

But NOT "Not supported model xxx" — a format used by some Chinese cloud provider gateways (Xiaomi MiFY, etc.).

Suggested fix

Add one line to src/agents/live-model-errors.ts:

if (/not supported model/i.test(msg)) {
  return true;
}

This pattern is unambiguous and won't false-positive on other error types.

Impact

Without this fix, any user on a provider that returns this error format will:

  • See a misleading "schema rejected" error
  • Waste time debugging tool schemas instead of checking their model config
  • Have failover logic skip the model (format errors are non-retriable) instead of reporting model-not-found

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions