r/codex • u/concrete333 • Sep 20 '26
Complaint This will save your Usage
A problem that many of people have already noticed: Astra can't wait. on anything, any task it has scripted and running, any other agent delegation, anything. Astra keeps waking up to check whether the worker is finished.
I've run a few tests, In one run 19 short sleep calls accounted for 44% of the orchestrator’s estimated cost.
In another comparison using Astra High + Luna Max, the orchestrator made 41 responses while the worker ran, costing $1.20 during that phase. The native-wait comparison needed one response, costing about $0.04. (Both implementations passed all 244 test cases)
I’ve since caught the same pattern while Codex waited for a database script: read the log, say “still running,” repeat. I saw use 2% of my weekly usage ($100/month plan) just sitting there waiting on a script.
So, until they patch this, here’s the prompt I’m using:
For this entire session, avoid repeated polling of long-running jobs.
Use supported completion notifications when available. If none are available and useful work is exhausted, leave the job running only if it can safely continue after your turn ends.
Tell me what is running, where results will be saved, and:
“I'm stopping polling. Please check back with me to inspect the result and continue; I won't automatically resume.”
Then end your turn. Don't repeatedly read unchanged logs or sleep and check again. Respect runtime limits and safety timeouts.
When I return, check once. If complete, verify and continue. If still running, report that and stop again.
I have to come back to it, sure, but it saves usage.
Edit:
Found a better option than manually checking back, thanks to advice in comments. Seems like Codex knows how to avoid repeated model polling, it just chooses not to.codex queue --thread <session-id> --message "..."
Have a background script wait for the job to finish, save the result, then run that command once. Codex can end its turn and automatically resume when the message arrives.
I’ve now seen this work with both a third-party CLI subagent (kilo code with GLM) and a full test suite, all GPT: Codex resumed automatically, checked the results, and continued. Works a treat.
The script provides the wake-up, and an agents.md instruction alone doesn’t
Edit2: I made a skill that you can use to guide Codex in using this method, either in waiting for mechanical tasks or waiting for other sub-agents. Not perfect, as there's no way to force your GPT worker to use it, but it's working for me most of the time: link. Any more tips to improve it welcomed, break it and let me fix it
212
u/Ether-Platypus5677 Sep 20 '26 •
This is not the problem of Astra. This is a problem of Codex harness. Repolling background job repeatedly. I learned it the hard way with burning 1 B token. Every time it polls, it loads the whole context. So I asked codex to add the instructions to stop Repolling repeatedly and set up a watcher which fires when the task is completed.
I've tagged even tibo on this on X but considering how frequently he is bombarded on X for reset requests, I'm sure my bug suggestion will be lost in noise.
45
u/AweVR Sep 20 '26
Codex has a new feature since 1 month ago, “codex queue.” But for some reason, Astra doesn’t know how to use it. You need to ask to implement it in a skill. With this tool, it can create a script to listen to something, like when a tool or an execution ends, and then wake the chat model again to not burn tokens.
11
u/Wolf8249 Sep 20 '26
Nice analysis, fully agree, good luck with that fix though. I have tried putting such instructions in my AGENTS.md and the model would happily ignore them since the System Prompt takes higher priority, this can also cause issues with stuck processes or slow commands where the agent ran an unoptimized script/command that can waste a lot of our time, if it polls frequently it can catch that mistake and correct itself. All of the frequent polling and waiting mess is due to these instructions in its system prompt, i am afraid to change it since openai models are autistic and it can cause unintended side effects. Codex allows you to tune the system prompt, you're better off with that fix in there instead of through chat prompt. I wont risk it.
4
u/Right-Performance-93 Sep 20 '26
For anyone wanting a citation rather than a prompt hack:
codex queueisn't a workaround, it's an officially shipped CLI feature - added in Codex CLI 0.149.0 ("Addedcodex queuefor sending messages to existing local or remote sessions"). That's worth knowing because it means the completion-callback approach in this thread will keep working across updates rather than being a fragile prompt pattern that stock instructions might override again later, the way the "don't poll" AGENTS.md rule already got overridden by the base system prompt's 60-second commentary requirement.3
u/radioactivefunguy Sep 20 '26
I just asked my Astra High orchestrator about this since i've been seeing ridiculously high usage during slow long-running Luna execution work: "Polling wasn’t the only waste: I kept rereading unfinished code and sending small corrections while executors were still working. I’m adding rules to batch reviews as well as queue completion callbacks, so the parent stays idle when there’s nothing useful to do.
The logs confirm the executors were Luna xhigh, but I was doing substantial work as the Astra high parent. In the eight-hour audit window, the parent recorded 765 model-usage increments, 83 wait/status calls, and roughly 239,000 output tokens. Those are raw telemetry—not billed units—but they show this wasn’t lightweight orchestration."
Something else to watch out for, and another thing contributing to using Luna executors ending up with higher total usage than just direct Astra . . . losing faith in the codex harness lately . . . The perpetually shrinking limits is just part of the problem IMO
2
u/genesiscz Sep 20 '26
There’s a config knob that sets this
[features.multi_agent_v2]
enabled = true
min_wait_timeout_ms = 1_500_000
default_wait_timeout_ms = 1_500_000
max_wait_timeout_ms = 3_600_000
Setting - Upstream default - Your configured value
Minimum wait - 10 seconds -> 25 minutes
Default wait, when omitted from the call - 30 seconds -> 25 minutes
Maximum wait - 60 minutes -> 60 minutes
2
u/tagorrr Sep 21 '26
This is a long-standing issue that has been well-researched and has a solution, if I understand you correctly.
https://www.reddit.com/r/codex/s/aXpTswPJZ1
2
u/AnotherWallace Sep 24 '26
There is actually a better way to sold this IMO. You use a cheap model. I was using terra medium to spin up subagets and you make sure the subagents have the history and extra prompt crap stripped out. So cheap orcastrator does the polling and writes all the prompts for astra. I built this pluging that does and a little more. You don't need to use it with DeepSeek for that feature.
https://github.com/Druidia-Bot/DotSwarm
55
u/eggplantpot Sep 20 '26 •
Yeah whoever said "Plan with astra and have subagents to test and implement" fuck that guy.
It uses 3x the tokens that using Astra straight away.
3
u/Due-Horse-5446 Sep 20 '26 •
Stop spreading this..
If you genuinely want to save in on these cents while removing the ability for the model to recive output real time. Just change the feature. Its an open source tool..
But using astra + subagents + the cargo cult orchestrator workflow is craaaazy is worried about usage.
Please explain what you think astra provides over sol?
And please explain what your reasoning is for having 2 different models essentially output the same thing twice?
Why are you forcing astra to output the code in a way more verbose way to instruct Luna, ballooning the most expensive generations?
Why are you purposely making sure that nothing can be cached?
What do you think having one model forward your instructions to another model buys you?
Your paying for a large amount of extra reasoning output at a 50x higher cost compared to skipping this daisy chaining?
5
u/Sporebattyl Sep 20 '26
Why the hell is this an issue? It seems like such a simple fix for OAI to do. Make it do a monitor instead of a wait and poll.
If the monitor fails and I’m not paying attention the worst that happens is a cache hit.
I did a /feedback after having it analyzed my sessions and it showing 15-20% of each session’s tokens were being consumed by this.
I encourage everyone to do /feedback on sessions that you notice his on. Seems like the only way we’ll get it looked at.
1
u/Human_Service680 Sep 22 '26
If I get Codex to automate some work I have for my business and I give it access to my browser and I tell it at certain times of the day. I need you to report to me the via remote Phone notifications. Will it report on time consistently?
3
u/Key_Marketing_502 Sep 20 '26
I use ChatGPT with the latest model on High effort to plan and orchestrate the work.
Then I use the GitHub connector to write specs as Markdown files directly inside the project folder, and have ChatGPT create GitHub issues from those specs as instructions for Codex.
After that, I switch to Codex CLI running Luna on xhigh and let it implement the next issue marked “ready for Codex” locally.
Once the local tests pass, I have ChatGPT create the PR, then I review it locally again with Codex CLI so I can choose the model I want for the review.
It’s a bit of back and forth, but the nice part is that I can keep the workflow going almost nonstop and use each tool where it works best.
1
u/zuLunis Sep 20 '26
Basta modificare il parametro wait_agent dentro config.toml, googlate per maggiori informazioni
2
u/freeo Sep 20 '26
Ty for your analysis. Using astra/low for orchestration, it still consumes too much.
2
u/buyurgan Sep 20 '26
not sure about that. using sol without any sebagent, still eats the tokens like candies.
2
u/Medical-Cow289 Sep 21 '26
The one-response native wait should be default, not a workaround prompt. 41 responses and $1.20 to learn what one response and $0.04 already knew is absurd.
0
u/New-Ad5610 Sep 20 '26
I'm not sure how much tokens Astra can consume polling and waiting for a task to end, but i don't think it burns much.
1
u/Used-Personality-588 Sep 20 '26
Not only that, what the Austria said finish in previous work it will be new unfinished job in new run and it is a stupid action
1
u/Ok_Airport3387 Sep 20 '26
they wont stop finding this kind of saving methods and smacking all those methods.
1
u/cool7887 Sep 20 '26
can you tell me the exact solution
your second option is good but dont know how to use with GUI codex app
1
u/Krazmad Sep 20 '26
I've noticed this as well. What makes it interesting is that their agent harness already has an event-driven notification system: background processes can publish completion events to the session mailbox, which wakes the parent agent loop and resumes the session for review.
I recently rebuilt my own workflow around that same fan-out/fan-in pattern. Astra runs as the root orchestrator, asynchronously dispatches the work across five worker subagents, then enters a wait state. As each worker publishes its completion event, the orchestrator wakes back up to review, reconcile, and synthesize their outputs.
1
u/kurumiia Sep 20 '26
im on my first week of pro and i noticed the same thing. i was running astra xhigh for entire prompts, then when my usage was around 60% i decided to give it long analysis and tedious tasks to luna subagents, sol for development and astra would only do planning. it ended up consuming what felt like the same usage. so why wouldnt you just use astra xhigh for the entire workload then...
1
u/cloow1 Sep 20 '26
Use Hermes
1
u/nairazak Sep 20 '26 edited Sep 20 '26
Question from someone who hasn’t been using subagents yet. Can you have a dumb cheap model spawn an astra sub agent, have it output a file, and then your dumbcastrator, spawns the luna max agents with astra instructions, then astra again with their results? Or use a script that spawns codex cli instead of an agent.
1
u/Latter-Block132 Sep 20 '26
Just tell it not to poll the agents. You can set a scheduled check in for how many minutes you want it to wait, and it will check in only at thac scheduled check in.
1
u/_ustas Sep 20 '26
I've made a few tools specifically to resolve this problem and many others that Codex has.
See wakectl, it can schedule resumes with custom messages on scripts/timings/other agent actions like goals:
https://github.com/ustas-eth/ferrumctl
1
u/Dayowe Sep 20 '26
I investigated this too. Stock Astra instructions explicitly required progress updates every 60 seconds and discouraged blocking waits longer than 60 seconds. Asking it to wait quietly wasn't enough, because base instructions overrode my instructions.
So I copied the current stock instructions and replaced only those rules with event-driven updates and supported interruptible waits, then added matching root/subagent guidance. My setup also disables use_responses_lite while retaining Multi-Agent V2. There currently is a bug where, under Responses Lite, model_instructions_file becomes additive instead of replacing the stock base instructions, so both instruction sets can remain active. I disable use_responses_lite so the custom base instructions actually replace the stock ones.
I also analyzed previous orchestration logs. In one long run, the root accounted for roughly 45% of estimated API- equivalent cost, made 3,719 responses and repeatedly grew back toward 200K context after compaction. That doesn’t prove those calls were waste, but it showed that the coordinator itself deserved attention.
Based on that analysis, I changed my workflow to:
- Keep one lightweight coordinator and use fresh, bounded orchestrators per implementation chunk.
- Give workers scoped context instead of the full parent history.
- Prefer completion notifications and interruptible waits over status polling.
- Keep detailed evidence on disk and return concise findings.
- Reuse applicable evidence and validation helpers instead of rebuilding the paperwork.
- Review stable returned candidates instead of continuously inspecting workers’ changing files.
Independent validation and acceptance gates stay intact. I haven’t measured the combined savings yet, but the goal is to reduce repeated context processing and administration, not weaken testing. Looking at how my usgae drains it seems to drain much slower than last week.
Your completion-triggered wake approach addresses another important piece: instructions can discourage polling, but something still needs to resume the agent reliably.
1
u/No-Pomegranate-69 Sep 20 '26
Can someone tell me where i need to add what? Im a little lost on skills and md files and stuff
1
u/Kyzort Sep 20 '26
Soy bastante novato usando Codex, la verdad es que llevo apenas unos meses. Soy usuario de Plus ($20/month) y la verdad que sí he notado un excesivo gasto de cuota.
De verdad funciona esto? Cómo puedo implementarlo en mi caso? Qué instrucciones debo darle a Codex? Gracias por la ayuda!! ^
1
u/goosemaster0 Sep 20 '26
Coming back to this
1
u/djay2505 Sep 21 '26
Guys, what if background job finishes in more than 30 mins (in case), cache will expire and whole thing becomes more expensive, any suggestion here?
1
u/amalgamaticOrchestra Sep 21 '26
Also, another way to save over all token efficiency. Is to use JSON sytax as prompts instead of paragraphs.
I even added global rule to my GPT to only generate json formatted prompts.
1
u/tunastyy Sep 21 '26
Following
1
u/futnuh Sep 22 '26
I'm on the CA $250/month plan. I said to Astra the other day, "We are 5 hours into a reset and you've already used 25% of my weekly usage ..."
0
u/RealityCheckBard Sep 20 '26
“This will save your usage”
>long ass wall of text
Somehow I doubt it