Skip to content
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: Goose health bar #144

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

feat: Goose health bar #144

wants to merge 8 commits into from

Conversation

Cormwww
Copy link

@Cormwww Cormwww commented Oct 11, 2024

I put the HealthBar class in a separate utility module like services/health_bar.py for better code organization.
Integrated the health bar in your session management logic, inside goose_session.py or the equivalent.
In the entry point (like main.py), trigger the session and health bar display.
Optionally, I made it configurable using a configuration file such as config.json or environment variables.

@blackgirlbytes
Copy link
Collaborator

blackgirlbytes commented Oct 15, 2024

Hey @Cormwww ! It looks like you need to update your title to include "feat"

@Cormwww Cormwww changed the title Goose Heath Bar Issue Goose Heath Bar Issue feat Cormwww Oct 15, 2024
@Cormwww Cormwww changed the title Goose Heath Bar Issue feat Cormwww Feat Goose health bar Oct 16, 2024
@blackgirlbytes
Copy link
Collaborator

HEy @Cormwww ..looks like it's still failing. Try this

feat: Goose health bar

like with the exact casing . Hope that helps!!! And then I'll get someone to review this ASAP

@Cormwww
Copy link
Author

Cormwww commented Oct 17, 2024

I changed all of the variable names in the healthbar.py file is that the only place that I need to change the casing for, if I don't need to change the variables any more should I create a new pr or should we just stay with this one? Also thanks for sticking through with me on this issue!

@blackgirlbytes
Copy link
Collaborator

blackgirlbytes commented Oct 17, 2024

No problem. I mean to say update the title :D of your PR to say

feat: Goose health bar

with the colons etc

right now it says Feat Goose health bar

@michaelneale michaelneale changed the title Feat Goose health bar feat: Goose health bar Oct 18, 2024
@michaelneale
Copy link
Collaborator

would this make sense to weave in to the main https://github.com/block-open-source/goose/blob/main/src/goose/cli/main.py as an optional code path? also any info on what it should look like? (just not sure what a healthbar is)

Moved Import statement to the top.
@michaelneale
Copy link
Collaborator

@Cormwww can you write up in the PR description how to validate/test this out best?

@Cormwww
Copy link
Author

Cormwww commented Oct 21, 2024

Summary: This PR introduces a configurable health bar for monitoring the key metrics of an active goose session. The health bar displays the following metrics:

Exchange token count
Total cost
Session uptime
Session name
How to Validate/Test:

  1. Preconditions/Setup:
    Ensure that you have the latest version of the branch checked out (feature/goose-health-bar).
    Make sure the environment is properly configured with any necessary dependencies and services (e.g., core Goose session setup).
    Start a new Goose session using the run_goose_session function or the appropriate CLI command.
  2. Steps to Test:
    Start a session: Initiate a Goose session that involves exchanging tokens and monitor the health bar during the session.
    Check metrics display: Verify that the following metrics appear correctly on the health bar:
    Exchange token count: This should reflect the current number of tokens exchanged in the session.
    Total cost: This should update in real-time as the session incurs costs.
    Session uptime: This should start from the moment the session begins and continuously update.
    Session name: The name should match the current session being run.
    Interact with the session: Perform actions such as token exchanges, sending commands, or stopping/starting the session, and confirm that the health bar updates accordingly.
  3. Expected Results:
    The health bar should be visible and responsive during the session.
    Each metric should accurately reflect real-time data and update dynamically as the session progresses.
    No metrics should be out of sync or missing.
  4. Edge Cases/Negative Testing:
    Empty session: Start a session without any token exchanges and ensure the health bar handles this gracefully (e.g., shows zero values).
    High load: Initiate a session with a large number of token exchanges and verify that the health bar remains performant and updates smoothly.
    Session end: Verify that the health bar resets or behaves correctly when the session ends (e.g., no stale data).

@zakiali
Copy link
Collaborator

zakiali commented Oct 23, 2024

👋 @Cormwww! Thanks for your contribution Goose! I'm trying to run this from your fork, but having some issues being able to successfully run the goose_session.py script. Specifically, running into an error import services from services.health_bar import HealthBar and heallth_bar. Did you by chance forget to add in some files to this PR? Would love to see what the UX looks like to give feedback there.

A couple questions: was the intent here to have a separate health bar that runs in a separate window outside of the main goose session (https://github.com/Cormwww/goose/blob/main/src/goose/cli/session.py)? That's the way it currently looks, but I might be missing some context there.

Also, a couple of other comments to help with the integration into Goose. It would be great to integrate this into the main goose loop so the the metrics are updated in the health bar as the loop runs. As @michaelneale mentioned this should be an optional path with something like goose session start --healthbar or something like that to enable it. Let us know if you have any questions about that!

@blackgirlbytes
Copy link
Collaborator

Hey @Cormwww any updates? I know that the end of Hacktoberfest is right around the corner and we want this tPR to count for you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants