opencode-quota icon indicating copy to clipboard operation
opencode-quota copied to clipboard

Not working with github copilot

Open Halfwalker opened this issue 9 months ago • 4 comments

I have a github copilot subscription through our company - that's the only provider configured (so far). And no luck with getting toast popups, or even /quota working :(

Running /quota just returns "Quota unavailable" Running /quota-status runs, but has a couple of bits wrong

Quota Status (opencode-quota)
toast:
- configSource: defaults
- enabledProviders: (none)
- onlyCurrentModel: false
- currentModel: opencode/kimi-k2.5-free
- providers:
  - copilot: disabled available matchesCurrentModel=no
  - openai: disabled available matchesCurrentModel=no
  - firmware: disabled unavailable matchesCurrentModel=no
  - chutes: disabled unavailable matchesCurrentModel=no
  - google-antigravity: disabled unavailable matchesCurrentModel=yes
paths:
- auth.json: /home/deano/.local/share/opencode/auth.json
- firmware api key configured: false

The currentModel is wrong - this is in a whole new session, using Claude Sonnet 4.5 GitHub Copilot. I was using kimi-k2.5-free earlier though. Even though I'm logged in with copilot, it doesn't see it. Just in case, I configured a PAT installed in ~/.config/opencode/copilot-quota-token.json (I'm assuming business tier)

{
  "token": "github_pat_11B.....",
  "username": "AkaDean",
  "tier": "business"
}

Same thing, no toast. Any other information you need ?

Halfwalker avatar Feb 11 '26 01:02 Halfwalker

Hey @Halfwalker,

In regards to the Github PAT provider:

  • I think the error comes from an empty [] in enabledProviders for your opencode.json config
  • Would be nice to see your opencode.json config (project and/or global) just to confirm

In regards to the currentModel:

  • There is fallback that pulls from the global default model, should remove

I've made some changes in a dev branch to have it scan providers automatically so it works automatically out the box. Will be testing with my own PAT.

slkiser avatar Feb 11 '26 16:02 slkiser

From the opencode.jsonc

  "plugin": [
    "oh-my-opencode@latest",
    "cc-safety-net",
    "@slkiser/opencode-quota",
    "opencode-mystatus"
  ],
  "experimental": {
    "quotaToast": {
      "enabledProviders": [ "copilot" ],
        // Add only the providers the user has configured:
        // "copilot"            - if using GitHub Copilot
        // "openai"             - if using OpenAI/ChatGPT
        // "firmware"           - if using Firmware AI
        // "chutes"             - if using Chutes AI
        // "google-antigravity" - if using Google Antigravity (requires opencode-antigravity-auth)
      // "googleModels": ["CLAUDE"], // Options: CLAUDE, G3PRO, G3FLASH
      "minIntervalMs": 300000, // 5 minutes between fetches
      "toastDurationMs": 9000, // Toast shows for 9 seconds
    },
  },

Akadean avatar Feb 11 '26 18:02 Akadean

v1.4.1 should fix it, let me know if it's not working for you.

slkiser avatar Feb 12 '26 01:02 slkiser

Bingo that did it

Quota Status (opencode-quota)
toast:
- configSource: defaults
- enabledProviders: (auto)
- onlyCurrentModel: false
- currentModel: (error: session.get returned no modelID)
- providers:
  - copilot: enabled available
  - openai: enabled available
  - firmware: disabled unavailable
  - chutes: disabled unavailable
  - google-antigravity: disabled unavailable

Blew through the premium requests - damn you Opus :(

# Quota (/quota)
→ [Copilot]
  Status:      ██████████████████  100% left (resets in 17d)
Session Tokens
  claude-opus-4.5         3.0M in     72K out
  kimi-k2.5-free          1.9M in    7.8K out

Akadean avatar Feb 12 '26 02:02 Akadean