The ChatGPT GitHub App already makes repository workflows very convenient, but there is one important limitation when editing existing source files.
For a very small change in a large file, the available write workflow may require updating/replacing the entire file. This makes localized edits unnecessarily risky.
I encountered this in a real project:
- The target Python file was about 900 lines long.
- The required change was only about 7 lines.
- Rewriting the whole file for such a small edit had previously resulted in a syntax breakage.
- Because of that risk, I now avoid letting ChatGPT directly modify large files through the GitHub App and instead ask a local coding agent to make the small edit.
It would be very useful if the GitHub App exposed a write action such as:
apply_patch(repository, branch, path, patch)
or another equivalent partial-file editing operation.
Ideally, it would:
- Apply a unified diff or hunk-based patch instead of replacing the whole file.
- Verify surrounding context before applying the patch.
- Refuse the write if the expected context no longer matches the current file.
- Return a clear conflict/error instead of attempting a full-file rewrite.
- Allow ChatGPT to review the resulting diff before committing.
This would make small edits to large files substantially safer and would reduce the risk of accidentally modifying unrelated code.
There are already related requests for a general ChatGPT “Code Patch Mode”, but this request is specifically about the GitHub App’s write actions: not only generating a diff, but safely applying that diff directly to a repository.
A typical workflow would become:
ChatGPT reads repository
→ creates a feature branch
→ applies a small validated patch
→ user reviews the diff
→ commit / merge
instead of:
ChatGPT reads repository
→ reconstructs an entire large file
→ replaces the file
→ hope nothing outside the intended change was altered
I think this would make the GitHub integration much more useful for incremental, review-driven development.