The Codex Changelog
All Episodes
Sandbox Hang Fixes and Enterprise Firewall Workarounds

Sandbox Hang Fixes and Enterprise Firewall Workarounds

0:00|0:00

The hosts break down a rushed v0.145.2 fix for a sandbox regression that left child processes hanging, ports stuck open, and CI pipelines timing out. They also cover the new secrets-scrubbing controls and trusted host bypasses designed to keep enterprise firewalls and NetSec teams happy.


Chapter 1

The Broken Pipes of CLI v0.145.2 and the New Sandbox Isolation Fixes

Ethan Park

So, so, so get this-- v0.145.0 drops, we get our context-saving tools, and then literally forty-eight hours later, the team has to rush out v0.145.2. It-it-it wasn't even a planned release. They had a massive, massive regression with the --sandbox flag where child processes were just... hanging. Like, indefinitely. Just sitting there eating up resources because of unclosed stdin file descriptors.

Maya

Oh, the classic zombie process trap! I-I actually ran into this exact thing when I was testing the release branch. I had this simple background test suite running inside the sandbox, right? Codex crashed-- just went totally silent-- but it kept port 8080 bound. I spent like, I don't know, forty-five minutes scratching my head wondering why I was getting phantom server errors on a port that was supposed to be completely free.

Ethan Park

Port 8080. Yeah, because the parent process died but the child process didn't get the memo. It's because of how they were handling the redirection of standard output. It was creating this local terminal loop that just... swallowed error codes. You'd think the terminal would throw a fit, but it just went quiet.

Maya

Right! It just hangs there, pretending everything is totally fine while your terminal is essentially choked. So, how did they actually patch it in 145.2? Is there a new config we have to throw at it?

Ethan Park

They introduced a new environment variable. It's called-- let me make sure I get the exact spelling-- CODEX_STRICT_SANDBOX_STDOUTS=1. If you set that to one, it forces a complete process-tree termination the absolute second the parent CLI thread terminates. No more dangling pipes, no more phantom port bindings.

Maya

Oh, thank goodness. That is going to save so many CI/CD pipelines from just spinning until they hit their fifteen-minute timeout limits. It-it honestly feels like they had to hack a quick safety valve into the Rust runtime because the OS-level pipe cleanup wasn't triggering fast enough.

Ethan Park

That's exactly what it is. The Rust parent thread was exiting, but because the file descriptors for standard input and output were still technically open, the operating system kernel kept the child process alive, waiting for data that was never, ever going to come.

Chapter 2

Granular Telemetry Scrubbing and Enterprise Firewall Workarounds

Maya

Which actually leads right into the other big headache with this patch. If you're running this in an enterprise environment, those child processes are constantly trying to talk to the local network or dial home for updates, and enterprise firewalls are... well, they're having a field day with it. They're triggering these false positive "Guardian" safety violations left and right.

Ethan Park

Mm, yeah. The deep packet inspection, DPI. The firewalls see traffic leaving a developer's machine that looks like encrypted code snippets or trace logs, and they assume it's data exfiltration. So, v0.145.2 adds this brand-new CLI flag: --scrub-secrets-level.

Maya

Wait, so what are the levels? Is it just an on-off switch or do we get some actual granularity?

Ethan Park

It's got three distinct levels. You've got "basic," which just sanitizes standard environment variables and things like obvious AWS keys. Then you've got "strict," which does a heavy regex sweep for PII-- like emails and IP addresses-- before anything hits local disk or a proxy. And then there's "total."

Maya

Let me guess... "total" just turns the logs into absolute mush?

Ethan Park

Pretty much. It strips out almost everything except the barest error codes. But, if you're behind a crazy strict firewall, that's what you need to keep the DPI from killing your connections. But the really clever fix they added is the local proxy bypass tool. You can configure a .codex/trusted_hosts.json file now.

Maya

Oh, interesting. So instead of completely disabling the local Rust-based command firewall, which is a massive security risk, you can just whitelist your internal company proxy?

Ethan Park

Exactly. You specify the exact domain or IP of your proxy in trusted_hosts.json. The local CLI firewall sees that, says "okay, you're allowed to talk to this specific gateway," but it still blocks any rogue external requests. It's the middle ground that enterprise security teams have been screaming for since the v0.14 series launched.

Maya

So if I'm setting this up on a clean developer VM today, the play is: combine the headless token caching we got in v0.145.0 with this new CODEX_STRICT_SANDBOX_STDOUTS=1 environment variable, and then drop a trusted_hosts.json in the root config directory. That should give you a completely isolated, silent, and compliant setup.

Ethan Park

That's the formula. It's a bit of a manual setup for now, but it completely stabilizes the runtime. No more zombie ports, no more angry calls from the NetSec team. Alright, I think that's the quick take on 145.2. Let's go get some coffee and actually update our test rigs before they break again.

Maya

Yeah, before my port 8080 gets haunted again. Sounds good, let's do it.