Skip to content

feat(shared,desktop): add provider capability profiles#215

Merged
Sun-sunshine06 merged 1 commit into
mainfrom
feat/provider-capability-profile
Apr 23, 2026
Merged

feat(shared,desktop): add provider capability profiles#215
Sun-sunshine06 merged 1 commit into
mainfrom
feat/provider-capability-profile

Conversation

@Sun-sunshine06
Copy link
Copy Markdown
Collaborator

@Sun-sunshine06 Sun-sunshine06 commented Apr 23, 2026

Summary / 摘要

This PR lands a minimal first step for #206 by introducing explicit provider capability profiles into the shared config model and wiring keyless checks to use them.

这个 PR 先为 #206 落一个尽量小的第一步:在 shared config model 中引入显式的 provider capability profile,并让 keyless 判定开始基于这层能力信息。

What changed / 变更内容

  • add ProviderCapabilitiesSchema and ProviderModelDiscoveryModeSchema in packages/shared
  • add defaultProviderCapabilities() and resolveProviderCapabilities() helpers
  • allow ProviderEntry to persist optional capabilities
  • seed built-in providers with initial capability defaults
  • mark ChatGPT Codex provider as static-hint + keyless via explicit capabilities
  • switch desktop isKeylessProviderAllowed() to consult resolved capabilities first
  • add shared + desktop tests for capability parsing/defaults/keyless behavior

Why this shape / 为什么这样做

This keeps the scope small while laying groundwork for follow-up issues:

这一版不尝试一次性把 capability profile 接到所有链路里,而是先把 schema、默认值和解析 helper 稳定下来,并优先接入已经反复遇到问题的 keyless 判定逻辑,方便后续几个子 issue 继续往上叠。

Testing / 验证

Pre-push checks ran successfully:

  • workspace typecheck
  • workspace tests
  • biome check .

Note: Biome still reports one unrelated pre-existing warning in apps/desktop/src/renderer/src/components/Settings.tsx about exhaustive deps. This PR does not touch that file.

备注:Biome 仍会报告一个与本 PR 无关的已有 warning,位置在 apps/desktop/src/renderer/src/components/Settings.tsx,本次改动没有涉及该文件。

Refs #206
Refs #214

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings

  • [Blocker] Missing DCO sign-off — CLAUDE.md marks Signed-off-by as required, but the only PR commit 41a0717e9c86e82fe4f80a9ef383f3adacfbbede has message feat(shared,desktop): add provider capability profiles with no Signed-off-by: trailer.
    Suggested fix:
    git commit --amend -s --no-edit
    git push --force-with-lease
    

Summary

  • Review mode: initial. One blocker found: the PR currently misses the required DCO sign-off.
  • docs/VISION.md and docs/PRINCIPLES.md were not found in repo/docs in this checkout, so policy checks were limited to CLAUDE.md plus the touched source.
  • No additional high-confidence issues were identified in the added/modified lines.

Testing

  • Not run (automation environment: pnpm not installed)

open-codesign Bot

Signed-off-by: Sun-sunshine06 <Sun-sunshine06@users.noreply.github.com>
@Sun-sunshine06 Sun-sunshine06 force-pushed the feat/provider-capability-profile branch from 41a0717 to c62d1bf Compare April 23, 2026 14:57
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings

  • No high-confidence issues found in the added/modified lines.

Summary

  • Review mode: follow-up after new commits. The previous DCO blocker is resolved on commit c62d1bf76d2d8224047784ef3988b06e9dfda22e.
  • No new correctness, security, regression, or hard-constraint issues were identified in the latest diff.
  • docs/VISION.md and docs/PRINCIPLES.md were not found in this checkout, so policy checks were limited to CLAUDE.md plus the touched source.
  • Residual risk: broader integration coverage for provider import/discovery flows was not verified in this run.

Testing

  • Not run (automation): workspace dependencies are not installed in this runner (vitest: not found), and the available Node version is v20.20.2 while the repo requires >=22.

open-codesign Bot

@Sun-sunshine06 Sun-sunshine06 merged commit 8f596f6 into main Apr 23, 2026
7 checks passed
@Sun-sunshine06 Sun-sunshine06 deleted the feat/provider-capability-profile branch April 23, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:desktop apps/desktop (Electron shell, renderer)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant