r/codex • • Jul 24 '26
Workaround Possible GPT-5.6 Sol usage workaround: explicit tool batching cut weighted usage by 27–45% in my repeated tests
[deleted] — view deleted post
376
Upvotes
r/codex • • Jul 24 '26
[deleted] — view deleted post
5
u/Zandesh Jul 24 '26
Very interesting! Your post inspired me to turn the idea into an experimental Codex skill for bounded, concurrent tool execution:
https://github.com/JinParkmida/bounded-batch
It is still subject to testing and refinement, and contributions, replications, criticism, and negative results are all welcome.
2
u/kepners Jul 24 '26
Chap this really worked for me! on both Claude and Codex!
93
u/ComputerEngineer0011 Jul 24 '26
Interesting read. I’m sure many of us would like to test this but we don’t have any weekly usage left 😭
41
u/Pronoia2-4601 Jul 24 '26
Thank you so much for this. My Sol 5.6 concurs.
"I tested the new instruction twice on the same task:
So the instruction saved roughly 30% of tokens in this test while producing comparable conclusions and more supporting evidence.
The instructed run:
It inspected fewer distinct files, 34 versus 40, so “more diligent” here means deeper and more evidence-rich within the chosen files, rather than broader coverage.
Two connection retries also inflated its runtime. My conclusion is: batching improved token efficiency and encouraged more investigation, while wall-clock speed remained inconclusive."
TL;DR initial impressions seem positive.
23
u/tulwio Jul 24 '26
Thanks for this OP. I tried it and got similar results. It really is absurd that users had to reverse-engineer a workaround for GPT-5.6 burning substantially more quota because OpenAI shipped an under-tested orchestration regression. This should have been caught before release, but I guess Voice mode and capturing Claude Code’s audience with fake resets was prio…
20
u/gtgderek Jul 24 '26 edited Jul 24 '26
Alright... I am not one to look at post about saving tokens, but damn I am glad I checked this one. Ran it across two of my code bases with side by side checks with 5 different tests.
Thank you for this!!
The randomised order was C→T, T→C, C→T, T→C, T→C. Every treatment used one nested Promise.allSettled cell with four calls; every control made four serial tool calls. Median observed wall time was 24 seconds for control versus 20 seconds for treatment, but treat that as directional because startup/cache effects are not fully normalised.
Tested in Terra Max
**edit to fix grammar.
5
u/dkluis-dpg Jul 24 '26
I asked Codex Sol / High what it thought about the optimize instructions and this is what it answered back:
The intent makes sense, but I would revise it before adding it to
AGENTS.md.The main benefit would be faster work with fewer tool round trips. For example, repository status, file searches, and documentation inspection could run together when none depends on another. I would still keep builds, mutations, approval-requiring operations, and diagnosis driven by earlier results sequential.
One technical correction:
Promise.all(...)does not actually abort tool calls that have already started when one fails. It only rejects without returning the other results, which conflicts with “inspect every result.”Promise.allSettled(...)is therefore safer for most diagnostic batching.Recommended wording:
Effect on my work:
I would place it under
## Working Rules. The conditional “whenfunctions.execis available” is important becauseAGENTS.mdmay also be read by agents or environments that do not provide that orchestration tool.4
u/thonfom Jul 24 '26
I've been running 5 codex sessions on parallel worktrees with my Pro plan, running into weekly usage limits almost daily. I'll give this a try and report back!
4
u/Acehan_ Jul 24 '26
Amazing work! Good stuff.
4
u/Big-Independent-3093 Jul 25 '26 edited Jul 28 '26
I used your AGENTS example and added a few modifications of my own:
Agentic Loop Suppression: Independent reads, checks and tool calls are grouped into a single batch for each phase. Separate model cycles are avoided when they would only describe progress, poll for unchanged results, or re-analyze the same outcome.
Limited Context Lifetime: Each new phase starts from the latest validated checkpoint. Old conversation history, completed phases and already hydrated owner context are not carried forward automatically.
Now added this as well. I’ll test it and see how it performs:
Compaction Quality Trigger: Compaction is not treated as a failure by itself. The key question is whether it is followed by a patch, test, decision, or other required evidence. Once the stop condition is satisfied, the task ends. The next independent milestone in a long-running session starts as a fresh task.
Results so far. I should add that I started with GPT-5.5, so I still need to run more tasks using only GPT-5.6 SOL before drawing any firm conclusions.
On paper, GPT-5.6 SOL may appear to do more “work,” but that does not necessarily mean it is more efficient. It may use more tools, create more intermediate steps and explore several possible approaches before deciding which one best fits the task. That can result in more reasoning and higher usage, even when the final result is similar to what GPT-5.5 produces with fewer steps.
So more reasoning is not automatically the same as better efficiency. The real question is whether the additional exploration produces a meaningfully better result or simply reaches a similar outcome at a higher cost.
EDIT: More tests, results and conclusions can be found in the replies below. My final conclusion, based on longer-term testing, is that an optimized GPT-5.6 SOL setup works best for me. Ultimately, though, you should choose the model and workflow that best fit your own needs.
3
u/gradstudent2019 Jul 24 '26
How did you generate that exact instruction?
3
u/PaperDry2796 Jul 24 '26
why do we have to debug their tooling
4
u/ekzess Jul 24 '26
This is VERY good stuff.... Well, done so far. Totally yoinked it.... 😉
6
u/HiperWars Jul 24 '26
I'm curious to see the outcome of this. I already use tools like 'Headroom', 'Serena MCP', and 'RTK' as standard parts of my workflow; they help me save quota while delivering the results I need.
2
u/MatlowAI Jul 24 '26
Can confirm this concept works generally just reminding it that it that cache hits cost 10% of input tokens and that to save money it can run parallel tool calls did the trick. I also use a graph based unique id notation system so that grepping is more efficient too that ties notes to code more closely and since grep is pretty native it is more cleanly used I've seen vs dedicated graph db type arrangements and is less likely to fall out of sync. This way instead of 5 different greps to find what you need it does 1 or 2 saving cache hits. It does over retieve a bit though which balances that out some but it's occasionally useful.
2
u/Calm_Pass_4289 Jul 24 '26
I feel like giving all these workarounds just exposes more weakness to them and they either patch it out or just assume everyone will use this and further decrease overall usage.
2
u/ConsistentAndWin Jul 24 '26
Codex evaluated this Post and told me I should use it as well. So it's being implemented as we speak. We'll see if I notice much difference.
2
u/thomasthai Jul 27 '26 edited Jul 27 '26
My stats
1
u/DannyKoll1 Jul 24 '26
will try thx
1
u/Own-Professor-6157 Jul 24 '26
Unfortunately it's still double reading files for me. That's been my biggest loss in tokens.
1
u/justlaughandmoveon Jul 24 '26
OP, I just added your new findings to my file. Will it affect projects that are already running I have long threads for sites and apps that I use daily that are a tad complexe and use up a lot of usage. Will they be impacted too or must I start fresh threads?
1
u/greatsmokematrix Jul 24 '26
Curiously, xhigh 5.6 reasoning mentioned that the tools w
Suggested this instead:
"Efficient tool execution
Keep operations sequential when:
Mentioned this: "Honestly, I’m very confident about the core logic, but the complete file I gave you is not closely equivalent in scope to the original. My assessment Core concurrency behaviour preserved: approximately 85–90% Similarity of the entire AGENTS.md section: approximately 30–40% Confidence it produces the same token savings: only moderate The original instruction is narrowly about tool orchestration: Batch independent calls within a bounded stage. Use Promise.allSettled() when partial results remain useful. Inspect every result. Use Promise.all() when one failure should abort everything. Keep dependent, adaptive, approval-sensitive, and conflicting operations sequential. Do not unnecessarily divide one batch across multiple model turns. Our version preserves points 1, 3, 5, and 6. However, it deliberately removes the exact Promise.all() versus Promise.allSettled() distinction and adds many unrelated engineering rules covering implementation, mutation safety, verification, hallucinations, reporting, and subagents. The important technical difference The original appears written for OpenAI Programmatic Tool Calling, where generated JavaScript can coordinate tools using promises inside a hosted runtime. That mechanism can reduce tokens meaningfully when it filters or aggregates intermediate results before returning them to the model. � OpenAI Developers Normal Codex CLI parallelism is different. OpenAI’s Codex prompting guide says to use its native multi_tool_use.parallel mechanism and specifically says not to emulate it through scripts. � OpenAI Developers Therefore: For an API/harness that actually provides programmatic tool calling, the original is more precise. For a normal Codex project using AGENTS.md, our native-parallel wording is more portable and appropriate. The large complete file probably offsets some token savings, because every applicable AGENTS.md is injected into the conversation. OpenAI explicitly warns that large instruction files consume scarce context and recommends a short AGENTS.md serving mainly as a map. �"
1
u/Odd-Conversation-101 Jul 24 '26
What do mods/devs think of this solution?
Have u tried to dm them on how to make codex better again?
1
u/-LightHeaven- Jul 24 '26
I pointed this thread to codex and asked to audit the chat sessions to see if this was happening.
It looked into 51 recent chat sessions and found that from almost 5200 calls only less than 400 were batched, all others had this behavior of being called one at time and going to the llm in between.
I added your instructions to my personal preference and after 4 hours of intense work the number of used tokens (and therefore used quota) dropped drastically, without any perceived quality degration.
I was at ~650-700M tokens used for today and at 80% weekly left when I added the instructions. Now it's showing 940M tokens for the day and usage dropped to 74% despite having quite a few of work done. Yesterday my usage was about the same for the day and ended up crossing 1.2Bi tokens when I was done for the day (so around the same time as now)
1
u/rabbit12345a Jul 26 '26
First of all, thanks to the OP for sharing this workaround
I tried this in `C:\Users\owner\.codex\AGENTS.md`, and Codex started running four or more commands in parallel within a single turn. It also seems to use less quota than before
Since I completely disabled auto-review, I no longer get the unreasonable 30% usage increase that used to accumulate between the start of a task and the first context compaction
According to ChatGPT GPT-5.6 Sol, truncation can be mitigated by adding the following root-level setting to `config.toml`:
`tool_output_token_limit = 200000`
I tested it with two tasks and did not encounter any problems. Those two tasks used 20% of my Plus quota
1
u/yusing1009 Jul 29 '26
It will be better writing it in an overridden base instruction (and remove existing rules that contradict the new guidance).
1
u/mwillbanks Aug 02 '26
I found this exact same thing this past week, I was running post mortems and codex itself found that it was doing this. When I ship MCPs now I always ship with a skill bundled and those deliberately state batching usage and tell the agent how to batch and why and then my global AGENTS.md instructions state to leverage batching whenever feasible.
1
u/Emergency-Elk7527 Aug 05 '26
You can't talk about work around on reddit. It's monitored. Whatever may have been discovered will be patched. Once you disclose it here.
1
u/Emergency-Elk7527 Aug 05 '26
I know a real work around. This is not it. Essentially unlimited..no joke.
-12
u/TheOwlHypothesis Jul 24 '26
https://blog.cloudflare.com/code-mode/
Are you pretending you invented code mode?