Skip to content

Unexpected Python Execution When Using gpt-5-codex (High) #6401

Closed as duplicate

Description

@strantalis

What version of Codex is running?

codex-cli 0.56.0

What subscription do you have?

pro

Which model were you using?

gpt-5-codex

What platform is your computer?

Darwin 25.0.0 arm64 arm

What issue are you seeing?

Not sure how to really describe this issue, but gpt-5-codex-high seemed to be doing some odd stuff with Python. This is the prompt I gave it:

› In the components/logbook/LogbookHeader.tsx the filter selection is off. When "Last Trip" or "All" for example are selected they go invisible or end up with white text on a white background

(Which is probably a poor prompt.)

After that, it started trying to execute a bunch of Python code and read in an image I didn’t provide. Here are some snippets:

• Ran python - <<'PY'
  │ from PIL import Image
  │ img = Image.open('image.png').convert('L')
  │ … +12 lines
  │ … +12 lines
  └ Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ModuleNotFoundError: No module named 'PIL'
  └ WARNING: The directory '/Users/strantalis/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with
    sudo, you should use sudo's -H flag.
    Collecting pillow
    … +4 lines
    WARNING: You are using pip version 21.2.4; however, version 25.3 is available.
• Ran python3 -m pip install --target .pip pillow
  └ WARNING: The directory '/Users/strantalis/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with
    sudo, you should use sudo's -H flag.
    Collecting pillow
    … +3 lines
  │ img = Image.open('image.png').convert('L')
     +@%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    … +37 lines
     +@%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%=%*#@@%%%@@%@@@%#@@##@@%%@%%%%%%@@%#%%%%%%%%%%%%%%%
     +@%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@#.*+*#+#%%*+%*+#==#+*##+##+#%####*+#:*%%%%%%%%%%%%%%

  │ … +12 lines
  └ :%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    :%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    … +21 lines
    :%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@%%@%@%%%%%%@%%%%@%%%%%%%%%%
    :%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%=**#%%#%#**#*#%#%%%##+#%%%%%%%%

  │ … +9 lines
  └ (no output)

    npm error You can rerun the command with `--loglevel=verbose` to see the logs in your terminal
• Ran PYTHONPATH=.pip python3 - <<'PY'
  │ from PIL import Image
  │ img = Image.open('image.png')
  │ … +27 lines
  └ ..... ........................
    ..... ........................
    … +8 lines
        return self.im.getpixel(tuple(xy))
    IndexError: image index out of range

• I'm exploring why the FilterChip text appears invisible—maybe because its selected state isn't passed correctly or overridden by unexpected CSS from global.css. Since jumping into React Native render or complex stubbing feels heavy, I'll
  consider checking for global styles affecting text color and ensure the selected state flows properly through the components. Let's try inspecting CSS rules that might cause white-on-white text.

What steps can reproduce the bug?

Uploaded thread: 019a63d7-607f-7900-b4d0-351fcbffd048

What is the expected behavior?

Not trying to run arbitrary python scripts when it isn't necessary.

Additional information

No response

Activity

  1. added
    bug
    on Nov 8, 2025
  2. added
    CLI
    model-behavior
    tool-calls
    on Nov 8, 2025
  3. github-actions commented on Nov 8, 2025

    @github-actions
    Contributor
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

    CLIbugmodel-behaviortool-calls

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions