GPT-4.1 failing to use `apply_patch`
What version of Codex is running?
0.1.2504221401
Which model were you using?
gpt-4.1
What platform is your computer?
darwin 24.3.0 arm64 arm
What steps can reproduce the bug?
Using gpt-4.1 as model, it doesn't call apply_patch - it just writes the patch in the assistant message.
What is the expected behavior?
No response
What do you see instead?
No response
Additional information
No response
Yes, the same here:
w0 [Error]: 400 No tool output found for function call call_awtGvM1Tkz1MfAeh36lau4ou.
at e.generate (file:///Users/yam/.npm-global/lib/node_modules/@openai/codex/dist/cli.js:473:4010)
at Rr.makeStatusError (file:///Users/yam/.npm-global/lib/node_modules/@openai/codex/dist/cli.js:477:7623)
at Rr.makeRequest (file:///Users/yam/.npm-global/lib/node_modules/@openai/codex/dist/cli.js:477:8555)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async fE.run (file:///Users/yam/.npm-global/lib/node_modules/@openai/codex/dist/cli.js:493:198) {
status: 400,
headers: {
'alt-svc': 'h3=":443"; ma=86400',
'cf-cache-status': 'DYNAMIC',
'cf-ray': '934fb18beabc4791-DFW',
connection: 'keep-alive',
'content-length': '184',
'content-type': 'application/json',
date: 'Wed, 23 Apr 2025 19:16:08 GMT',
'openai-organization': 'user-blabla',
'openai-processing-ms': '278',
'openai-version': '2020-10-01',
server: 'cloudflare',
'set-cookie': '__cf_bm=blabla.sXjSIo-1745435768-1.0.1.1-oQEyLVda26eieznfD7TLm8KHmNsBnTVg4gn50I00PfytPAs42UpC4WffVfYj8G0Usgl67fiSV7p4FVYS3ZzBrauBjLpXpU.FOfB4NAyJcVc; path=/; expires=Wed, 23-Apr-25 19:46:08 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None, _cfuvid=C07Xu2Zhid_z_DVUZH4tKlD7vKjDNcswV9Sl0QOMVvE-1745435768032-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None',
'strict-transport-security': 'max-age=31536000; includeSubDomains; preload',
'x-content-type-options': 'nosniff',
'x-request-id': 'req_c81bd8bcc25b72c705940d2d753d91fa'
},
request_id: 'req_c81bd8bcc25b72c705940d2d753d91fa',
error: {
message: 'No tool output found for function call call_awtGvM1Tkz1MfAeh36lau4ou.',
type: 'invalid_request_error',
param: 'input',
code: null
},
code: null,
param: 'input',
type: 'invalid_request_error'
}
Node.js v20.12.2
Same issue
Same issue!
Same. Not sure if this is a duplicate of another issue already or a quirk of the LLM itself, but it seems to consistently (~80%) of the time refuse to apply patches with o4.1, might be a function of size. Noticed it starts off, e.g. patching json, etc. but then fails spectacularly once it tries to edit "real" code.
I did some tests out of curiosity, it doesn't seem to be a blanket failure (It worked once), but it is extremely weird that the failure rate is that high.
same issue on mac, none of the new models apply anything.
Same on macbook M2 - wasted quite a lot of credits to get empty files.
During early testing with o3 this was not an issue, but it is consistently an issue with GPT4.1 at present. E.g.
codex
I've written a detailed README to foundation_model_vqa/prompts/README.md outlining: ...
But the file is empty. Even though --full-auto is enabled, and I suggested using shell escapes etc. to try writing.
So...
I opened up this repo, and asked it to debug itself, eventually it learned that it was generating malformed patches. There is apparently a mismatch between the patch syntax expected and generated (**_ vs ***), the parser vs the prompt.
At least in bfe6fac463474d8a0583fc03364eb9a08bd764c7
This makes it unusable tbh. Are we even getting credits lost back?
Im having the same issue, effectively makes 4.1 unusable for a lot of tasks, what a shame.
same here. not writing anything on macOS with gpt 4.1
same issue
how is this not fixed? GPT-4.1 is supposed to be a flagship developer model. It's unusable from my perspective.
- gpt 4.1 and 4.1-[date-slug] are both failing
same with 4.1
this should be fixed by #930 and included in the latest release!
thanks @fouad-openai !
Thanks again @fouad-openai, fast delivery 🔥