Settings Connectivity Checks for API Providers / 设置页 API 连通性测试#2263
Settings Connectivity Checks for API Providers / 设置页 API 连通性测试#2263SivanCola wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ca3245fd7e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
esengine
left a comment
There was a problem hiding this comment.
Really solid PR — the security design here is exactly right, and I verified it against the source:
Credential safety (PASS): the connection test never reflects the API key back. Failure results emit fixed strings + HTTP <status> or the error message (desktop.ts), web-search errors are i18n templates interpolating only status/endpoint/protocol — the key only ever travels in the Authorization header / request body, and the result event type has no key field.
SSRF / endpoint policy (PASS — it gates, not just warns): resolveDeepSeekConnectionTestTarget attaches the saved DeepSeek key only when the requested base URL exactly equals the saved one — typing a custom https://attacker.example/v1 resolves the key to undefined and short-circuits with 'No API key configured', so the saved api.deepseek.com key can't be exfiltrated to an arbitrary endpoint. validateDeepSeekCredentialedEndpoint also rejects non-HTTPS (except loopback) and credential-embedding URLs. tests/deepseek-endpoint-policy.test.ts pins exactly this (incl. the 'does not combine a saved key with an unsaved custom endpoint' case). Nicely done.
No conflict with the search-timeout work: I just merged searchSignal() (15s timeout on every engine, #2252/#2259) into web.ts. Your branch predates it, so the 3-dot diff looks like a revert, but git merge origin/main auto-resolves cleanly — both the timeout and your opts.apiKey ?? load… plumbing survive on adjacent lines. The configPath fix for the Tavily/Perplexity/Exa key loaders is a legitimate in-scope bugfix.
One blocking issue — i18n parity will break the desktop release build:
- en.ts and zh-CN.ts each add 6 settings keys, but
desktop/src/i18n/ja.tsonly addsbaseUrlCustomCredentialWarning— it's missingtestConnection,testingConnection,connectionOk,connectionFailed,connectionPaidHint(5 keys). - ja.ts's
settings:block is a full literal (no...en.settingsspread), and it's typedja: typeof en, so those 5 missing keys are a hardtscerror. Root CI stays green because ci.yml never compiles desktop/ (root tsc only covers src/ + dashboard), butdesktop/package.json'stsc && vite buildruns on desktop release tags — so this would break the next desktop release. - de.ts is fine: it spreads
...en.settings, so it falls back to EN for the missing keys (per our de/ru convention). Only ja.ts needs the 5 keys added (translated). Please runtscinside desktop/ to confirm 0 errors after.
Everything else LGTM and CI (build ubuntu+windows + CodeQL) is green. Add the 5 ja.ts keys and I'm happy to approve.
|
Addressed review #2263 (review) in 1d20a0e. Root cause:
Solution:
Verified:
Note: |
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
esengine
left a comment
There was a problem hiding this comment.
Connectivity checks are something users have been asking for — useful before you burn a request to find out the key is wrong. Implementation looks clean.
Summary
Verification
npm test -- desktop/src/App.test.ts tests/deepseek-endpoint-policy.test.tsHOME=/tmp/reasonix-verify-home.W2jJAp npm run verifynpm run verifysuccessfully.Notes