shivammittal274 720baaed3e feat: add GitHub Copilot as OAuth LLM provider (#500)
* feat: add GitHub Copilot as OAuth-based LLM provider

Add GitHub Copilot as a second OAuth provider using the Device Code flow
(RFC 8628). Users authenticate via github.com/login/device, and the server
polls for token completion. Supports 25+ models through a single Copilot
subscription.

Key changes:
- Device Code OAuth flow in token manager (poll with safety margin)
- Custom fetch wrapper injecting Copilot headers + vision detection
- Provider factory using createOpenAICompatible for Chat Completions API
- Extension UI with template card, auto-create on auth, and disconnect

* fix: address PR review comments for GitHub Copilot OAuth

- Validate device code response for error fields (GitHub can return 200
  with error payload)
- Store empty refreshToken instead of access token for GitHub tokens
- Add closeButton to Toaster for dismissing device code toast

* fix: add github-copilot to agent provider factory

The chat route uses a separate provider-factory.ts (agent layer) from the
test-provider route (llm/provider.ts). Added createGitHubCopilotFactory
to the agent factory so chat works with GitHub Copilot.

* fix: add github-copilot to provider icons, models, and dialog

- Add Github icon from lucide-react to providerIcons map
- Add 8 Copilot models (GPT-4o, Claude, Gemini, Grok) to models.ts
- Add github-copilot to NewProviderDialog zod enum, validation skip,
  canTest check, and OAuth credential message

* fix: reorder copilot models with free-tier models first

Put models available on Copilot Free at the top (gpt-4o, gpt-4.1,
gpt-5-mini, claude-haiku-4.5, grok-code-fast-1), followed by
premium models that require paid Copilot subscription.

* fix: set correct 64K context window for Copilot models

Copilot API enforces a 64K input token limit regardless of the
underlying model's native context window. Updated all model entries
and the default template to 64000 so compaction triggers correctly.

* fix: use actual per-model prompt limits from Copilot /models API

Queried api.githubcopilot.com/models for real max_prompt_tokens values.
GPT-4o/4.1 have 64K, Claude/gpt-5-mini have 128K, GPT-5.x have 272K.
Also updated model list to match what's actually available on the API
(e.g. claude-sonnet-4.6 instead of 4.5, added gpt-5.4/5.2-codex).

* feat: resize images for Copilot using VS Code's algorithm

Large screenshots cause 413 errors on Copilot's API. Resize images
following VS Code's approach: max 2048px longest side, 768px shortest
side, re-encode as JPEG at 75% quality. Uses sharp for server-side
image processing.

* fix: address all Greptile P1 review comments

- Add .catch() on fire-and-forget pollDeviceCode to prevent unhandled
  rejection crashes (Node 15+)
- Add deduplication guard (activeDeviceFlows Set) to prevent concurrent
  device code flows for the same provider
- Add runtime validation of server response in frontend before calling
  window.open() and showing toast
- Remove dead GITHUB_DEVICE_VERIFICATION constant from urls.ts

* fix: upgrade biome to 2.4.8, fix all lint errors, and address review bugs

- Upgrade biome from 2.4.5 to 2.4.8 (matches CI) and migrate configs
- Fix image resize: only re-encode when dimensions actually change
- Fix device code polling: retry on transient network errors instead of aborting
- Allow restarting device code flow (clear old flow instead of throwing 500)
- Fix pre-existing noNonNullAssertion and noExplicitAny lint errors globally

* fix: address Greptile P2 review — image resize and config guard

- Fix early-return guard: check max/min sides against their respective
  limits (MAX_LONG_SIDE/MAX_SHORT_SIDE) instead of both against SHORT
- Preserve PNG alpha: detect hasAlpha and keep PNG format instead of
  unconditionally converting to lossy JPEG
- Keep browserosId guard in resolveGitHubCopilotConfig consistent with
  ChatGPT Pro pattern (safety check that caller context is valid)

* feat: update Copilot models to full list from pricing page, default to gpt-5-mini

Added all 23 models from GitHub Copilot pricing page. Ordered with
free-tier models first (gpt-5-mini, claude-haiku-4.5), then premium.
Changed default from gpt-4o to gpt-5-mini since it's unlimited on
Pro plan and has 128K context (vs gpt-4o's 64K limit).
2026-03-20 02:33:09 +05:30
2026-03-17 19:01:10 +05:30
2025-09-13 18:04:54 +05:30
2026-01-06 16:24:19 -08:00
2025-09-30 12:54:03 -07:00
2025-06-18 17:48:04 -07:00
2026-03-10 13:33:47 -07:00

🌐 BrowserOS is an open-source Chromium fork that runs AI agents natively. The privacy-first alternative to ChatGPT Atlas, Perplexity Comet, and Dia.

🔒 Use your own API keys or run local models with Ollama. Your data never leaves your machine.

💡 Join our Discord or Slack and help us build! Have feature requests? Suggest here.

Quick start

  1. Download and install BrowserOS:

  2. Import your Chrome data (optional)

  3. Connect your AI provider — use Claude, OpenAI, Gemini, or local models via Ollama and LMStudio.

  4. Start automating!

What makes BrowserOS special

  • 🏠 Feels like home — same Chrome interface, all your extensions just work
  • 🤖 AI agents that run on YOUR browser, not in the cloud
  • 🔒 Privacy first — bring your own keys or run local models with Ollama. Your browsing history stays on your machine
  • 🤝 BrowserOS as MCP server — control the browser from claude-code, gemini-cli, or any MCP client (31 tools)
  • 🔄 Workflows — build repeatable browser automations with a visual graph builder
  • 📂 Cowork — combine browser automation with local file operations. Research the web, save reports to your folder
  • Scheduled Tasks — run the agent on autopilot, daily or every few minutes
  • 💬 LLM Hub — compare Claude, ChatGPT, and Gemini side-by-side on any page
  • 🛡️ Built-in ad blocker — 10x more protection than Chrome with uBlock Origin + Manifest V2 support
  • 🚀 100% open source under AGPL-3.0

Demos

🤖 BrowserOS agent in action

BrowserOS agent in action

🎇 Install BrowserOS as MCP and control it from claude-code

https://github.com/user-attachments/assets/c725d6df-1a0d-40eb-a125-ea009bf664dc



💬 Use BrowserOS to chat

https://github.com/user-attachments/assets/726803c5-8e36-420e-8694-c63a2607beca



Use BrowserOS to scrape data

https://github.com/user-attachments/assets/9f038216-bc24-4555-abf1-af2adcb7ebc0



Why We're Building BrowserOS

For the first time since Netscape pioneered the web in 1994, AI gives us the chance to completely reimagine the browser. We've seen tools like Cursor deliver 10x productivity gains for developers—yet everyday browsing remains frustratingly archaic.

You're likely juggling 70+ tabs, battling your browser instead of having it assist you. Routine tasks, like ordering something from amazon or filling a form should be handled seamlessly by AI agents.

At BrowserOS, we're convinced that AI should empower you by automating tasks locally and securely—keeping your data private. We are building the best browser for this future!

How we compare

vs Chrome
While we're grateful for Google open-sourcing Chromium, but Chrome hasn't evolved much in 10 years. No AI features, no automation, no MCP support.
vs Brave
We love what Brave started, but they've spread themselves too thin with crypto, search, VPNs. We're laser-focused on AI-powered browsing.
vs Arc/Dia
Many loved Arc, but it was closed source. When they abandoned users, there was no recourse. We're 100% open source - fork it anytime!
vs Perplexity Comet
They're a search/ad company. Your browser history becomes their product. We keep everything local.
vs ChatGPT Atlas
Your browsing data could be used for ads or to train their models. We keep your history and agent interactions strictly local.

Contributing

We'd love your help making BrowserOS better!

License

BrowserOS is open source under the AGPL-3.0 license.

Credits

  • ungoogled-chromium - BrowserOS uses some patches for enhanced privacy. Thanks to everyone behind this project!
  • The Chromium Project - At the core of BrowserOS, making it possible to exist in the first place.

Citation

If you use BrowserOS in your research or project, please cite:

@software{browseros2025,
  author = {Sonti, Nithin and Sonti, Nikhil and {BrowserOS-team}},
  title = {BrowserOS: The open-source Agentic browser},
  url = {https://github.com/browseros-ai/BrowserOS},
  year = {2025},
  publisher = {GitHub},
  license = {AGPL-3.0},
}

Copyright © 2025 Felafax, Inc.

Stargazers

Thank you to all our supporters!

Star History Chart

Built with ❤️ from San Francisco

Description
No description provided
Readme AGPL-3.0 18 GiB
Languages
TypeScript 65.6%
C++ 24%
Go 6.5%
C 1.5%
Objective-C++ 1%
Other 1.3%