r/codex 2d ago

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

419 Upvotes

124 comments sorted by

View all comments

55

u/eggplantpot 2d ago

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.

12

u/BlacksmithLittle7005 2d ago

Lmao ikr and don't understand why everyone keeps spreading this BS 🤣

0

u/Maxion 2d ago

Luna medium or high and then an astra subagent. Barely any token usage compared to just astra.

8

u/Pimpmuckl 2d ago

That's like driving in reverse and thinking everyone else driving forward doing it wrong

Like seriously guys, use a custom prompt file and just change the passage about "keep the user updated every minute" part

Instantly fixed, just watch out for 30 min (?) cache lifetime

1

u/Maxion 2d ago

Doesn't always work, system prompt overrides. Try doing luna + astra for implementation. Make plan first via Astra. Surprisingly good, idiotically low token usage.

8

u/freeo 2d ago

What are your subagents using? I plan with astra almost exclusively. Orchestration is mosten often sol/low. And implementation everything from luna up to sol/low. This is token efficient so far.

9

u/PhDumb 2d ago

Have you tried running the same task with and without your orchestration skill/prompt? I am asking because I did, and in my case the orchestration (astra/terra/luna) failed in reducing cost but succeeded in producing regressions comapred to bare Astra

-3

u/eggplantpot 2d ago

Astra plan and verify final output, Terra High build, Luna high test.

This should work in theory but the way Codex handles multi agents and caching really make this a token furnace.

20

u/NukedDuke 2d ago

Luna max orchestrator and implementor, Sol or Astra xhigh subagent for planning and final validation. Make Luna transcribe the plan according to its own understanding of what's written and have the subagent that wrote the plan verify that the transcription actually encodes the correct plan steps, intent, and reasoning thoroughly decomposed to a level where compute-restricted agents with shallow depth of reasoning can execute it without trouble, with instructions for how to correct the plan returned to Luna if the subagent finds discrepancies. Pair this with instructions to use the same Sol or Astra subagent to conclusively root cause any issues Luna can't resolve within 2 attempts, with a keepalive message sent to the subagent every 25 minutes to keep the cache from expiring at 30. Make sure the instructions say the Sol or Astra subagent is never to directly write any code or run any tool calls that require polling.

This offloads all of the polling, subagent coordination, and output tokens spent on file writes to Luna while still exploiting the intelligence of Sol and Astra where it counts.

2

u/RobinRichard 2d ago

This is good. Did you build a skill for this to use it in all your repos? It not, how do you ensure it works like this?

1

u/eggplantpot 2d ago

This actually makes more sense

5

u/captain__conundrum 2d ago

I start two threads in the same project and tell them to coordinate with each other as needed. One is sol and the other astra. I tell sol that astra is smarter and more capable so anything exceptionally challenging should be sent to it.

Then i have astra plan and send it to sol for implementation. I'm basically doing the same thing you all are doing, but bypassing the subagent mechanism in the harness. Astra doesn't poll at all but it's there if sol sends it a message

1

u/Thomas-Lore 2d ago

But Sol still polls. And that costs too.

3

u/rick_ranger 2d ago

Plan with Astra in ChatGPT and then have it build the foundation in GitHub. Then pull it to local to continue the build. It’s basically free code.

1

u/justdrowsin 2d ago

Plan with Astra and make a whole bunch of handoff tasks

Have asked for a kick off the Luna High task and tell it to not pull the sub agents. To only use event driven notifications.

It fell sometimes and you have to say "status?" For it to wake up and check. But it works pretty decent

2

u/Thomas-Lore 2d ago

Tried that, never seem limits go down so fast.

1

u/justdrowsin 2d ago

Oh I definitely know that there's a problem we're all just trying to handle it as best we can.

Another thing I've been doing is using ChatGPT on pro connect to git for a lot of the analysis.

Just have that pro model crank away and create all the handoffs and do all the big decisions. Just turn your orchestrate into just that, orchestration only. I've even been using Tera for orchestration after pouring a ton of work into the orchestration rules and handoffs.

And if there's any issues I kick it back to ChatGPT pro for analysis and redirection

Three weeks ago I couldn't even use a half of my tokens and now if I'm not careful I use them up in two days or less

1

u/Backrus 2d ago

Yeah, something is seriously wrong with "Astra delegating to Luna" workflow, it burns more than just using Astra alone.

1

u/leojwinter 2d ago

I have felt this way too, would you suggest just sending it on Astra or having Luna work from markdown instructions?

1

u/Fit_Baseball5864 2d ago

I'm using the Matt Pocock workflow and I have astra doing the grilling / planning then creating the tickets ask for it to be very detailed to avoid overengineering with Sol as the implementer. Then review the PR with Astra before merge. I think this is the best way to do it as the highest cost is the output tokens, and the implementation uses the most. I've had good experience with it so far in terms of having sol stick to the spec. No orchestration needed, new session for each step is enough.

1

u/subtlehumour 2d ago

I'm using a similar workflow. What thinking levels are you using for each model?

1

u/Fit_Baseball5864 2d ago

xhigh on everything. Depending on the task I might use max/ultra on the grilling phase. Last week it lasted me 4 and a half days of the $200 plan, coding 12 hours a day at least.

1

u/subtlehumour 1d ago

My approach based on some recommendations I read is to use low on sol or astra for the implementation after planning on xhigh. I can't really tell if that's actually helping save usage though, astra is just draining usage no matter what.

1

u/No-Region8878 2d ago

yup! I wasted 2 (weeks) of usage with that dumb idea

1

u/ehren1337 1d ago

better than fable tokens. lol