Provider & subscription
panto-copilot
GitHub Copilot defaults for panto. Mark named tables; the extension fills the boilerplate.
Setup
Requires panto's configure(config) extension hook (before auth/provider validation).
[extensions]
rocks = ["panto-copilot"]
[auth.copilot]
panto_copilot_extension = true
[providers.copilot]
auth = "copilot"
panto_copilot_extension = truepanto auth login copilot
panto models sync
panto models list copilot:Defaults
| Setting | Value |
|---|---|
| Auth | GitHub device OAuth, then Copilot token exchange; panto owns credentials/refresh |
| APIs | Responses (default), Chat Completions, Anthropic Messages |
| Endpoint | https://api.individual.githubcopilot.com; exchange may supply the account endpoint |
| Catalog | github-copilot |
| Identity | Copilot Chat 0.35.0, VS Code 1.107.0; all headers are overridable |
Rules
- Only
panto_copilot_extension = trueopts in; auth/provider names are arbitrary. - Keep
providers.<name>.authexplicit; the extension never guesses linkage. - Explicit values win, including nested endpoints and case-insensitive headers.
- Defaults are independent per table and per load; no config files are rewritten.
- Credentials stay native; env and session placeholders stay raw for panto.
- Rigs inherit user connection settings after this hook runs, so they need not include this extension unless their own config uses its markers.
--no-extensionsskips the hook.
Existing flat base_url configurations stay flat; otherwise all three endpoints are filled. Overrides must remain valid panto configuration.
Quota footer
Quota polling requires panto's http_request API and the render_footer event. It runs only when this extension is permitted and at least one marked auth or provider subscription is configured.
- It queries every distinct named auth, not only the current model.
- Polls start at
session_ready, repeat about every 60 seconds whenluvis available, and are throttled after turns. - Failed snapshots are retained and marked stale, with bounded retry backoff.
- Session end cancels the timer and any in-flight request.
- One shared logical usage row wraps to the terminal width.
Quota comes from GitHub's internal https://api.github.com/copilot_internal/user endpoint, which is undocumented and subject to change. It uses the original named GitHub OAuth access token, never the exchanged inference token, and never logs in interactively or reads token files.
The footer uses lowercase provider and window labels, highlighted headings, and green/yellow/red percentages at 33% and 66%, with reset countdowns such as reset in 2d 3h 12m. A shared, unreferenced minute timer keeps countdowns current while idle; it does not fetch usage. Claude stays absent until its model is first used.
Packaging / checks
panto lua _selfcheck.lua
panto lua _footer-selfcheck.lua
luarocks lint panto-copilot-0.1.1-1.rockspecThe rockspec maps require("panto-copilot") to init.lua, the quota poller and shared footer helper to their modules; no dependencies beyond Lua.
References
- GitHub device authorization
- Defaults match the existing panto Copilot configuration; identity versions are not auto-updated.
- First-party quota response fields