You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds a save-time connectivity validation path for provider setup/edit flows, so users can catch provider/model misconfiguration before returning to chat.
Extend provider:validateKey to accept optional model and validate model connectivity for OpenAI-compatible providers.
Reuse stored API key when editing provider base URL/model without entering a new key.
In Setup and Provider Settings, pass model into validation calls so we test both key + model before save.
Add explicit Test Connection button and gate saving on successful connectivity test:
Setup: users must run test and pass before save is enabled.
Settings/Add Provider: same gating behavior for consistency.
For OpenRouter, run auth check first, then model connectivity check (when model provided).
Why
Users can currently save provider config successfully, but only discover model/baseURL issues after sending a chat message. This adds an earlier fail-fast check in config flows.
已同步最新 main 并解决冲突,相关更新已经推送到当前 PR 分支。\n\n本次合并主要处理了 src/components/settings/ProvidersSettings.tsx 和 src/pages/Setup/index.tsx 的冲突,并保留了这条 PR 原本的“保存前做连接测试 / 模型连通性校验”逻辑,同时兼容了 main 上后续引入的 provider UI/鉴权模式调整。\n\n本地验证已通过:\n- pnpm run lint\n- pnpm run typecheck\n- pnpm run test\n\nIf helpful, I can also split or further simplify any part of this PR for easier review.\n\nI’ve merged the latest main into this branch and resolved the conflicts.\n\nThe conflict resolution mainly covered src/components/settings/ProvidersSettings.tsx and src/pages/Setup/index.tsx. The PR’s original behavior is preserved: provider/model connectivity must be validated before save, while also staying compatible with the newer provider UI and auth-mode changes from main.\n\nLocal validation passed:\n- pnpm run lint\n- pnpm run typecheck\n- pnpm run test\nEOF
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
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
This PR adds a save-time connectivity validation path for provider setup/edit flows, so users can catch provider/model misconfiguration before returning to chat.
provider:validateKeyto accept optionalmodeland validate model connectivity for OpenAI-compatible providers.modelinto validation calls so we test both key + model before save.Why
Users can currently save provider config successfully, but only discover model/baseURL issues after sending a chat message. This adds an earlier fail-fast check in config flows.
Validation
pnpm -s typecheck