Skip to content

[Feature]: 增强 Provider 错误归一化与恢复提示 / Improve provider error normalization and recovery actions #212

@Sun-sunshine06

Description

@Sun-sunshine06

[Feature]: 增强 Provider 错误归一化与恢复提示 / Improve provider error normalization and recovery actions

Problem / pain point / 问题

现在已经有 provider error normalization,但恢复指引还不够稳定。不同 gateway 的失败方式很多:

  • auth failure
  • endpoint shape 不兼容
  • partial compatibility
  • upstream “not implemented”
  • request shape rejection

用户很多时候不只是需要一个 normalized error string,而是需要“下一步怎么修”。

We already normalize provider errors, but users often need the next action, not only the normalized error details.

Proposed solution / 方案

基于现有 normalization 增加 recovery categories 和 actionable hints,例如:

  • base URL 需要补 /v1
  • responses 切到 chat/completions
  • 对当前 model 关闭 reasoning
  • 改成 manual model entry
  • 重新导入 provider credentials
  • 补充 gateway-specific headers

Build on the current normalization layer rather than replacing it.

Alternatives considered / 备选方案

  • 只输出技术细节,不做恢复动作提示
    • 对用户和排障都不够友好

Scope / 范围

Provider / model

Acceptance criteria / 验收标准

  • normalized error 可映射到 recovery category
  • 多类已知兼容问题能给出 targeted hints
  • 这些 hints 可在 diagnostics 或 settings 中显示
  • logging 依旧是 structured 且已 scrubbed

Likely touchpoints / 可能涉及

  • packages/providers/src/errors.ts
  • packages/providers/src/gateway-compat.ts
  • renderer toasts / diagnostics UI
  • generate-fix flows where relevant

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriageAwaiting maintainer review

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions