Skip to content

Copilot auth now sets far too many requests as "user" consuming premium requests rapidly #8030

Closed

Description

@bowmanjd

Description

This, morning a request or two using Github Copilot's Opus 4.5 consumed half my monthly quota -- there were around 60 agent-initiated requests that should not have been counted as premium requests. In other words, they should have had the X-Initiator header set to "agent" as this is the way Copilot counts requests. Agent/tool initiated messages are flagged as "agent" and truly user-initated ("user" messages) are the ones that should consume premium requests.

This appears to be directly related to the opencode-copilot-auth version bump of recent commits, so I did create anomalyco/opencode-copilot-auth#11 there as well. The opencode-copilot-auth is recently, and rightly, trying to comply with Copilot's request consumption patterns so as not to provide an avenue for abuse. We are now seeking to ensure that all "user" requests consume premium tokens (with premium models, that is). That is good, but introduces an incompatibility with opencode's role classifying.

As far as I can tell, opencode creates synthetic "user" messages for tool attachments in the MessageV2.toModelMessage function in packages/opencode/src/session/message-v2.ts. So now that opencode-copilot-auth is more conservative in its use of the X-Initiator: agent header, we are in effect charging for every tool attachment message, which gets quite expensive, as I discovered this morning, sadly.

Workaround

For now, I would highly recommend to Copilot users that they keep OpenCode at version 1.1.12, and do your best to be honorable (and safe from being blocked or throttled by Github), starting new sessions often rather than "riding" the same session to avoid premium request consumption.

Plugins

opencode-copilot-auth

OpenCode version

1.1.14

Steps to reproduce

Ask a copilot premium model such as Claude to investigate or solve a complex problem that involves reading, writing, and editing files.

Screenshot and/or share link

No response

Operating System

Linux, Windows

Terminal

Foot, and Windows Terminal

