Skip to content

fix(harness): wire gitStatus tool into HarnessAgent tool dispatch#672

Merged
simongonzalezdc merged 2 commits into
mainfrom
fix/harness-gitstatus-dispatch
Jun 9, 2026
Merged

fix(harness): wire gitStatus tool into HarnessAgent tool dispatch#672
simongonzalezdc merged 2 commits into
mainfrom
fix/harness-gitstatus-dispatch

Conversation

@simongonzalezdc

Copy link
Copy Markdown
Member

Problem

gitStatus is listed in AVAILABLE_TOOL_NAMES (src/harness/agent/HarnessAgent.ts:62) and the unknown-tool error hint explicitly tells the LLM to "use gitStatus for repo state" — but getToolInstance() had no case for it, so every gitStatus call resolved to null and failed. The agent was advised to use a tool it could never reach. The tool itself (src/harness/tools/GitStatusTool.ts) is fully implemented and exported from the tools index; it was simply never imported into the agent.

Solution

Two lines: add gitStatusTool to the existing import from ../tools/index.js and case 'gitStatus': return gitStatusTool; to the dispatch switch. No new files, no API changes.

Verification

pnpm build && pnpm typecheck   # both pass, exit 0

Pre-commit related-file tests: 25 files / 333 tests passed.

Next Step

Add a regression test asserting every name in AVAILABLE_TOOL_NAMES resolves to a non-null instance from getToolInstance() to prevent this class of drift.

🤖 Generated with Claude Code

Sinter Test and others added 2 commits June 9, 2026 15:11
gitStatus was advertised in AVAILABLE_TOOL_NAMES and recommended in the
unknown-tool hint, but getToolInstance() had no case for it, so every
call failed with a null tool. Import the existing gitStatusTool and add
the missing switch case.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Every name advertised in AVAILABLE_TOOL_NAMES must resolve to a tool
instance whose .name matches, so the tool list and getToolInstance()
can never drift apart again (the gitStatus gap this PR fixes).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@simongonzalezdc simongonzalezdc merged commit c34f73a into main Jun 9, 2026
8 checks passed
@simongonzalezdc simongonzalezdc deleted the fix/harness-gitstatus-dispatch branch June 9, 2026 22:51
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