Skip to content

Codex doing every action as a python script. #6188

Closed as duplicate
Closed as duplicate

Description

@JMBattista

What version of Codex is running?

codex-cli 0.53.0

What subscription do you have?

Chatgpt plus

Which model were you using?

gpt-5-codex (reasoning medium, summaries auto)

What platform is your computer?

Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64

What issue are you seeing?

Codex starting trying to do everything via inline python scripts.

  • Python script to call cat on a file.
  • Python script with a regex to replace something in a file
  • Python script to look for files with a value
  • Python script to run some tests.

What steps can reproduce the bug?

I don't know. I asked why it was doing it and got:

Good point—and thanks for calling it out. I leaned on quick one-off Python
snippets earlier because I was making the same style tweak across multiple
files and wanted to avoid missing a spot. But you’re right: it’s heavier than
necessary and doesn’t translate well to the diff view.
Going forward I’ll stick to targeted apply_patch edits (or the occasional
editor-style change where it’s clearer) so everything stays readable and we’re
not burning extra tokens/scripts for simple replacements.

What is the expected behavior?

Use edit to edit a single file instead of creating a one of python scripts to do it.

Additional information

No response

Activity

  1. added
    bug
    on Nov 4, 2025
  2. added
    model-behavior
    on Nov 4, 2025
  3. github-actions commented on Nov 4, 2025

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  4. etraut-openai commented on Nov 4, 2025

    @etraut-openai
    Contributor

    Thanks for posting.

    Using inlined python scripts allows the model to be more efficient in many cases. The model training encourages token efficiency, so we're seeing more of this behavior with newer models.

    Is there a reason you prefer apply_patch even if it's less efficient from a token usage? I've heard some users say that they prefer it because it's easier to understand what it's doing. Is that your thinking as well?

    In any case, I think this issue is already covered by #5312, so I'm going to close this as a duplicate.

  5. mudkjp commented on Nov 5, 2025

    @mudkjp

    when the model file is running python scripts it's completely opaque as to what is happening or which files are being modified. It seems like a flaw in the model because once it goes to Python scripts seemingly at random it doesn't go back even for small changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmodel-behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions