Model forgets it is an agent

Resolved 💬 7 comments Opened Sep 1, 2025 by wowshy Closed Nov 10, 2025
💡 Likely answer: A maintainer (dedrisian-oai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.27.0

Which model were you using?

gpt5-high

What platform is your computer?

Linux 6.6.93+ x86_64 x86_64

What steps can reproduce the bug?

Long running sessions.
(However, the context pressure wasn't the problem. It had atleast 70% context left)

What is the expected behavior?

Run commands by itself as an agent

What do you see instead?

The model asks me to run the command.
I assume this behaviour is influenced by the chatbot design (where the model didn't have tool access).

Example

If you share `podman info` (store section) and your OS (Linux vs Podman Machine),
I can give exact knobs to toggle for your setup.

This can be fixed by:

  • using better prompts
  • enhancing handling of longer sessions (maybe use handoffs?)
  • improving the model itself

Additional information

Not sure whether this was a bug or not (Atleast the prompt in the repo can be fixed).
Sorry if there was a more appropriate place to raise this issue.

View original on GitHub ↗

7 Comments

wbdb · 10 months ago
dedrisian-oai contributor · 10 months ago

Is it an issue where the model is asking you for permission _before_ it tries to execute the shell commands?

matssk · 10 months ago

I've noticed this a lot too, especially if the sandbox is on, then it's extremely hesitant to do anything at all. With the sandbox turned off, it is much better, but still frequently gives a list of instructions of what do to instead of just doing the tasks. Telling it to run the commands or similar will make it agentic again and it may very well stay like that for the rest of the session. Claude is not like this.

wowshy · 10 months ago

@dedrisian-oai

Is it an issue where the model is asking you for permission _before_ it tries to execute the shell commands?

No, I normally pass --dangerously-bypass-approvals-and-sandbox inside a container.
The problem is that the model sometimes doesn't run commands and just tells me to run commands.

### What do you see instead? The model asks me to run the command. I assume this behaviour is influenced by the chatbot design (where the model didn't have tool access). Example `` If you share podman info (store section) and your OS (Linux vs Podman Machine), I can give exact knobs to toggle for your setup. ``
matssk · 10 months ago

This really happens almost every new session. It frequently does not want to start performing commands until it has been explicitly told to do so, its default behavior seems to be printing out a list of commands for the user to run instead of running them. Maybe this is by design? Perhaps it is because I often start my first message with (do not write any code) because I want to plan and be sure we agree on stuff before having it start writing code, otherwise it tends to start doing something stupid.

FreddyE1982 · 9 months ago
This really happens almost every new session. It frequently does not want to start performing commands until it has been explicitly told to do so, its default behavior seems to be printing out a list of commands for the user to run instead of running them. Maybe this is by design? Perhaps it is because I often start my first message with (do not write any code) because I want to plan and be sure we agree on stuff before having it start writing code, otherwise it tends to start doing something stupid.

if you want to really plan stuff I developed this "template" by trial and error:

<describe what you want planned>
create a <filename> md file where you plan this as small manageable tasks, marked with [todo]

template for performing plan

implement the first 2 tasks marked with [todo], mark each with [complete] when finished

etraut-openai contributor · 8 months ago

Thanks for the bug report. We've shared the feedback with the team members who are responsible for training our codex models. We're tracking this feedback and similar reports so we can make the model more robust in future iterations.

If you see other model behavior that you'd like to report, please use the recently-added /feedback command in the CLI. That will provide us with additional details including logs and conversation text.