Skip to content

Feature request: surface model-registry load failures via a safe modelError instead of an empty success #401

Description

@dust617

Summary

When the model registry fails to load (bad config, provider error, stale cache), the /api/models route currently returns an empty success-like payload. The UI therefore shows an empty model list with no explanation, making provider/config failures invisible and hard to diagnose.

Problem

A downstream wrapper currently has to patch app/api/models/route.ts (via withSafeModelLoadFailure) to append a modelError field so the UI can show a safe, actionable message instead of a silent empty list. This is a generic UX improvement that should live upstream.

Suggested fix

When model loading fails, return a modelError field (a safe, non-sensitive message such as "模型列表暂时不可用,请检查配置后重试") alongside the (possibly empty) models payload, and have the UI render it. The message must not leak config paths, tokens, or provider-specific error details.

Value

  • Surfaces provider/config failures instead of masking them as an empty success.
  • Useful for all users, not just downstream wrappers.
  • Small, self-contained change.

Environment

  • pi-web 0.8.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions