Live data from Hacker News

Unrolling the Codex agent loop

openai.com

171–180 of 220 posts

Re: Unrolling the Codex agent loop

#171
post #60

The best part about this blog post is that none of it is a surprise – Codex CLI is open source. It's nice to be able to go through the internals without having to reverse engineer it. Their communication is exceptional, too. Eric Traut (of Pyright fame) is all over the issues and PRs. https://github.com/openai/codex

For some reason a lot of people are unaware that Claude Code is proprietary.

I frankly don't understand why they keep CC proprietary. Feels to me that the key part is the model, not the harness, and they should make the harness public so the public can contribute.

Re: Unrolling the Codex agent loop

#172

Earlier quoted context omitted.

Yeah this has always seemed very silly. It is trivial to use claude code to reverse engineer itself.

That is against ToS and could get you banned.

How would they know what you do on your own computer?

Re: Unrolling the Codex agent loop

#173

Earlier quoted context omitted.

All of these agentic UIs are vibe coded. They advertise the percent of AI written code in the tool.

which begs the question: which came first—agentic AI tools or the AI that vibe coded them?

…the AI…

Re: Unrolling the Codex agent loop

#174
post #164

Earlier quoted context omitted.

"encrypted_content" is just a poorly worded variable name that indicates the content of that "item" should be treated as an opaque foreign key. No actual encryption (in the cryptographic sense) is involved.

Are you sure? For reasoning, encrypted_content is for sure actually encrypted.

Hmmm, no, I don't know this for sure. In my testing, the /compact endpoint seems to work almost too well for large/complex conversations, and it feels like it cannot contain the entire latent space, so I assumed it keeps pointers inside it (ala previous_response_id). On the other hand, OpenAI says it's stateless and compatible with Zero Data Retention, so maybe it can contain everything.

Re: Unrolling the Codex agent loop

#175
Regarding the user instruction aggregation process in the agent loop, I'm curious how you manage context retention in multi-turn interactions. Have you explored any techniques for dynamically adjusting the context based on the evolving user requirements?

Re: Unrolling the Codex agent loop

#176
post #78

I use 2 cli - Codex and Amp. Almost every time I need a quick change, Amp finishes the task in the time it takes Codex to build context. I think it’s got a lot to do with the system prompt and a the “read loop” as well, amp would read multiple files in one go and get to the task, but codex would crawl the files almost one by one. Anyone noticed this?

What is your general flow with amp? I plan to try it out myself and have been on the fences for a while.

I do the same thing with both. Nothing specific to Amp. But I have read it’s great for brainstorming and planning if I “ask oracle” - oracle being their tool that enables deep thinking. So I tend to use that when I think I have multiple solutions to something or the problem is big enough and I need to plan and break it down into smaller ones

Re: Unrolling the Codex agent loop

#177

The best part about this blog post is that none of it is a surprise – Codex CLI is open source. It's nice to be able to go through the internals without having to reverse engineer it. Their communication is exceptional, too. Eric Traut (of Pyright fame) is all over the issues and PRs. https://github.com/openai/codex

Is it just a frontend CLI calling remote external logic for the bulk of operations, or does it come with everything needed to run lovely offline? Does it provide weights under FLOW license? Does it document the whole build process and how to redo and go further on your own?

Re: Unrolling the Codex agent loop

#178
post #26

One thing that surprised me when diving into the Codex internals was that the reasoning tokens persist during the agent tool call loop, but are discarded after every user turn. This helps preserve context over many turns, but it can also mean some context is lost between two related user turns. A strategy that's helped me here, is having the model write progress updates (along with general plans/specs/debug/etc.) to…

It depends on the API path. Chat completions does what you describe, however isn't it legacy? I've only used codex with the responses v1 API and there it's the complete opposite. Already generated reasoning tokens even persist when you send another message (without rolling back) after cancelling turns before they have finished the thought process Also with responses v1 xhigh mode eats through the context window multi…

How do you know/toggle which API path you are using?

Re: Unrolling the Codex agent loop

#179
post #143

Earlier quoted context omitted.

The real question is how long it'll take for Z.ai to clone it at 80% quality and offer it at cost. The answer appears to be "like 3 months".

This is a super interesting dynamic! The CCP is really good at subsidizing and flooding global markets, but in the end, it takes power to generate tokens. In my Uber comparison, it was physical hardware on location... taxis, but this is not the case with token delivery. This is such a complex situation in that regard, however, once the market settles and monopolies are created, eventually the price will be what marke…

With optimizations and new hardware, power is almost a negligible cost that $5/month would be sufficient for all users, contrary to people's belief. You can get 5.5M tokens/s/MW[1] for kimi k2(=20M/KWH=181M tokens/$) which is 400x cheaper than current pricing even if you exclude architecture/model improvements. The thing is currently Nvidia is swallowing up a massive revenue which China could possible solve by investing in R and D.

[1]: https://developer-blogs.nvidia.com/wp-content/uploads/2026/0...

Re: Unrolling the Codex agent loop

#180

Earlier quoted context omitted.

worktrees are a bunch of extra effort. if your code's well segregated, and you have the right config, you can run multiple agents in the same copy of the repo at the same time, so long as they're working on sufficiently different tasks.

How do you achieve coordination? Or do you require the tasks be sufficiently unrelated?

I do this sometimes - let Claude Code implement three or four features or fixes at the same time on the same repository directory, no worktrees. Each session knows which files it created, so when you ask CC to commit the changes it made in this session, it can differentiate them. Sometimes it will think the other changes are temporary artifacts or results of an experiment and try to clear them (especially when your CLAUDE.md contains an instruction to make it clean after itself), so you need to watch out for that. If multiple features touch the same file and different hunks belong to different commits, that's where I step in and manually coordinate.
Post reply on HN