Skip to content

feat(ai): add DeepSeek API key login flow#1284

Open
bannert1337 wants to merge 1 commit into
can1357:mainfrom
bannert1337:feat/deepseek-login
Open

feat(ai): add DeepSeek API key login flow#1284
bannert1337 wants to merge 1 commit into
can1357:mainfrom
bannert1337:feat/deepseek-login

Conversation

@bannert1337
Copy link
Copy Markdown

Summary

Add /login deepseek support using the existing createApiKeyLogin factory — same pattern as Cerebras, Moonshot, Fireworks, etc.

Opens platform.deepseek.com/api_keys in the browser, prompts the user to paste their API key, validates it against deepseek-v4-flash on api.deepseek.com, and stores it in the credential store.

Changes (4 files, 28 lines)

  • packages/ai/src/utils/oauth/deepseek.ts — new login flow via createApiKeyLogin
  • packages/ai/src/utils/oauth/types.ts — add "deepseek" to OAuthProvider union
  • packages/ai/src/utils/oauth/index.ts — add DeepSeek to builtInOAuthProviders
  • packages/ai/src/auth-storage.ts — add case "deepseek" to login switch

Verification

const { getOAuthProviders } = await import('./packages/ai/src/utils/oauth/index.ts');
getOAuthProviders().find(p => p.id === 'deepseek');
// { id: 'deepseek', name: 'DeepSeek', available: true }

Supersedes #1181 (which has merge conflicts and includes the entire repo history in its diff).

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.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants