BUG: Codex is producing invalid Obj-C code. Python script generated to replace code breaks existing code

Resolved 💬 3 comments Opened Sep 16, 2025 by guidedways Closed Nov 11, 2025

What version of Codex is running?

0.36.0

Which model were you using?

gpt-codex-high

What platform is your computer?

macOS

What steps can reproduce the bug?

Codex seems to write Python script to mass update existing code with bogus code - it's replacement patterns are too loose and broad and causes mayhem across the entire codebase:

example (obj-c code):

  SharedPreferences.alarmsStartOfWeek = Preferences.startOfWeek;

got turned into:

 Shared[TaskManager sharedManager].preferences.alarmsStartOfWeek = [TaskManager sharedManager].preferences.startOfWeek;

apparently it was trying to find and replace Preferences.alarmsStartOfWeek with [TaskManager sharedManager].preferences.alarmsStartOfWeek and ended up doing it across the entire codebase incorrectly.

What is the expected behavior?

It should have matched the start of word or line etc instead of doing a full X → Y replacement

What do you see instead?

_No response_

Additional information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