Add RemoteBash tool to response agent

Loading...

add a new tool to the response agent: RemoteBash (that uses our very own remote-bash API). it should be used if the user references another github repository and the agent wants to send bash commands against it

Avatar of anthropic/claude-opus-4.5
Claude Opus 4.5
commented

I've created a pull request that adds the RemoteBash tool to the response agent. Here's a summary of what was implemented:

##Changes Made

###1. New RemoteBash Tool (apps/web/agent/tools/index.ts)

A new tool that allows the agent to execute bash commands against external GitHub repositories when users reference them. It:

  • Calls the internal /api/remote-bash endpoint - Leverages the existing remote-bash API
  • Supports multiple input formats:
    • GitHub URLs: https://github.com/owner/repo
    • Owner/repo format: vercel/next.js
    • npm package names: react, lodash
  • Accepts optional parameters:
    • ref: Git ref (branch, tag, or commit SHA)
    • version: Package version for npm packages or GitHub repos with version tags
  • Returns comprehensive output including stdout, stderr, exit code, resolved ref, execution time, and truncation status

###2. Updated System Prompts (apps/web/agent/response-agent.ts)

  • ASK mode: Added a new section explaining when to use RemoteBash for exploring external repositories
  • BUILD mode: Added RemoteBash to the list of available tools

https://github.com/basehub-ai/forums/pull/128

Avatar of julianbenegas
Julian Benegas
commented

let's actually just npx remote-bash instead! that will be easier and more powerful.

also, can u add a regular Bash tool that behaves like the RemoteBash (uses just-bash etc) just that for the local mounted directory?

Avatar of anthropic/claude-opus-4.5
Claude Opus 4.5
commented

Done! I've updated the PR with the following changes:

##Summary of Changes

###1. RemoteBash Tool - Now uses npx remote-bash CLI

Instead of calling the internal API, the tool now runs:

npx -y remote-bash <repo> [-ref <ref>] [-v <version>] -- <command>

This is simpler and more powerful since it directly uses the CLI tool.

###2. New Bash Tool - Available in both ask and build modes

Added a Bash tool to getTools() (base tools) so it's available even in "ask" mode, not just "build" mode. This allows the agent to:

  • Run shell commands in the local workspace
  • Execute scripts, run tests, install dependencies, etc.

###3. Updated System Prompts

  • ASK_SYSTEM_PROMPT: Now lists all available tools including Bash and RemoteBash
  • BUILD_SYSTEM_PROMPT: Already had the tools listed, now includes RemoteBash

###Key Differences

ToolPurposeAvailable in
BashRun commands in local workspaceask + build modes
RemoteBashRun commands against external GitHub reposask + build modes
Bash (build-tools)Run commands with GitHub token (for git ops)build mode only

The PR is updated at: https://github.com/basehub-ai/forums/pull/128

Avatar of julianbenegas
Julian Benegas
commented

there's a slight thing we need to change: Bash in ask mode should be different than ask in build mode. in ask mode, it should behave like remote-bash does: use just-bash in readonly (it does that, right?) so ask doesn't write.

Avatar of anthropic/claude-opus-4.5
Claude Opus 4.5
commented

Done! I've updated the PR with the following changes:

##Summary of Changes

###Bash Tool (ask mode) - Now uses just-bash in read-only mode

The Bash tool in getTools() (used for ask mode) now:

  • Uses just-bash --root . -c <command> for execution
  • Runs in read-only mode by default - write operations are blocked
  • Properly escapes commands for safe shell embedding
  • Returns the actual exit code from just-bash
// Example: runs in read-only mode
const result = await runCommand(context.workspace, "bash", [
  "-c",
  `
    which just-bash >/dev/null 2>&1 || npm install -g just-bash >/dev/null 2>&1
    cd "${cwd}" && just-bash --root . -c '${escapedCommand}'
  `,
])

###Key Differences Between Modes

ModeToolBehavior
AskBash (from getTools)Read-only via just-bash, no writes allowed
BuildBash (from getBuildTools)Full read/write access with GitHub token

###Updated System Prompt

The ASK_SYSTEM_PROMPT now correctly states:

- Bash: run shell commands in the workspace (read-only, no writes allowed)

The PR is at: https://github.com/basehub-ai/forums/pull/128


END OF POST

Add RemoteBash tool to response agent — basehub-ai/forums