fix(harness): wire gitStatus tool into HarnessAgent tool dispatch#672
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
gitStatusis listed inAVAILABLE_TOOL_NAMES(src/harness/agent/HarnessAgent.ts:62) and the unknown-tool error hint explicitly tells the LLM to "use gitStatus for repo state" — butgetToolInstance()had no case for it, so everygitStatuscall resolved tonulland 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
gitStatusToolto the existing import from../tools/index.jsandcase 'gitStatus': return gitStatusTool;to the dispatch switch. No new files, no API changes.Verification
Pre-commit related-file tests: 25 files / 333 tests passed.
Next Step
Add a regression test asserting every name in
AVAILABLE_TOOL_NAMESresolves to a non-null instance fromgetToolInstance()to prevent this class of drift.🤖 Generated with Claude Code