Activity

  1. github-actions commented on Jan 12, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if your specific case differs from these.

  2. rekram1-node commented on Jan 12, 2026

    @rekram1-node
    Collaborator

    ahh

  3. rekram1-node commented on Jan 12, 2026

    @rekram1-node
    Collaborator

    will fix

  4. caozhiyuan commented on Jan 13, 2026

    @caozhiyuan
    Contributor

    in claude code , skill invocations, edit hooks or to do reminders , request like this: {"role":"user","content":[{"type":"tool_result","content":"Launching skill: xxx"},{"type":"text","text":"xxx"}]}, when translate to copilot-api will add user block in last message. i also change in ericc-ch/copilot-api@f2b8476 , maybe opencode also the same case.

  5. bowmanjd commented on Jan 14, 2026

    @bowmanjd
    Author

    As discussed in #8067 my initial analysis is probably wrong, and the excessive token usage may have been related to https://github.com/Opencode-DCP/opencode-dynamic-context-pruning -- I just had the bad luck to use it before it had fully updated to use assistant messages instead of user messages.

  6. adrians5j commented on Jan 14, 2026

    @adrians5j

    I'm not sure if this is related to your thing... but interestingly enough, yday I noticed the same increased usage with Copilot:
    https://x.com/adrians5j/status/2011007640344678444?s=20

    Was shocked, and now I'm using webstorm's plugin, just to see if it's any dfferent. So far, it DOES feel that the increased consumption is no longer happening.

    Keeping my eye on this one. Don't know how to properly debug these things yet.

    UPDATE: Just saw the duplicate issue. Woah so it's not just me. Good to know.

  7. dhruvkej9 commented on Jan 15, 2026

    @dhruvkej9

    will fix

    Each user message consumes one request it should not be the case (it is just too much now then), while the agent is still working.

    This leads to DCP consume one premium request for each prune & also the whole purpose of prompting in between agent is working is defeated now with copilot.

  8. rekram1-node commented on Jan 15, 2026

    @rekram1-node
    Collaborator

    @dhruvkej9 that should be fixed in ur latest dcp version, the problem here is that DCP IS (or was) injecting user messages which will eat up your quota

  9. dhruvkej9 commented on Jan 15, 2026

    @dhruvkej9

    @dhruvkej9 that should be fixed in ur latest dcp version, the problem here is that DCP IS (or was) injecting user messages which will eat up your quota

    So now for each follow-up to the agent will take one premium request?

    Even if 3 user messages are queued and they get sent at the same time it will take 3 premium requests (in case of Opus 4.5 it would be 9)? ideally it should be 1 as all of them are sent at the same time.

    Also shouldn't there be a soft-limit on the follow ups we give to the coding agent? As a small follow-up/correction/guidance to the agent while it is working and got wrong will cost again a premium request and in case of Opus 4.5 (3 premium requests).

    That's gonna make copilot unusable.

    Follow-up:
    Can we use copilot auth old version with new opencode versions by overriding it in config and disabling the default plugins by global flag?

  10. rekram1-node commented on Jan 15, 2026

    @rekram1-node
    Collaborator

    Even if 3 user messages are queued and they get sent at the same time it will take 3 premium requests (in case of Opus 4.5 it would be 9)? ideally it should be 1 as all of them are sent at the same time.

    Hm no that shouldn't be the case that should only eat up 1. Also note that some models have multipliers and can eat up more than a single premium request from a single request

  11. 212 remaining items

  12. kldzj commented on Apr 12, 2026

    @kldzj

    @rekram1-node Not sure what exactly is happening, but today opencode is eating my premium requests like crazy. I'm not sure this is related to the 1.3.4 upgrade, but that's the only thing that has changed since everything was fine for me yesterday.

    are you still suffering from this issue ? or is it solved ?

    Yes, the underlying problem still isn't solved. As far as I know Aiden is working on it.

  13. rekram1-node commented on Apr 13, 2026

    @rekram1-node
    Collaborator

    Looking at all the cases and after talking w/ the copilot team. The only issue remaining was the one linked above^ w/ the tool image stuff.

    Some ppl are upset about the extra user message we send after a compaction is completed to basically help make the session auto continue (cause sometimes the llm wont do too much w/ just the summary). We will provide an option to disable this but I can't just write that as a non user initiated event, it is spinning up another prompt to trigger more generation.

    Even with the current setup that eats more requests in some cases, github is already concerned about abuse and there have already been many abusers, we have to be conservative.

    Now there are several locations in the codebase that synthetic user messages are added, several people are creating prs that basically track all synthetic user messages as agent initiated events. This is the wrong approach and it will result in vast underbilling in many cases.

    The only cases I could find that a synthetic/hidden user message was triggering billing when it "shouldnt" were:

    • synthetic msg attached after tool result that reads images (fixed above, not released yet)
    • synthetic msg after compaction (compaction itself doesnt bill but the auto continue does): but for this case as stated above, it follows what would be expected for triggering additional inference

    I tested copilot cli and if we want parity, disabling the additional user message for copilot seems reasonable (better matches their behavior here).

    Today I will add this disable behavior, and add comments about the various billing cases and close out this issue for good.

  14. fidelix commented on Apr 13, 2026

    @fidelix

    The most reasonable and fair approach. Thanks for the work!

  15. aefmind commented on Apr 14, 2026

    @aefmind

    @rekram1-node looks like the right thing.

    the extra user message we send after a compaction is completed to basically help make the session auto continue (cause sometimes the llm wont do too much w/ just the summary)

    I was asking me: by overriding compact agent could we improve instructions so the summary becomes better for continuation, or are there such big technical reasons that would make this not so useful?

  16. rekram1-node commented on Apr 15, 2026

    @rekram1-node
    Collaborator

    linked pr will be merged tmr I tested copilot quite a bit, it seems like their continue doesnt seem to incur changes so this pr will match, there are some weird edge cases tho w/ how they bill that do not align with some of the reports people had in this thread, for example I managed to get billed for some compactions in copilot cli itself.

    Im raising my pr and experiences w/ copilot team, hopefully will get clarity.

  17. Pollux12 commented on Apr 15, 2026

    @Pollux12

    linked pr will be merged tmr I tested copilot quite a bit, it seems like their continue doesnt seem to incur changes so this pr will match, there are some weird edge cases tho w/ how they bill that do not align with some of the reports people had in this thread, for example I managed to get billed for some compactions in copilot cli itself.

    Im raising my pr and experiences w/ copilot team, hopefully will get clarity.

    With the Copilot CLI, I believe manual compaction does bill but automatic does not. That might be why you've seen it sometimes? I've definitely never been billed with automatic compaction on Copilot CLI but I remember it billing for the one time I tried manual via the command.

  18. AmariUwU commented on Apr 15, 2026

    @AmariUwU

    Is this normal? Why is it at 16k tokens?

    Image
  19. fteotini commented on Apr 15, 2026

    @fteotini

    Is this normal? Why is it at 16k tokens?

    Image

    yes if you have MCPs and any other kind of context files automatically included

  20. kldzj commented on Apr 15, 2026

    @kldzj

    Is this normal? Why is it at 16k tokens?

    Image

    System prompt, skills, MCPs, plugins. Nothing related to this issue most likely.

  21. dhruvkej9 commented on Apr 20, 2026

    @dhruvkej9

    @rekram1-node Is this fixed? Can't see it any of the opencode releases

  22. SpencerWell commented on May 1, 2026

    @SpencerWell
  23. rekram1-node commented on May 1, 2026

    @rekram1-node
    Collaborator

    @dhruvkej9 yes that's why I closed the issue

    been fixed since: https://github.com/anomalyco/opencode/releases/tag/v1.4.7

  24. dhruvkej9 commented on May 2, 2026

    @dhruvkej9

    @dhruvkej9 yes that's why I closed the issue

    been fixed since: https://github.com/anomalyco/opencode/releases/tag/v1.4.7

    Sorry for bothering, missed it

  25. CFigariR commented on May 15, 2026

    @CFigariR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions