-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Adds a hook for when goose is working vs waiting for input #6702
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
Conversation
0f5866b to
21fc2b2
Compare
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.
Pull request overview
This PR adds a status hook feature that allows users to run shell commands when goose's status changes between "waiting" (ready for input) and "thinking" (processing). This is particularly useful for users running multiple goose sessions in tmux tabs who want visual indicators of which sessions are ready for input.
Changes:
- Added
GOOSE_STATUS_HOOKenvironment variable for configuring status change hooks - Implemented
run_status_hook()function to execute hook commands asynchronously - Added status hook calls at key points in the interactive session loop
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| documentation/docs/guides/environment-variables.md | Documents the new GOOSE_STATUS_HOOK environment variable with examples for tmux window title updates |
| crates/goose-cli/src/session/output.rs | Implements run_status_hook() function and adds basic tests for the hook functionality |
| crates/goose-cli/src/session/mod.rs | Adds hook calls to signal "waiting" before input and "thinking" when processing starts |
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.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
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.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
9ce5bfd to
c8fac50
Compare
Adds a hook that runs when goose's status changes between 'waiting' (ready for input) and 'thinking' (processing). This is useful for users running multiple goose sessions who want visual indicators of which sessions are ready for input. Example usage for tmux title: export GOOSE_STATUS_HOOK='printf "\033]2;goose: $1\033\\"' Features: - Cross-platform support (sh -c on Unix, cmd /C on Windows) - Runs asynchronously to not block the main thread - Errors are silently ignored Signed-off-by: Trae Robrock <[email protected]>
c8fac50 to
00e50fa
Compare
Signed-off-by: Trae Robrock <[email protected]>
11650b1 to
c0e8aba
Compare
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.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
DOsinga
left a comment
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.
nice. I think the test is not doing much and the comment is a bit much
|
actually let me clone this PR and adjust and merge to get this in. thanks! |
|
continuing this in: #6815 closing this for now. thanks for your contribition! |
Summary
This adds a hook for when goose is waiting for input vs working. I'm often running multiple goose sessions in tmux tabs and having a wait to identify the tabs that are ready for my input is super useful.
Type of Change
AI Assistance
Testing
File /tmp/goose-status.sh
export GOOSE_STATUS_HOOK='/tmp/goose-status.sh'