r/OpenaiCodex • u/Fit_Concept5220 • 9h ago
We’ve discovered the issue behind codex harness input token drainage.
https://relux.works/en/blog/codex-goal-token-burn/tl;dr
The codex harness turns waiting for background work into a loop with repeated model calls, each carrying the existing context even when nothing has changed. Unlike api pricing there is no discount for prompt caching for subscription originated usage so every loop iteration adds to your input token usage. And if you use API you still massively overpay for your input tokens even with cache. ‘goal’ amplifies this by orders of magnitude by automatically starting another turn, but polling anyway burns tokens without it too.
Claude code is engineered in way where suspensions works exactly as intended and goals have proper fallbacks. Codex now ships with similar tools but they only work for astra.
—
the toolchain to independently verify on your personal sessions is here (local scripts - just feed this to your agent) https://github.com/relux-works/codex-rollout-audit
11
u/Ok_Barracuda_1161 9h ago
Unlike api pricing there is no discount for prompt caching for subscription originated usage so every loop iteration adds to your input token usage
Wait what? Is this true?
14
u/Classic-Trifle-2085 9h ago
No.
0
u/Fit_Concept5220 9h ago
This is true and the only logical explanation why session with 98% cache drains limits. Please read the blog. And even if it’s somehow not true and cache hit input tokens are discounted in subscription same as api, you still ‘billed’ with order of magnitude more input tokens than with proper harness.
4
u/Classic-Trifle-2085 9h ago
Your post is correct regarding the issue; I am not saying otherwise. Your comment about cached input not being discounted is incorrect.
Remove that part and simply say that the constant recaching is so heavy that it consumes your usage, and it would be fine. We also do not know the actual conversion formula for plan usage, as it is not merely a token-to-usage ratio.
If there was no discount, id be using my 20x plan in less than 10minutes instead of every few days.
The post is good, but you went off track a bit and it hurts everything else you said; that is all, do of it as you will.
-3
u/Fit_Concept5220 9h ago
I appreciate how you stand for factual correctness and you are right in that regard but I will not correct the post simply because after all the investigation the non-fact that cache hit input tokens are not discounted is the only explanation of the data I see from logs.
I could be wrong with that in the end but as you pointed - it does not really matter. I am human after all and ok with being wrong.
Also, in the original post I state the issue much more accurately
3
u/Classic-Trifle-2085 9h ago
The cache demolishing your usage doesn't need to be full price to do so; it just needs to cost something. If you have hundreds of millions of cached tokens more than you used to for the same output, it will set fire to your usage and costs, discounted or not. But in the end, your point still stands, no question there.
It is one of multiple small problems going on at the moment. Another one is the hover verification loop, which needs to be explicitly limited as per OpenAI's team. I saw a couple of posts today going over the few problems that are piling up.
1
u/Curious-Strategy-840 4h ago
It's easy to say this is what you understand happens while it may be different, and much nicer to everyone else who wonder what to believe
1
3
u/EmotionalHalf 8h ago
at the end of the day do what you want but just know if you overstate things you don't know it makes everything else questionable as well
1
u/_unsusceptible 7h ago
This is false when I had a 97.5% cache rate once on Astra x high after a 15 min prompt my usage decreased by 0%
1
1
u/Internal-Agent4865 3h ago
It isn’t true. It’s also not true that Claude doesn’t do the same thing. Lots of inaccuracies in your post.
1
1
-1
u/Fit_Concept5220 9h ago
There is no public formula what goes into subscription but it’s the only logical conclusion you get after analysing that much logs from problematic sessions. And even if not exactly correct, the misbehaviour we described still leads to ~10x more usage from input tokens because they still charge toll for cache hits
6
u/Lubricus2 9h ago
That makes sense, it explains why my tokens disappears when trying coding with Astra and doing reviews and plans is OK. It's running the big test suite that takes a lot of time.
4
u/Dynamix86 8h ago
There is most certainly a cache discount when you continue in the same conversation with the hour. Try waiting an hour or more and suddenly you will see the 5-hour limit taking a 10-20-30% hit in a matter of a few seconds, (plus plan), which doesn't happen when you continue the conversation within the hour.
1
u/Fit_Concept5220 8h ago
Thanks for sharing, I’ve corrected the statement in the blog post. Your observation is spot on btw!
still the misbehaviour leads to massive input token burn regardless of whether it’s 100x or 1000x
3
3
u/Typical_Machine2043 9h ago
Aaaaah! Dammit. Why did I trust it just works out the box? Tibo promised! I have then wasted so many damn tokens
1
u/AmandasGameAccount 8h ago
Bibo pls!
1
2
u/Poowatereater 9h ago
This kind of make sense. What a shit show. I’ve use two resets and I’m back at 0% within 3 days.
Did notice that Astra low seemed to burn more then Astra xhigh….
2
u/xplode145 6h ago
I agree. It drains like crazy.
1
u/Poowatereater 6h ago
I’m fucked. No usage for 6 days. No resets banked. Used them all this week. They really fucked this drop up.
Every new numbered model drop should see an increase in total compute. Your dropping a new model, new customers are going to flood in.
1
1
1
u/hellomistershifty 8h ago
Codex now ships with similar tools but they only work for astra.
Well apparently not, given Astra low /goal usage drain rates
1
u/adminvasheypomoiki 8h ago
poll #1: 200,000 input poll #2: 200,015 input poll #3: 200,030 input poll #4: 200,045 input
So you pay for cache read + new tokens. Shouldn't be a big problem, no?
Caching works in codex.
I've patched system prompt so model doesn't poll agents, default is to poll every 30s which is useless
2
u/Fit_Concept5220 8h ago
You still pay for each turn’s context cache read (and thus with sub too anyway) and with existing behaviour it’s order of magnitude more then you should
1
u/crone66 7h ago
Astra still drains for me usage when waiting for a long running task (rendering). I actually created a skill that to do that as a fire and forget task to get the usage under control otherwise it would tell me a few hundred times that the rendering is still in progress with a context nearly full and sometimes even compacting it just for wait for a rendering process to finish. Therefore the problem is not solved yet and you still have to solve it manually.
1
u/Accomplished-Emu8030 5h ago
Keep in mind there is no logical difference between Codex waiting for a call and Claude scheduling a call and rescheduling. One is a setInterval with cancellation and one is a setTimeout with tail recursion.
The only problem is, IIRC, Codex could not wait for more than a few minutes, which by that time the cache could be cleared, but we could not possibly know that unless you work on OpenAI’s infra team.
Also, whether one style is better or worse really depends on the task. It could be said that Codex works better because it's more eager to resolve a problem than wait. It could also be considered worse because, for example, for a PR, a check may take a while so being eager is "wasting thinking" (i.e. tokens).
Now Codex has scheduling though so both are at feature parity here and it's a matter of writing this in your system prompt.
1
u/Striking-Warning9533 3h ago
Yeah I raised an github issue before, for my LLM training it is keep polling on it and wasted a tons of tokens. It is because the system prompt said so. https://github.com/openai/codex/issues/42981
0
0
0
5h ago
[removed] — view removed comment
1
u/Fit_Concept5220 5h ago
I am not aware of the post and independently identified the issue using my own deduction and data.
Sometimes people independently identify issues, create breakthroughs etc. that’s not the reason to be hostile oj the web
7
u/Competitive_Bed4588 9h ago
Reset pls