Model did nothing except wait for a terminal, but the entire context window was eaten up by something.
Resolved 💬 9 comments Opened Jan 2, 2026 by Nek-12 Closed Mar 29, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
0.77.0
What subscription do you have?
Pro
Which model were you using?
5.2-codex
What platform is your computer?
macos
What issue are you seeing?
I only asked the model to run a single script, it ran the script, but that caused all of 400k tokens to be wasted on something, and caused compaction for some reason. Please see chat logs.
What steps can reproduce the bug?
Uploaded thread: 019b7fc3-e6a9-74f0-b5f3-2dc3118596a7
What is the expected behavior?
You don't compact and don't spend 400k tokens on something that is not visible in the chat, outside of both codex and my control.
Additional information
_No response_
9 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Your script
deploy-prod.shappears to have output a lot of data. When Codex runs tools, it assumes that the tool output is relevant to the task at hand, so it provides that output to the model.You mentioned that this was out of your control, but this script is presumably a script that is in your code base? What behavior would you expect in this case?
@etraut-openai I am unable to see the script's output as the model sees it, but the problem here I think is that because the terminal was not set to dumb, there were escape characters, colors, and intermediate representations (like progress bars) output by that script. If TERM was dumb, (maybe caused by #6850 ?) the script shouldn't have output a lot of data like that.
Tool output is not all printed to the terminal, but it is sent to the model. It sounds like Codex is working as intended, so I'm still unclear on what bug you're reporting or what behavior you were expecting. Were you expecting all output of your script to be displayed in the terminal? I don't think that's a desirable behavior in general for tool calls.
@etraut-openai Yes, when viewing detailed transcript, i expected to see the output of tool calls for inspection by me. Otherwise i'm just left in the dark as to what my scripts and code are doing. That's not the point though.
Like I said, I'm trying to explain that I faced compaction after one message. The script printed a lot of data, you say. And I'm explaining that the script did NOT print a lot of data. Instead, the new streamable shell captured all of the streamed output and passed it to the model, i believe because of #6850 . The script prints ~50 lines when I run it from my shell. You did not set proper term flags which is why it dumped all that info to the model.
This bug report hasn't received any upvotes or additional posts in three months. Closing.
@etraut-openai what comments did you expect though?
We have millions of active users. If only one user has reported a bug and no one else has reported the same issue in three months, then it's likely either fixed or specific to your system, configuration, network, etc. In either case, we don't have the bandwidth to investigate such bugs. We need to focus our limited resources on the bugs that are impacting many users.
Got it. This was fixed with #6850, which was fixed with #7286, reoccurred, then fixed again.