feat(providers): replace settings-based credentials with pi-ai registry and SecretStorage - #19
Merged
Merged
Conversation
…ry and SecretStorage - Introduce llm/providerService on top of pi-ai's multi-protocol catalog with /models discovery and reasoning-effort metadata - Store API keys in VS Code SecretStorage via new 'Manage Model Providers' command; keys never touch settings, .mtm, caches, or logs - Deprecate mutsumi.providers / mutsumi.models (migration-only); add 'Migrate Legacy Provider Credentials' and secure migration prompt - Add mutsumi.customProviders for custom OpenAI-compatible routes (api/auth/models) - Rename built-in provider kimi-for-coding -> kimi-coding - Drop direct openai SDK dependency; switch runner/tools to provider-neutral pi-ai types; persist pi-ai replay state in message metadata - Add vitest unit tests for provider service, credentials, migration, and replay
There was a problem hiding this comment.
Sorry @guilimao, your pull request is larger than the review limit of 150000 diff characters
Reviewer's Guide将基于旧版设置的 LLM 提供方配置和 OpenAI SDK 使用方式,替换为由 VS Code SecretStorage 支持的、与提供方无关的 pi-ai 注册表;添加用于管理/迁移提供方的命令和设置,并在 Agent 运行时和测试中贯穿提供方原生的重放/元数据。 管理提供方和配置 API Key 的序列图sequenceDiagram
actor User
participant VSCode as VSCode
participant ManageProviders as registerManageProvidersCommand
participant ProviderService as LlmProviderService
participant Models as Models
participant CredentialStore as VsCodeCredentialStore
participant SecretStorage as SecretStorage
participant GlobalState as GlobalState
User ->> VSCode: executeCommand mutsumi.manageProviders
VSCode ->> ManageProviders: registerManageProvidersCommand
ManageProviders ->> ProviderService: listProviders()
ProviderService ->> Models: getAvailable()
ProviderService -->> ManageProviders: ProviderInfo[]
ManageProviders -->> User: QuickPick providers
User ->> ManageProviders: select provider, configureKey
ManageProviders ->> ProviderService: configureApiKey(providerId, createInteraction())
ProviderService ->> Models: login(providerId, api_key, AuthInteraction)
Models ->> CredentialStore: modify(providerId, fn)
CredentialStore ->> SecretStorage: store()
CredentialStore ->> GlobalState: update()
Models -->> ProviderService: Credential
ProviderService ->> Models: refresh({allowNetwork: true, force: true})
Models -->> ProviderService: errors
ProviderService -->> ManageProviders: Error | undefined
ManageProviders -->> User: showInformationMessage / showWarningMessage
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your Experience打开你的 dashboard 以:
Getting HelpOriginal review guide in EnglishReviewer's GuideReplace legacy settings-based LLM provider configuration and OpenAI SDK usage with a provider-neutral pi-ai registry backed by VS Code SecretStorage, add commands and settings to manage/migrate providers, and thread provider-native replay/metadata through agent runtime and tests. Sequence diagram for managing providers and configuring API keyssequenceDiagram
actor User
participant VSCode as VSCode
participant ManageProviders as registerManageProvidersCommand
participant ProviderService as LlmProviderService
participant Models as Models
participant CredentialStore as VsCodeCredentialStore
participant SecretStorage as SecretStorage
participant GlobalState as GlobalState
User ->> VSCode: executeCommand mutsumi.manageProviders
VSCode ->> ManageProviders: registerManageProvidersCommand
ManageProviders ->> ProviderService: listProviders()
ProviderService ->> Models: getAvailable()
ProviderService -->> ManageProviders: ProviderInfo[]
ManageProviders -->> User: QuickPick providers
User ->> ManageProviders: select provider, configureKey
ManageProviders ->> ProviderService: configureApiKey(providerId, createInteraction())
ProviderService ->> Models: login(providerId, api_key, AuthInteraction)
Models ->> CredentialStore: modify(providerId, fn)
CredentialStore ->> SecretStorage: store()
CredentialStore ->> GlobalState: update()
Models -->> ProviderService: Credential
ProviderService ->> Models: refresh({allowNetwork: true, force: true})
Models -->> ProviderService: errors
ProviderService -->> ManageProviders: Error | undefined
ManageProviders -->> User: showInformationMessage / showWarningMessage
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
vitest 3.2.7 pulls in vite 7 which requires @types/node >=20.19 (peer). The project pinned @types/node ^18 since the scaffolded init commit while the real runtime (electron 39) and CI both use node 22, so npm ci on a clean node 22 environment failed with 'Missing @types/node@26.2.0 from lock file'. Aligning the type target with the actual node version also resolves the lock/package.json sync error.
Adopt native pi-ai messages and explicit provider/model identities across notebook and headless sessions. Persist Markdown notes separately, support pending user turns, hydrate provider history safely, and eliminate duplicate HTTP prompts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
集成一个与具体提供商无关的 LLM 抽象层,以 pi-ai catalog 和 VS Code SecretStorage 为后端,替换基于设置的提供商机制,并通过 agents、notebook 命令、HTTP 服务器以及默认配置将新的注册表串联起来。
New Features:
mutsumi.customProviders设置启用自定义提供商,支持/models模型发现以及非敏感配置选项。Bug Fixes:
Enhancements:
kimi-coding,并相应更新默认值、文档以及 agent 类型配置。mutsumi.providers和mutsumi.models设置,改用新的 provider 管理器和基于 catalog 的发现机制。Build:
Documentation:
kimi-coding路由,并将旧的多 provider 设计文档标记为遗留文档。Tests:
Original summary in English
Summary by Sourcery
Integrate a provider-neutral LLM layer backed by pi-ai catalogs and VS Code SecretStorage, replacing settings-based providers and wiring the new registry through agents, notebook commands, HTTP server, and configuration defaults.
New Features:
Bug Fixes:
Enhancements:
Build:
Documentation:
Tests: