When I end a session, but there are still background shell processes running, and those processes are then terminated, it triggers new requests to the agent every time, which costs tokens. And if you’re on the old legacy plan with the 500-request limit, that results in unnecessary requests every single time. For me, this quickly adds up to 10–30 unnecessarily consumed requests throughout the day. Please make it configurable whether an automatically terminated background task should or may trigger a new agent request. It’s possible that someone on a current contract might want this behavior. But with old legacy contracts, I don’t want that. It’s a waste of requests. This error has been going on for weeks/months now. And it’s really annoying!
Steps to Reproduce
Have an agent start a background process. After that, the agent should ask a question using the Ask Tool. In the Ask Tool, you then specify that the session should be ended. The agent then ends the session, and the background processes are terminated; however, this triggers the agent to be called again or woken up. This results in useless responses that only consume tokens and requests.
Expected Behavior
The goal is to simply terminate the background processes without triggering the agent again. In other words, no consumed tokens or requests when terminating background processes.
Hey, thanks for the detailed report. The steps to repro and the scenario are especially helpful.
This is a known issue: phantom requests that get billed when an AskQuestion session ends and background processes finish. We already have an internal issue tracking this symptom, and I’ll link your report there as an extra signal. Linux plus the legacy 500-request plan is useful context, since the original report was on Windows. I can’t share an ETA for a fix right now, but once there’s an update I’ll reply in the thread.
If you have a Request ID from one of these extra requests, please drop it here and I’ll attach it to the ticket. You can copy it from the chat context menu in the top right > Copy Request ID.
Thanks, I’ve attached the Request ID to the ticket. If you get more, send them here. The more signals we have, the better we can prioritize. I’ll post an update in the thread as soon as we have one on the fix.
However if/when I close the background shell, some new messages appear in the agent chat, something like below. I have not made any new request at this point, but if I go to cursor usage I see additoinal requests showing up at the time of closing the background shell.
Is this intended? Is this a bug? How can I disable it so my requests are not eaten up? I have noticed this may be happening more often recently and ends up exhausing a lot of requests. Imagine you are running a request with Opus thinking that has 2x cost and simple shell closure costs 2x more, ending up utilising 4x requests per prompt. Sometimes some chats have multiple background tasks. Not to mention if you choose to use fast mode that is 6x.
My team has reported similar high usage recently, anyone else seen this behavior?
Hey, sorry for the long pause here. I said I’d come back with an update, and I’m back.
Since the report, we’ve made a number of improvements in this area, especially around extra requests that were being charged when a session reconnects or resumes on its own without any action from you (idle-wait, sleep/wake reconnect). @AndreasM1, you were on 3.5.17, that’s a pretty old build. Please update to the latest version and check if you still see unexpected requests after ending the session while background processes are still running. If it’s gone, no need to reply. If you can still reproduce it, please share a fresh Request ID (top right chat menu > Copy Request ID) and we’ll dig deeper.
@jugalfreespace, to answer your direct question about whether this is intended, right now it’s working as designed. When the background shell exits, the agent resumes to process the result, and each resume counts as a separate request. There isn’t a separate toggle to disable this at the moment. I can see your screenshots with the “Will resume when background shell exits” banner and the extra requests in usage, that’s exactly this.
I get that on the legacy request-based plan this can hit the limit hard, especially with Opus thinking and multiple background tasks in a chat. I’ll pass along feedback to the team to make this behavior configurable, like Andreas asked. If there’s any update on this, I’ll post back in the thread.