Replace remote GitHub API file tools with local filesystem equivalents#2280
Merged
hiroshinishio merged 1 commit intomainfrom Feb 19, 2026
Merged
Replace remote GitHub API file tools with local filesystem equivalents#2280hiroshinishio merged 1 commit intomainfrom
hiroshinishio merged 1 commit intomainfrom
Conversation
- Replace get_remote_file_content agent tool with get_local_file_content (reads from clone_dir) - Remove search_remote_file_contents agent tool (search_local_file_contents covers this) - Delete dead code: get_pull_request_file_contents (no callers), get_remote_file_content, search_remote_file_contents and their tests - Move tool property constants (KEYWORD, LINE_NUMBER, START_LINE, END_LINE) to properties.py - Move GET_LOCAL_FILE_CONTENT tool definition into get_local_file_content.py - Switch review_run_handler from remote to local file reading
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.
Summary
get_remote_file_contentagent tool withget_local_file_contentthat reads from the local clone instead of calling the GitHub Contents API. This lets the agent read gitignored files likenode_modules/.search_remote_file_contentsagent tool sincesearch_local_file_contentsalready covers this use case.get_pull_request_file_contents(had zero callers),get_remote_file_content,search_remote_file_contents, and all their test files (-1956 lines).KEYWORD,LINE_NUMBER,START_LINE,END_LINE) fromtools.pytoproperties.pyandGET_LOCAL_FILE_CONTENTdefinition intoget_local_file_content.pyto co-locate definitions with implementations.review_run_handlerfrom remote to local file reading.Social Media Post (GitAuto)
GitAuto used to read files by calling the GitHub API every time. Now it reads and writes files directly on the local clone. No more round-trips to GitHub just to see what's in a file. Faster, no rate limits, and it can finally see gitignored files like node_modules.
Social Media Post (Wes)
We recently added local git clone to our agent. But the file reading tools were still calling the GitHub API. Every read was a network round-trip for no reason. Migrated everything to local filesystem reads. Also found a function with zero callers while cleaning up. -1956 lines.