Skip to content

refactor(review): consolidate repo context into single sandbox tool - #7

Merged
ephor merged 1 commit into
mainfrom
feature/consolidate-repo-tools
Jul 13, 2026
Merged

refactor(review): consolidate repo context into single sandbox tool#7
ephor merged 1 commit into
mainfrom
feature/consolidate-repo-tools

Conversation

@ephor

@ephor ephor commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Remove read_repo_file, list_repo_dir, search_repo tools and the per-pass call budget system. All repository exploration now flows through run_repo_command against a persistent sandbox checkout.

Also rewrite the instruction to guide evidence-based investigation: concrete questions → targeted searches → callers/tests → iterate.

Changes

  • repo-tools.ts: removed read_repo_file, list_repo_dir, search_repo, resolveToolBudget, isSafeRepoPath, guardedExecute; repoContextTools now returns only run_repo_command (+ dependency_review)
  • instruction.ts: new ## Repository investigation section with numbered workflow steps
  • review-pr.ts: removed fileCount parameter from repoContextTools calls
  • env.ts: removed REPO_TOOL_CALL_BUDGET / REPO_TOOL_CALL_BUDGET_MAX env vars
  • README.md: updated architecture and tool descriptions
  • Tests: simplified, added test D for instruction content

Motivation

After switching to persistent sandbox checkout, the GitHub API file/list/search tools caused reviewers to clone once then abandon the checkout for slower, fragmented API reads. Single tool + good instructions > four tools with budget system.

Remove read_repo_file, list_repo_dir, search_repo tools and the
per-pass call budget system. All repository exploration now flows
through run_repo_command against a persistent sandbox checkout.

Also rewrite the instruction to guide evidence-based investigation:
concrete questions → targeted searches → callers/tests → iterate.
@mimir-code-assist

Copy link
Copy Markdown

Mimir review — 🟢 No blocking issues

Clean refactor that consolidates all repository exploration behind the persistent sandbox checkout, removing three GitHub API-based tools (read_repo_file, list_repo_dir, search_repo) along with their budget system (REPO_TOOL_CALL_BUDGET, REPO_TOOL_CALL_BUDGET_MAX). The call-budget existed solely to rate-limit GitHub API calls — with those tools removed, it has no purpose. All call sites, env-schema definitions, documentation, and tests are updated consistently. The sandbox command remains bounded by timeout (60s) and output size (20K chars), and path-traversal protection is already covered by isSafeSandboxCommand. The replacement instruction guidance is more thorough and principled.

Findings: 0 critical · 0 major · 0 minor · 0 nit

💰 Review cost: $0.0166 — primary deepseek/deepseek-v4-flash $0.0166

@ephor
ephor requested a review from lapa2112 July 12, 2026 10:40
@ephor
ephor merged commit f5d3684 into main Jul 13, 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