feat(ai): add DeepSeek API key login flow#1284
Conversation
Wire `/login deepseek` using the existing createApiKeyLogin factory. Opens platform.deepseek.com/api_keys, prompts for the key, validates against deepseek-v4-flash, and stores it in the credential store.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c97a43b52
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| return; | ||
| } | ||
| case "deepseek": { | ||
| const { loginDeepSeek } = await import("./utils/oauth/deepseek"); |
There was a problem hiding this comment.
Replace inline dynamic import with top-level import
The new DeepSeek branch adds await import(...) in AuthStorage.login, which violates the repository rule in /workspace/oh-my-pi/AGENTS.md ("NEVER use inline imports"). This introduces new non-compliant behavior in a hot auth path and will keep accumulating patterns that are explicitly disallowed by project standards; please move loginDeepSeek to a top-level static import like the rule requires.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is a false positive. Every provider in this switch uses the same await import(...) pattern — it's intentional lazy loading so auth-storage.ts doesn't eagerly import all 40+ provider modules. The AGENTS.md rule targets import("pkg").Type in type positions and ad-hoc dynamic imports in general code, not this established pattern.
Summary
Add
/login deepseeksupport using the existingcreateApiKeyLoginfactory — same pattern as Cerebras, Moonshot, Fireworks, etc.Opens
platform.deepseek.com/api_keysin the browser, prompts the user to paste their API key, validates it againstdeepseek-v4-flashonapi.deepseek.com, and stores it in the credential store.Changes (4 files, 28 lines)
packages/ai/src/utils/oauth/deepseek.ts— new login flow viacreateApiKeyLoginpackages/ai/src/utils/oauth/types.ts— add"deepseek"toOAuthProviderunionpackages/ai/src/utils/oauth/index.ts— add DeepSeek tobuiltInOAuthProviderspackages/ai/src/auth-storage.ts— addcase "deepseek"to login switchVerification
Supersedes #1181 (which has merge conflicts and includes the entire repo history in its diff).