-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Add tree-style file selection feature #937
Add tree-style file selection feature #937
Conversation
Great work. Here is a wishlist from my first testing!
Awesome work! These are only small changes and we are close to the goal! @similato87 |
Hi @ATheorell , Thank you for your valuable feedback and suggestions! Here's a brief outline addressing each point of your wishlist:
I'm on it and will update the PR with these enhancements soon. Thanks for the encouragement and detailed insights. |
Hi! I want to suggest a small change to the workflow: The current workflow is that, after the first run, a .toml is persisted and the next time we run, gpt-engineer immediately assumes we want to use the files in that .toml. I want to suggest that, in case a toml file is present, always open it in the default editor. In case the user doesn't want to change the selection, he/she only needs to close the editor to proceed, which shouldn't be too much work. I think this is much better than forcing the user to delete the file manually to change the selection. A small improvement to the toml file. Make a one sentence explanation in a comment at the top of the file about how to use the file. Regarding the command line selection: I see 2 possibilities. Either remove it completely, or make it completely file free. When using it, we don't save any file at all. Let me know what alternative you prefer. |
Hi @ATheorell ! I'm currently in the testing phase of this function and not yet fully confident in its performance. Your clear and timely suggestion for the .toml workflow and content is incredibly helpful and encouraging. It points out necessary improvements and provides a user-centered perspective that's crucial for refinement. The idea to automatically open the .toml file for review and the addition of an explanatory comment will enhance the user experience significantly. I'm also carefully considering the options for the command line selection to best suit user preferences. Your input is greatly valued as I work towards making this tool more reliable and intuitive. Thank you for your supportive and constructive feedback! |
Hi @ATheorell , I've completed some significant updates and refinements to the file selection process:
Encountered Problem:During the update, I faced an issue with Poetry install and pytest. It seems to detect errors in a Thank you for your support and looking forward to your feedback or any further instructions! |
The .gitignore file wasn't properly ignoring the projects directory. This has been resolved in #939. Please update your branch with this change and let us know if the issue persists. |
Never mind -- that wasn't it. I've checked out your branch and its failing in test execution. Please run |
Regarding the error: To run the tests on github without an api key, we use a caching system. When a change in the code changes a prompt to the LLM in one of the tests, the cache needs to be updated locally. If you run pytest locally, you should see that here is a cache file that gets updated and you need to commit that. If this isn't working for you for some reason, feel free to simple ignore this error and I will update the cache before we merge this @similato87 @captivus . I believe a ToDo for me is to make a better error message. |
I only have tiny nitpicks left before merging now: After choosing files, there is a print to the consol which is formatted a little strangely. I get this for example:
It would probably be more informative if it prints the relative path. Thanks for adding the instruction: "# Select or Deselect files for processing by setting 'selected' to true or false." What about the slightly more informative: "# Change 'selected' from false to true to include files in the edit. GPT-engineer can only read and edit the files that set to true. Including irrelevant files will degrade coding performance, cost additional tokens and potentially lead to violations of the token limit, resulting in runtime errors." |
One more small UX thingy: If I set all files to false, I get this in the terminal
and then the program commences, but can't do anything. |
Hi @captivus, However, it appears the root cause was different. The issue stemmed from updates I made to the file_selector workflow, which I hadn't realized affected specific tests. I'll provide more details in the comment after the next one. |
Hi @ATheorell, Thanks for reminding me of that. I have added the parent folder for better print information and also updated the comment with yours.
Indeed! Now there is an exception for no file selection situation instead of printing no file selection. |
Thanks for the update. After refreshing the cache, I encountered the same issue again. Upon further investigation, I realized the root cause is due to original tests, one example located at https://github.com/gpt-engineer-org/gpt-engineer/blob/b95e179ca798deb9dc882a2cd90b2a51b9779953/tests/applications/cli/test_main.py#L65-L84 The test was originally designed for the old file_selector workflow. Given the recent changes, it's now causing failures. Please hold off on merging this branch as it may introduce errors into subsequent commits. I am actively working to update the affected tests and anticipate having them completed by tomorrow. Thank you for your patience and understanding. |
Thanks for also looking into the tests. Feel free to ask for support if you feel like the scope of this is getting too wide. |
Hi @ATheorell, I've been progressing on implementing tests for the improved file selection workflow, but I've encountered a significant challenge that I'd like to discuss. The core of the issue is simulating user interactions within a default text editor during the tests. Specifically, our improve process involves opening a file in the default editor, making changes (such as selecting or deselecting files), and then saving and closing the editor during this line running:https://github.com/gpt-engineer-org/gpt-engineer/blob/b95e179ca798deb9dc882a2cd90b2a51b9779953/tests/applications/cli/test_main.py#L79 — a sequence that's straightforward for a human user but complex to automate in a testing environment. I am exploring potential methods to effectively simulate this behavior in our automated tests but haven't yet found a robust solution. |
Hi @ATheorell , Happy new year:) I've made progress on the test cases and have successfully fixed them in my local development environment. However, when I push the changes to run in the GitHub workflow, they fail. Upon reviewing the logs, it seems like the issue might be related to hitting a maximum limit. So, I initiated a new run thinking it might resolve any temporary issues, but unfortunately, the tests are still failing. I'm currently unsure of the next steps to rectify this issue. It's unclear if the problem is with the environment setup, dependencies, or something else entirely that differs between the local and CI environments. Any insights or suggestions you might have would be greatly appreciated as I navigate this issue. Thank you for your support. |
@similato87 |
Hi @ATheorell , I've completed the refactoring and commenting of the file selection module. Detailed comments have been added throughout to improve maintainability and understanding. Could you please review and merge the PR? And now I'm ready to move on to the next feature development. Thanks! |
Great @similato87! |
Was there an issue with the file selector box or a reason we dont want to support it? It seems to me the easiest option for non technical users to select files so im wodering if replacing it is removing some functionality for users |
One enhancement to include only if you have time and want to: One of the biggest issues with file selecting at the moment IMO is when new files are created by gpteng they arent added to the file selection list. could we make it so that any new files created are automatically added to the improve list? |
Hi @TheoMcCabe , We've updated the file selection in GPT-engineer for these reasons:
|
That's a great suggestion! Currently, all files are set to I agree that automatically adding newly created files by gpteng to the file selection list would enhance the user experience. We can offer this as an option, toggling between automatic inclusion or the current manual selection. This would require a discussion on recognizing and handling patterns of newly generated files, which I'll bring up with @ATheorell to consider implementation strategies. |
ae3a025
to
adf01ae
Compare
Using Improved File Selection in GPT-EngineerHello team! While I've been in frequent discussions with @ATheorell about our ongoing improvements, I want to take a moment to share with everyone, including @captivus, @TheoMcCabe, @AntonOsika, and @pbharrin, how to use the newly improved file selection function in our project. This update is for issue(#725). Initial Setup and Selection
Subsequent Runs
Below is a GIF showing this process: |
Thanks @similato87 great work |
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.
looks great. Thank you
Amazing, and thanks for great documentation and gif @similato87 ! Tiny thing, looks like the lock file has to be updated: $ poetry install No dependencies to install or update Installing the current project: gpt-engineer (0.2.6) To fix, run: (side note, potentially this inconsistency comes from my recent PR rather than yours. Anyway, the lock should be consistent in the PR). |
Hi @ATheorell, I've run the |
Thanks for the hard work @similato87 ! |
Implement Tree-Style File Selection
Introduced a tree-style file selection method, allowing users to easily select files via a .toml configuration file. This update includes:
This update enhances usability for terminal-based interactions and streamlines the file selection process. Below is the gif for the feature: