You know that feeling when you've got an agent loop running,
it's been cooking for like three hours, it's about to write the final test suite,
and then...
boom.
Just a, a cold, empty HTTP 400 Bad Request.
Whole run, gone.
Oh, it's- it's the absolute worst.
Especially because, like, you're looking at the OpenAI docs,
and they're shouting about this massive, one-million-token limit for the new GPT-5.6
models...
Sol, Terra, Luna.
You think you have all the room in the world, right?
But first, a quick shout-out to Jellypod for making our daily show possible.
Now...
Ethan, why did my three-hour agent run just faceplant into a 400 error?
Well, it- it turns out those one-million-token limits in the docs...
they aren't what the backend actually lets you get away with in real-world API
calls, at least not with the way Codex CLI was feeding them.
The local metadata in the older CLI versions was...
well, it was all over the place.
It was fluctuating, sometimes claiming 372,000 effective tokens,
other times dropping to 258,000.
So the local CLI keeps greedily packing files, terminal outputs,
and context into the prompt, thinking, "Hey, I've got plenty of space!"
And then the API server just violently rejects the payload because it actually hit a
hard ceiling.
Wait, so the CLI was essentially lying to itself about how big the window was?
That's...
I mean, no wonder it crashed.
It's like trying to squeeze a moving truck into a standard parking spot because your
GPS told you the spot was fifty feet wide.
Exactly!
And that's exactly what the Codex v0.144.6 release tackles.
If you look at commits #33972 and #34009, they did a hard
correction of the local metadata.
The current freshly fetched catalog now exposes a unified context window of exactly
272,000 tokens.
No more guessing, no more weird fluctuations.
Okay, so 272,000.
That's...
it's specific.
But how does having that exact number locally stop the 400 errors?
Does it just stop reading files when it hits 272k?
Not quite.
It's actually smarter than just hitting a wall.
See, because the local CLI now *knows* the limit is strictly 272,000 tokens,
it can trigger its internal auto-compaction and sliding-window history truncation
*before* it sends the request.
It cleans up its own room locally, rather than letting the server do the screaming.
Ah, okay.
So it's- it's like a proactive edit.
It trims the fat, slides the window, and makes sure the payload is lean enough to
pass the gatekeeper.
That's...
I mean, that's going to save so many autonomous runs from just dying mid-task.
Right.
And they didn't just stop at the context window.
They also refreshed the bundled system instructions for the whole GPT-5.6 family...
Sol, Terra, and Luna.
Apparently, the older prompts were causing the models to get stuck in these slow,
circular reasoning loops.
Like, it would invoke a tool, think about it, invoke it again slightly differently,
and just burn through credits while inflating latency.
The classic AI rabbit hole.
"Let me search this again just to be sure."
So the new instructions make them more...
direct?
Yeah, they guide the model to output tool invocations much more reliably the first
time.
Less hesitation, more doing.
Speaking of hesitation...
can we talk about the package manager turf war that's been going on in the
background?
Because if you're a pnpm user, the Codex JS launcher has been...
well, let's say "stubborn."
Oh, the pnpm folks have been fighting this for a while.
Issue #30440, right?
Yes!
Exactly.
So, standard Node paths are pretty predictable, but global bin directories in pnpm
can be a completely different beast.
Before this update, if you ran something like codex doctor or tried to upgrade
through the terminal UI, the launcher would just completely miss the fact that you
were using pnpm.
It would default to npm or Bun, mess up your local paths, and leave you with these
weird, broken, stale binaries.
It was a mess.
Huh.
So how did they actually fix that detection?
Because pnpm's global structure is famously nested and...
well, tricky.
So, PR #31503 has this really elegant workaround.
When you start Codex, the JS entrypoint does a recursive scan looking for a very
specific file: node_modules/.modules.yaml.
That's pnpm's unique metadata file.
If it finds that, it knows, "Aha, we are in pnpm territory."
And then it passes a specific environment marker...
CODEX_MANAGED_BY_PNPM=1...
directly down to the native Rust-based CLI binary.
Oh, I see!
So the Rust binary doesn't have to do the heavy lifting of parsing Javascript folder
structures; it just looks for that single environment variable from the JS wrapper.
Exactly.
And once that flag is set, everything falls into place.
If you run codex doctor, it actually recommends the correct pnpm commands instead of
trying to force npm down your throat.
That is...
honestly, such a relief for monorepo and pnpm setups.
So, if someone is listening and wants to get this sorted right now,
what's the play?
Super simple.
Just run pnpm add -g @openai/codex to grab
v0.144.6, and then run codex doctor to make sure it's seeing the global setup
correctly.
It should point to the clean pnpm command lines for all your future updates.
Beautiful.
No more corrupt paths, no more 400 Bad Request crashes at 2 AM.
All right, that's it for our quick look today.
Catch you next time.
Bye everyone.