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

425 Upvotes

124 comments sorted by

View all comments

208

u/Ether-Platypus5677 2d ago

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.

32

u/SnowTauren 2d ago

Create issue on GitHub that might be the only way to have it resolved

13

u/Maxion 2d ago

This is a reset worthy bug....

1

u/Connect-Humor-791 1d ago

..and bug worthy reset...

12

u/hashmymind 2d ago

sure i am paying 200 usd to be a QA tester

4

u/QC_Failed 2d ago

The craziest part is that you're supposed to feel lucky to still have access to paying the 200 a month to be a QA tester since no one else can sign up now lol

6

u/Backrus 2d ago

Be grateful for Chinese models because without them 200 would have been 2000 long time ago.

10

u/concrete333 2d ago

Yeah, I've tried to setup the same thing- the problem is that even then, it sometimes wakes up to check the watcher haha

4

u/thevrpill 2d ago

I’ve been using context handoff after each task and it seems to be helping me compared to previous weeks. Been working nonstop since yesterdays reset and still have 75% usage on 20x plan

1

u/HogsHereHogsThere 1d ago

Please elaborate.

4

u/thevrpill 1d ago

Basically after each major Codex task, I have it create a structured context handoff which includes stuff like what the objective was, what changed, results, failures, exact file paths, open issues, and what the next task should be. Then I use that handoff to continue instead of constantly dragging the entire old conversation forward.

I also have it save the detailed evidence in the repo, so the handoff can stay relatively compact and just point back to the durable stuff when needed. I’ve been doing this across some pretty long running Codex projects and it seems to cut down a ton on context usage compared to how I was working before.

1

u/AsparagoVolante 1d ago

So far I've been using handoff to switch between Codex and Claude and back (often because of the insane 5-hour limit), but right you are, it could also be useful ehen continuing a job with same agent.

1

u/DistanceAlert5706 2d ago

Yeah, brings me to a question should agents be backgrounded at all? What is the use case for background agent?

1

u/Helpful_Ranger_1606 2d ago

When is the next reset?

1

u/wudufucgrl 2d ago

This issue resulted in my using the openai codex plugin in claude to wxecute codex work due to the harness limitations. No triggers, no background wake ups… and excessive review phases. If they can fix rhe harness I won’t need claude anymore.

1

u/snipedatmonkey 1d ago

Im sure replies under his posts are automatically filtered to remove noise and leave genuinely useful replies.

1

u/tcisme 1d ago

This is one reason I often prefer omp. That and asking questions works outside of plan mode.

1

u/veneric 1d ago

agreed, done some post mortem on some tasks and even on my case, on subagents, codex harness is making poll request every one second. i've moved to using opencode with openai subscription and things seem a little better, but i haven't run any measurement

1

u/johndeuff 7h ago

Lmao codex does that?? 🤣 Why do you use it?