You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Copilot auth now sets far too many requests as "user" consuming premium requests rapidly #8030
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.
Reacted by maxvisionai, Jonathan Bowman, Thiago Bellini Ribeiro, Gigi, Virgile Lafontaine, TheEpTic, Daniel Mateos Carballares, Maxim Kovkel, Z233, Ziyan Junaideen and 27 more
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.
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.
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.
@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
@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?
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
@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.
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.
Reacted by Valentin Muro, Nikolai Kolodziej, Felipe Fidelix, Rory, Marc Harter, Benoit de Chezelles, Denis6902, Daniel, Yveszzz, Yevhen P. and 2 more
Reacted by Nikolai Kolodziej, Felipe Fidelix, Baptiste GAZÉ, Byron, Norbiros, Federico Teotini and ypashkov
Reacted by Wali Mohammad Kadri, Norbiros and Alisson Primo
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?
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.
Reacted by Federico Teotini, dhruv kejriwal, Mohamed Yassine Landolsi , Aleksander Bondar, festim-jetishi, ypashkov and C
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.
Activity
github-actions commentedon Jan 12, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if your specific case differs from these.
rekram1-node commentedon Jan 12, 2026
ahh
rekram1-node commentedon Jan 12, 2026
will fix
caozhiyuan commentedon Jan 13, 2026
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.
bowmanjd commentedon Jan 14, 2026
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.
adrians5j commentedon Jan 14, 2026
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.
dhruvkej9 commentedon Jan 15, 2026
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.
rekram1-node commentedon Jan 15, 2026
@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
dhruvkej9 commentedon Jan 15, 2026
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?
rekram1-node commentedon Jan 15, 2026
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
212 remaining items
kldzj commentedon Apr 12, 2026
Yes, the underlying problem still isn't solved. As far as I know Aiden is working on it.
rekram1-node commentedon Apr 13, 2026
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:
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.
fidelix commentedon Apr 13, 2026
The most reasonable and fair approach. Thanks for the work!
aefmind commentedon Apr 14, 2026
@rekram1-node looks like the right thing.
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?
rekram1-node commentedon Apr 15, 2026
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.
Pollux12 commentedon Apr 15, 2026
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.
AmariUwU commentedon Apr 15, 2026
Is this normal? Why is it at 16k tokens?
fteotini commentedon Apr 15, 2026
yes if you have MCPs and any other kind of context files automatically included
kldzj commentedon Apr 15, 2026
System prompt, skills, MCPs, plugins. Nothing related to this issue most likely.
dhruvkej9 commentedon Apr 20, 2026
@rekram1-node Is this fixed? Can't see it any of the opencode releases
SpencerWell commentedon May 1, 2026
rekram1-node commentedon May 1, 2026
@dhruvkej9 yes that's why I closed the issue
been fixed since: https://github.com/anomalyco/opencode/releases/tag/v1.4.7
dhruvkej9 commentedon May 2, 2026
Sorry for bothering, missed it
CFigariR commentedon May 15, 2026