Skip to content

feat: add Poe OAuth auth plugin#18477

Open
kamilio wants to merge 2 commits intoanomalyco:devfrom
kamilio:feat/poe-auth-plugin
Open

feat: add Poe OAuth auth plugin#18477
kamilio wants to merge 2 commits intoanomalyco:devfrom
kamilio:feat/poe-auth-plugin

Conversation

@kamilio
Copy link

@kamilio kamilio commented Mar 21, 2026

Issue for this PR

Closes #18478

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds Poe as a built-in auth plugin. The plugin supports two auth methods: browser-based OAuth using PKCE (opens poe.com/oauth/authorize, exchanges the authorization code for an API key via api.poe.com/token) and manual API key entry. The implementation follows the same patterns as the existing Codex auth plugin (local callback server on an ephemeral port, CSRF state validation, PKCE challenge, timeout handling).

The plugin is registered in the INTERNAL_PLUGINS list in src/plugin/index.ts alongside the existing Codex, Copilot, and GitLab plugins.

How did you verify your code works?

  • 12 tests pass covering: OAuth URL construction, browser open flow, error/missing-code/invalid-state callback handling, successful token exchange, expiry calculation, expired token re-login error, plugin provider visibility, ProviderAuth registration, and end-to-end model listing + chat stream with a mock server.
  • bun typecheck passes.
  • Full monorepo bun turbo typecheck passes (13/13 packages).
  • Manual tests performing the OAUth Flow

Screenshots / recordings

poe test ts — opencode 2026-03-20 at 20 43 11

poe test ts — opencode 2026-03-20 at 20 43 25

OpenCode - Poe Authorization Successful 2026-03-20 at 20 43 32

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Mar 21, 2026
@github-actions
Copy link
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

# Conflicts:
#	packages/opencode/src/plugin/index.ts
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.

[FEATURE]: Add Poe as a built-in auth provider

1 participant