Skip to content

Add GitHub Copilot OAuth provider#777

Open
TheSethRose wants to merge 3 commits intonextlevelbuilder:devfrom
TheSethRose:feat/github-copilot-oauth-provider
Open

Add GitHub Copilot OAuth provider#777
TheSethRose wants to merge 3 commits intonextlevelbuilder:devfrom
TheSethRose:feat/github-copilot-oauth-provider

Conversation

@TheSethRose
Copy link
Copy Markdown

Summary

Add a first-class GitHub Copilot OAuth provider to GoClaw, including device-flow authentication, token refresh/runtime support, web UI setup flows, live Copilot model discovery, and a follow-up fix for duplicated final assistant messages in Copilot streaming.

What changed

  • add backend support for a new github_copilot_oauth provider type
  • implement GitHub device auth + Copilot token minting and refresh
  • register the provider in gateway/provider setup paths
  • add provider-specific HTTP OAuth endpoints and token source handling
  • add web UI create/edit/setup support for GitHub Copilot OAuth providers
  • fetch Copilot models dynamically from live /models endpoints instead of placeholders
  • refresh provider queries in the UI immediately after Copilot auth/disconnect
  • dedupe Copilot final message streaming to prevent repeated assistant output
  • add regression tests for OAuth/token and Copilot streaming behavior

Files of note

  • internal/oauth/github_copilot.go
  • internal/oauth/github_copilot_token.go
  • internal/http/oauth_github_copilot.go
  • internal/http/provider_models.go
  • internal/http/provider_models_fetch.go
  • internal/providers/github_copilot.go
  • ui/web/src/pages/providers/provider-github-copilot-oauth-section.tsx
  • ui/web/src/pages/providers/provider-form-dialog.tsx
  • ui/web/src/pages/setup/step-provider.tsx

Validation

  • go test ./internal/oauth ./internal/http
  • go test ./internal/providers -run 'GitHubCopilot|CodexProviderChat(FallsBackToOutputItemMessageContent|FallsBackToCompletedResponseOutput|IgnoresCommentaryAndKeepsFinalAnswer|ConcatenatesMultipleOutputTextDoneParts|FallsBackToContentPartDone)'
  • go build ./...
  • cd ui/web && pnpm build
  • rebuilt and verified the temp test clone used for local Copilot testing

- add backend device-flow auth, token refresh, provider registration, and model catalog support
- add web UI onboarding and status handling for GitHub Copilot OAuth providers
- fix existing timeout typing issues so ui/web builds cleanly during validation
- refresh provider queries when Copilot auth completes or disconnects
- list Copilot models from live token-backed /models endpoints instead of placeholders
- buffer Copilot final message items until completion
- select one canonical completed assistant message and add regression tests
@PterX
Copy link
Copy Markdown

PterX commented Apr 9, 2026

good job

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