Skip to content

[Feature]: 引入显式 Provider Capability Profile / Add explicit provider capability profiles #206

@Sun-sunshine06

Description

@Sun-sunshine06

[Feature]: 引入显式 Provider Capability Profile / Add explicit provider capability profiles

Problem / pain point / 问题

当前 provider 行为主要靠以下信息组合推断:

  • wire
  • baseUrl
  • model 命名启发式
  • 若干兼容性补丁

这套方式能工作,但很多关键兼容性事实仍是隐式的,导致:

  • diagnostics 很难准确说明“为什么失败”
  • UI 很难清晰说明“这个 provider 支持什么”
  • imported/custom provider 很难声明细粒度能力
  • 新兼容性工作容易继续演化成 heuristic patch

Current provider behavior is inferred from wire, baseUrl, model-name heuristics, and targeted compatibility patches. It works, but too many compatibility facts remain implicit.

Proposed solution / 方案

为 provider entry 增加显式 capability profile,例如:

  • supportsModelsEndpoint
  • supportsResponsesApi
  • supportsChatCompletions
  • supportsSystemRole
  • supportsDeveloperRole
  • supportsReasoning
  • supportsToolCalling
  • supportsKeyless
  • requiresClaudeCodeIdentity
  • modelDiscoveryMode

Use this profile as the primary source of truth for request shaping, diagnostics, model discovery, and imports.

Alternatives considered / 备选方案

  • 继续完全依赖 heuristics
    • 不利于规模化扩展
  • 仅在 UI 层维护 profile
    • main/providers 也需要同一份信息

Scope / 范围

Provider / model

Acceptance criteria / 验收标准

  • provider entry 可声明 capability profile
  • built-in provider 有合理默认值
  • custom/imported provider 可覆盖默认值
  • runtime request shaping 可读取该 profile
  • diagnostics 能利用 profile 给出解释
  • 相关测试补齐并通过

Likely touchpoints / 可能涉及

  • packages/shared/src/config.ts
  • apps/desktop/src/main/provider-settings.ts
  • apps/desktop/src/main/connection-ipc.ts
  • packages/providers/src/index.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriageAwaiting maintainer review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions