Add reward history tracking and visualization for swarm overwatch#18
Add reward history tracking and visualization for swarm overwatch#18binary-husky wants to merge 1 commit intomainfrom
Conversation
binary-husky
commented
Mar 20, 2026
- Add RewardHistoryEntry and RewardHistoryResponse models for reward data
- Implement reward collection and history finalization in swarm_server
- Add /get_reward_history API endpoint for visualization
- Add ASCII reward curve display in swarm_overwatch UI
- Fix typo in config_utils parameter name (convertion_json_fg -> convertion_json_fp)
- Add RewardHistoryEntry and RewardHistoryResponse models for reward data - Implement reward collection and history finalization in swarm_server - Add /get_reward_history API endpoint for visualization - Add ASCII reward curve display in swarm_overwatch UI - Fix typo in config_utils parameter name (convertion_json_fg -> convertion_json_fp)
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
The pull request successfully introduces reward history tracking and visualization for the swarm overwatch system. New Pydantic models (RewardHistoryEntry, RewardHistoryResponse) are added to define the structure of reward data. The swarm_server is updated to collect and finalize reward statistics at each global step, storing them in shared memory. A new API endpoint /get_reward_history is implemented to expose this data. The swarm_overwatch UI now includes a display_reward_curve function to visualize this history as an ASCII chart, enhancing monitoring capabilities. Additionally, a minor but important typo in config_utils.py has been corrected. The changes are well-structured and contribute positively to the system's observability.
|
|
||
| def _finalize_reward_history_for_step(global_step, shared_mem_dict, shared_mem_dict_lock): | ||
| """Finalize reward statistics for a given global step and add to reward_history.""" | ||
| import numpy as np |
There was a problem hiding this comment.
The import numpy as np statement is placed inside the _finalize_reward_history_for_step function. It is generally considered a best practice in Python to place all imports at the top of the file, outside of any functions or methods. This improves readability, makes dependencies clear at a glance, and avoids potential performance overhead from repeated imports if the function is called frequently. Please move this import to the top of the file with other imports.