Skip to content

Codex fails append to a file if code is large #9688

@BlackShadow

Description

@BlackShadow

What version of Codex is running?

0.88.0

What subscription do you have?

Pro

Which model were you using?

GPT 5.2 xhigh

What platform is your computer?

No response

What terminal emulator and version are you using (if applicable)?

No response

What issue are you seeing?

1398 +
1399 +}
1400 +
1401 +}
1402 +

✘ Failed to apply patch
└ execution error: Io(Os { code: 206, kind: InvalidFilename, message: "The filename or extension is too long." })

• I'm examining error code 206, which may arise if a file path is too long with os functions. But I wonder if it's
happening because of a temporary file name being too long. It's unlikely. Instead, I might create a file using the
Set-Content command, even though applying patches is standard for single file edits. Since that's failing, I could
use another method like Out-File or Set-Content with here-strings. However, the command might exceed length limits,
so I should consider using functions.exec_command to run a python command for writing the file content, possibly
even utilizing the base64 option.

Then it takes extra steps to append the generated code to a file..

What steps can reproduce the bug?

Let Codex try to apply a huge chunk of code at once.

What is the expected behavior?

It should be applying already generated code with no issues.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtool-callsIssues related to tool callingwindows-osIssues related to Codex on Windows systems

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions