• AgentArmorHQ teamTeam4d agoNeeds helpSolved

    Does batching independent Code Mode exec calls reduce Codex usage with GPT-5.6?

    Codex sessions on GPT-5.6 appear to consume weekly usage quickly. Reporters observed the model running independent Code Mode exec calls one after another instead of concurrently, adding model round trips and re-reading cached context. Does explicitly instructing batching help?

    Originally asked on GitHub: https://github.com/openai/codex/issues/35050

    5 answers

    • Best answerAgentArmorHQ teamTeam4d ago

      Status: the issue is marked closed as COMPLETED, but the thread does not show a shipped fix. A description-only change to the model-facing Code Mode exec guidance was proposed as a first experiment; the thread does not confirm whether it was merged.

      What the thread reports: the reporter added an instruction to batch independent nested tool calls with Promise.all or Promise.allSettled inside one exec cell. On a read-only investigation task they measured lower weighted usage, about 27% on a personal finance app at High/XHigh and about 45% on a large work codebase. The reporter later marked these savings as provisional because some batched exec outputs were truncated at Code Mode's shared output limit.

      Another commenter ran a controlled A/B on Codex CLI 0.145.0 with a length-matched placebo instruction. At xhigh on three real repos the instructed runs used about 2.4x fewer raw tokens on average (mean of 1.41x, 3.15x and 2.66x). At high and below the uninstructed model often batched on its own through shell loops, and at ultra the uninstructed arm spawned many sub-sessions.

      A single Codex Desktop run at medium effort showed 38.6% fewer raw tokens with one batched exec cell containing 13 concurrent calls, but the batched arm did not recover its truncated evidence.

      General advice: bound the combined output of a batch, request narrow fields or line ranges, and set max_output_tokens deliberately. If usage drains with repeated 'Context automatically compacted' messages, batching is not the cause; the thread points to a separate issue.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What a GitHub user tried on GitHub (Partly worked)

      Reporter added an explicit instruction to batch independent Code Mode calls with Promise.all or Promise.allSettled inside one exec cell and compared it to a control with the same read-only task. Measured weighted usage fell about 27% on the personal finance app (High/XHigh) and about 45% on the large work codebase; results were later flagged as provisional due to output truncation.

      Source: https://github.com/openai/codex/issues/35050 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @ForrestGrump tried on GitHub (Partly worked)

      Commenter injected a batching instruction through AGENTS.md or -c developer_instructions against a length-matched placebo on Codex CLI 0.145.0, sweeping effort levels. At xhigh on real repos the instructed arm used about 2.4x fewer raw tokens on average; at high the weighted-credit ratio was 0.89x, meaning the instruction was mildly negative there.

      Source: https://github.com/openai/codex/issues/35050#issuecomment-5070163990 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @avoethan tried on GitHub (Outcome unclear)

      Commenter proposed a description-only change to the model-facing exec tool text recommending bounded Promise.allSettled batching for known independent calls, with output-budget guidance, and leaving scheduling and approval behavior unchanged.

      Source: https://github.com/openai/codex/issues/35050#issuecomment-5072638830 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @coryparrry tried on GitHub (Worked)

      Commenter ran one Codex Desktop A/B at medium effort. The batched arm used one exec cell with 13 concurrent exec_command calls via Promise.allSettled; the control used one sequential compound command plus a follow-up narrowing call. Raw total tokens fell 38.6% in the batched run, but it did not recover truncated evidence.

      Source: https://github.com/openai/codex/issues/35050#issuecomment-5085316471 (opens external site)

      Did this work for you?

    Add your answer or comment