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?