-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat: reduce tool entrypoints in synopsis for text editor, bash, process manager #191
Conversation
self.notifier.log(Rule(RULEPREFIX + "processes", style=RULESTYLE, align="left")) | ||
self.notifier.log(Markdown(f"```\nreading {process_id}\n```")) | ||
self.notifier.log("") | ||
output = system.view_process_output(process_id) |
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.
out of scope for this PR but we should test failures. i believe in the event a process failed we don't catch stderr
so that would be important to capture (which may aid in system recovery).
goose/src/goose/synopsis/system.py
Lines 62 to 71 in 300c4b6
def view_process_output(self, process_id: int) -> str: | |
"""View the output of a running background process.""" | |
if not (process := self._processes.get(process_id)): | |
raise ValueError(f"No process found with ID: {process_id}") | |
output = [] | |
while line := process.stdout.readline(): | |
output.append(line) | |
return "".join(output) |
if command not in self.command_dispatch: | ||
raise ValueError(f"Unknown command '{command}'.") | ||
|
||
# Call the corresponding method from the command dispatch |
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.
not necessary comment, delete?
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.
lgtm! much cleaner, nice work 🥳 !
also out of scope we but in a follow up i think we should pick a different command for testing the process management 65% of the testing time is taken up by these
|
to save confusion should the other PR be closed and we just try this one out? |
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.
LGTM!
"cancel": self._cancel_process, | ||
} | ||
|
||
def logshell(self, command: str, title: str = "shell") -> None: |
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.
nit: should we make a top level util out of this?
src/goose/synopsis/text_editor.py
Outdated
content = content[start_line - 1 : (end_line if end_line != -1 else len(content))] | ||
|
||
system.remember_file(str(patho)) | ||
self._log_file_operation(str(patho), "".join(content), get_language(str(patho))) |
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.
nit: imo, this is too verbose to show every read - it is consistent, but i'd consider only showing this on writes?
* main: chore: housekeeping (#202) feat: reduce tool entrypoints in synopsis for text editor, bash, process manager (#191) feat: list moderators (#204) chore: Minor changes in providers envs logic (#161) chore: add `.vscode` workspace settings and suggested extensions (#200) feat: license checker (#201) feat: include new anthropic model in docs and recommended config (#198) feat: tiny change so you know what processing is doing (#196) docs: correct intellij link (#197) docs: remove small duplication (#194) chore: add tracing option to run and group traces under session name (#187) docs: fix mkdocs, update to new references (#193)
builds on top of the changes in #186
we collect similar tools into a collection: