-
Couldn't load subscription status.
- Fork 7.3k
Integrate Morph API for code editing #1322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Integrate Morph API for code editing #1322
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
Changes requested ❌
Reviewed everything up to 6856b84 in 1 minute and 41 seconds. Click for details.
- Reviewed
563lines of code in8files - Skipped
0files when reviewing. - Skipped posting
6draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .env.template:6
- Draft comment:
Ensure MORPH_API_KEY is configured securely and not exposed in production. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
2. gpt_engineer/core/default/steps.py:354
- Draft comment:
Verify that the new JSON-based improvement approach fully covers edge cases previously handled by salvage_correct_hunks. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%This comment is asking the PR author to verify that the new approach covers edge cases, which falls under asking the author to ensure behavior is intended or tested. This violates the rules.
3. gpt_engineer/preprompts/file_format_diff:1
- Draft comment:
Ensure downstream components expect the updated JSON output format as described in the new preprompt instructions. - Reason this comment was not posted:
Confidence changes required:0%<= threshold50%None
4. tests/core/test_salvage_correct_hunks.py:1
- Draft comment:
Removal of tests in test_salvage_correct_hunks.py is intentional; ensure that all diff-based edge cases are now covered by JSON-based tests. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
5. gpt_engineer/preprompts/file_format_diff:39
- Draft comment:
Typographical error: 'dont' should be corrected to "don't" on line 39. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% While the comment is technically correct about the missing apostrophe, this is a very minor issue. The meaning is completely clear without the apostrophe. This is a documentation file, not code, and the typo doesn't affect functionality. The comment doesn't suggest any meaningful code changes. The typo could be seen as unprofessional in documentation. Also, since this is a prompt file, precise language might be important for AI interaction. Even for AI interaction, this minor typo won't affect functionality - the meaning is unambiguous. We should focus on more substantial issues. Delete the comment as it points out an extremely minor typographical issue that doesn't affect functionality or clarity.
6. gpt_engineer/preprompts/improve:2
- Draft comment:
The sentence on this line has a couple of typographical issues: 1. The word "First" following the comma should be lowercase (i.e. "first"). 2. Similarly, "As well" should not be capitalized (i.e. "as well"). Consider revising the sentence to: "Make changes to existing code. When implementing new code, first lay out the names of the core classes, functions, methods that will be necessary, as well as a quick comment on their purpose." - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_5BrQKlQcDcsHoSoN
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
Description
The AI now responds with an array of JSON objects instead of a diff. This array is looped through and processed by the Morph API.
This change is a significant improvement because it provides a more robust and atomic way to handle updates. Unlike a diff, which relies on comparing two states and can be susceptible to race conditions and errors, the new approach sends a complete, self-contained set of instructions. This ensures that changes are applied correctly and in the intended order, making the system more reliable and easier to debug.
Additional Changes
Important
Integrates Morph API for JSON-based code editing, replacing diff-based approach, and updates tests accordingly.
steps.py.apply_morph_edit()function to send instructions to Morph API and return merged code.improve_fn()and_improve_loop()to handle JSON instructions.file_format_diffto specify JSON output format for code edits.improvepreprompt to remove diff syntax instructions.test_cli_agent.py,test_simple_agent.py, andtest_steps.pyto mock Morph API calls and validate JSON-based editing.test_salvage_correct_hunks.pyas it is no longer relevant.This description was created by
for 6856b84. You can customize this summary. It will automatically update as commits are pushed.