feat(auth): add OAuth login with SDK-based subscription providers#32
Merged
yinwm merged 3 commits intosipeed:mainfrom Feb 12, 2026
Conversation
Add `picoclaw auth` CLI command supporting: - OpenAI OAuth2 (PKCE + browser callback or device code flow) - Anthropic paste-token flow - Token storage at ~/.picoclaw/auth.json with 0600 permissions - Auto-refresh for expired OAuth tokens in provider Closes sipeed#18 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add ClaudeProvider (anthropic-sdk-go) and CodexProvider (openai-go) that use the correct subscription endpoints and API formats: - CodexProvider: chatgpt.com/backend-api/codex/responses (Responses API) with OAuth Bearer auth and Chatgpt-Account-Id header - ClaudeProvider: api.anthropic.com/v1/messages (Messages API) with Authorization: Bearer token auth Update CreateProvider() routing to use new SDK-based providers when auth_method is "oauth" or "token", removing the stopgap that sent subscription tokens to pay-per-token endpoints. Closes sipeed#18 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update to latest major version of the official OpenAI Go SDK. Fix breaking change: FunctionCallOutput.Output is now a union type (ResponseInputItemFunctionCallOutputOutputUnionParam) instead of string. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
LGTM! 🎉Great work on adding OAuth login support! The code quality is solid with good test coverage (17 auth + 17 provider tests). This is ready to Non-blocking suggestions for future iterations:🔧 Technical debt (optional follow-ups):
🎯 Minor improvements:
These don't block merge - just keeping track for future improvements. Thanks for this contribution! 🙏 |
emadomedher
pushed a commit
to emadomedher/picoclaw
that referenced
this pull request
Feb 17, 2026
…openai-anthropic-oauth-based-login feat(auth): add OAuth login with SDK-based subscription providers
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
ClaudeProviderwrappinganthropic-sdk-gofor Anthropic Messages API with Bearer authCodexProviderwrappingopenai-gofor OpenAI Codex Responses API atchatgpt.com/backend-api/codex/responses~/.picoclaw/auth.jsonwith automatic token refreshNew CLI commands
picoclaw auth login --provider openai— OAuth browser flow (or--device-codefor headless)picoclaw auth login --provider anthropic— Paste API tokenpicoclaw auth logout— Clear stored credentialspicoclaw auth status— Show auth stateProvider routing
auth_method"oauth"(OpenAI)CodexProvider(openai-go SDK)chatgpt.com/backend-api/codex/responses"token"(Anthropic)ClaudeProvider(anthropic-sdk-go)api.anthropic.com/v1/messagesHTTPProvider(unchanged)/chat/completionsTest plan
go build ./...compilesgo vet ./...passespicoclaw auth login --provider openai→picoclaw agent -m "hello"uses Codex endpointpicoclaw auth login --provider anthropic→picoclaw agent -m "hello"uses Claude Messages APICloses #18
🤖 Generated with Claude Code