Normalize bridge send_to_agent targets#42
Conversation
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 enhances the stability and user experience of agent communication within the system by standardizing how agent targets are processed and improving error feedback. It also refines the installation script to provide better guidance for setting up necessary dependencies, ensuring a smoother onboarding for users. Highlights
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
This pull request updates various dependencies and introduces an important feature: a tmux installation nudge during the loop tool's installation process. This nudge provides platform-specific instructions for installing tmux if it's not found, which is crucial as the default loop command relies on tmux for paired workspaces. Additionally, the PR refines the send_to_agent tool's target handling, making it more robust by normalizing target input (case and whitespace) and providing clearer error messages for invalid or unknown targets. Instructions for using send_to_agent in paired mode have also been updated to explicitly include the target: "agent" literal. Review comments suggest refactoring the tmux_install_hint logic in both install.sh and src/install.ts for improved readability and maintainability, specifically recommending if/else and switch statements respectively.
| tmux_install_hint() { | ||
| if [ "$os" = "macos" ]; then | ||
| echo "brew install tmux" | ||
| return | ||
| fi | ||
|
|
||
| echo "your package manager (for example: apt install tmux)" | ||
| } |
There was a problem hiding this comment.
For better readability and to follow more common shell scripting patterns, consider using an if/else structure instead of an if with a return. This makes the control flow more explicit.
| tmux_install_hint() { | |
| if [ "$os" = "macos" ]; then | |
| echo "brew install tmux" | |
| return | |
| fi | |
| echo "your package manager (for example: apt install tmux)" | |
| } | |
| tmux_install_hint() { | |
| if [ "$os" = "macos" ]; then | |
| echo "brew install tmux" | |
| else | |
| echo "your package manager (for example: apt install tmux)" | |
| fi | |
| } |
| const tmuxInstallHint = ( | ||
| platform: NodeJS.Platform = process.platform | ||
| ): string => { | ||
| if (platform === "darwin") { | ||
| return TMUX_MACOS_HINT; | ||
| } | ||
| if (platform === "linux") { | ||
| return TMUX_LINUX_HINT; | ||
| } | ||
| return "install tmux"; | ||
| }; |
There was a problem hiding this comment.
For improved readability and maintainability, consider refactoring this series of if statements into a switch statement. This makes the code's intent clearer and simplifies adding support for more platforms in the future.
| const tmuxInstallHint = ( | |
| platform: NodeJS.Platform = process.platform | |
| ): string => { | |
| if (platform === "darwin") { | |
| return TMUX_MACOS_HINT; | |
| } | |
| if (platform === "linux") { | |
| return TMUX_LINUX_HINT; | |
| } | |
| return "install tmux"; | |
| }; | |
| const tmuxInstallHint = ( | |
| platform: NodeJS.Platform = process.platform | |
| ): string => { | |
| switch (platform) { | |
| case "darwin": | |
| return TMUX_MACOS_HINT; | |
| case "linux": | |
| return TMUX_LINUX_HINT; | |
| default: | |
| return "install tmux"; | |
| } | |
| }; |
cc360e8 to
5805005
Compare
Summary
send_to_agenttargets with trim + lowercase at the bridge boundarytarget: "claude"Verification
Review