-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Description
Problem
Strix currently does not support GitHub Copilot-backed models. To use Copilot models, we need to implement OAuth device-flow authentication similar to VS Code's Copilot integration.
Proposed Solution
Implement a new authentication module strix/llm/copilot_auth.py that:
- OAuth Device Flow: Initiate GitHub's OAuth device-flow to obtain a refresh token without requiring a web-based login flow that blocks CI/CD.
- Token Management: Store refresh tokens securely at
$XDG_CONFIG_HOME/strix/copilot_auth.json(or~/.config/strix/copilot_auth.json). - Token Exchange: Exchange refresh tokens for short-lived access tokens via GitHub's Copilot API.
- Non-interactive Support: Allow CI/CD environments to provide pre-provisioned tokens via environment variables:
STRIX_COPILOT_ACCESS: ready-to-use access tokenSTRIX_COPILOT_TOKEN: refresh token to be exchangedSTRIX_COPILOT_ENTERPRISE: enterprise domain (optional)
- Enterprise Support: Support enterprise Copilot deployments with custom domains.
Implementation Details
See PR #224 for the complete implementation, which includes:
- New module
strix/llm/copilot_auth.pywith device flow, token storage, and exchange logic - Integration with
strix/llm/llm.pyto use Copilot tokens whenSTRIX_LLMstarts withgithub-copilot/ - CLI support via
--non-interactiveflag that respects env vars and fails fast without them - Unit tests for auth flows and env var handling
- Documentation in README.md
Testing
- Unit tests verify env var paths and non-interactive fail-fast behavior
- Tests pass under Poetry
- Pre-commit hooks (ruff, mypy, bandit) pass
Related
Metadata
Metadata
Assignees
Labels
No labels