Skip to content

Normalize bridge send_to_agent targets#42

Merged
axeldelafosse merged 2 commits intomainfrom
codex/normalize-bridge-targets
Mar 27, 2026
Merged

Normalize bridge send_to_agent targets#42
axeldelafosse merged 2 commits intomainfrom
codex/normalize-bridge-targets

Conversation

@axeldelafosse
Copy link
Copy Markdown
Owner

Summary

  • normalize send_to_agent targets with trim + lowercase at the bridge boundary
  • return clearer MCP errors for empty and unknown targets after normalization
  • update paired prompts/tests to show lowercase literal targets like target: "claude"

Verification

  • bun test
  • bun run check

Review

  • self-review: pass
  • Claude review: pass

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, 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

  • Agent Target Normalization: Implemented robust normalization for send_to_agent targets, ensuring consistent handling of agent names by trimming whitespace and converting to lowercase.
  • Improved Error Reporting: Enhanced error messages for send_to_agent calls, providing clearer feedback when targets are empty or unrecognized after normalization.
  • Updated Agent Prompts and Tests: Modified agent-facing prompts and corresponding test cases to explicitly show lowercase literal targets for send_to_agent (e.g., target: "claude"), improving clarity for agents.
  • Tmux Installation Guidance: Introduced a tmux installation check and helpful, OS-specific hints during the loop CLI installation process to guide users on setting up their environment for paired workspaces.
  • Dependency Updates: Upgraded various development dependencies, including @biomejs/biome, @types/node, bun-types, glob, minimatch, path-scurry, and ultracite.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread install.sh Outdated
Comment on lines +58 to +65
tmux_install_hint() {
if [ "$os" = "macos" ]; then
echo "brew install tmux"
return
fi

echo "your package manager (for example: apt install tmux)"
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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
}

Comment thread src/install.ts Outdated
Comment on lines +28 to +38
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";
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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";
}
};

@axeldelafosse axeldelafosse force-pushed the codex/normalize-bridge-targets branch from cc360e8 to 5805005 Compare March 26, 2026 07:24
@axeldelafosse axeldelafosse marked this pull request as ready for review March 27, 2026 05:02
@axeldelafosse axeldelafosse merged commit 2395854 into main Mar 27, 2026
2 checks passed
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.

1 participant