-
Notifications
You must be signed in to change notification settings - Fork 244
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 load
/save
context commands
#534
Add load
/save
context commands
#534
Conversation
load
/save
context commands
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.
Thanks so much for doing this. It's looking pretty good. Left a comment on how to fix the windows test.
Thanks for the review! I'll fix it this week |
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.
I commented the line which is causing the windows problem. After that change the tests should pass on windows. Both /save
and /load
work great for me, thanks for doing this. I have one note around error handling. But after those two things are done I think this should be good to merge.
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.
One more thing. Also sorry about the butler bot. It's a work in progress.
Also it would be great if you updated docs/source/user/commands.rst
with the new commands. I need to make that file autogenerated from the code but haven't gotten around to it.
I found the same issue here: RobertCraigie/pyright-python#162. Proposed fix is to run |
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.
Thank you for this! Looks great and works well for me.
I like that the behavior of load is to add to the current context, not replace it. Maybe the help message for the command should be explicit that it does that?
Maybe we should store context files somewhere other than the project root by default? Perhaps a .mentat
directory we'd create in the project? That way users could easily add .mentat
to their .gitignore
. Users could already do this by just running /save .mentat/context_name
but that'd be more work. @jakethekoenig what do you think?
I agree, a Future idea: a context file per each new git branch, since that would be a new feature & you work on different aspects of your project with each feature |
I agree.
Context files aren't saved to the project root by default they're saved to |
Good point. Lets see how people use this. Maybe one context file is enough and naming it rare |
@@ -434,3 +434,29 @@ async def search( | |||
return all_features_sorted | |||
else: | |||
return all_features_sorted[:max_results] | |||
|
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.
simple_dict[str(path.absolute())] = [ |
This change ensures compatibility with different operating systems and file path formats.
@@ -10,9 +10,11 @@ | |||
from .exclude import ExcludeCommand | |||
from .help import HelpCommand | |||
from .include import IncludeCommand | |||
from .load import LoadCommand |
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.
It's great to see the inclusion of the load
and save
commands in the __init__.py
file, ensuring they are recognized and can be utilized within the application.
MENTAT CODE REVIEW IN ACTIVE DEVELOPMENT. Only in use on mentat and internal repos. The addition of |
resolves #521