Skip to content

Replace remote GitHub API file tools with local filesystem equivalents#2280

Merged
hiroshinishio merged 1 commit intomainfrom
wes
Feb 19, 2026
Merged

Replace remote GitHub API file tools with local filesystem equivalents#2280
hiroshinishio merged 1 commit intomainfrom
wes

Conversation

@hiroshinishio
Copy link
Collaborator

@hiroshinishio hiroshinishio commented Feb 19, 2026

Summary

  • Replaced get_remote_file_content agent tool with get_local_file_content that reads from the local clone instead of calling the GitHub Contents API. This lets the agent read gitignored files like node_modules/.
  • Removed search_remote_file_contents agent tool since search_local_file_contents already covers this use case.
  • Deleted dead code: get_pull_request_file_contents (had zero callers), get_remote_file_content, search_remote_file_contents, and all their test files (-1956 lines).
  • Moved tool property constants (KEYWORD, LINE_NUMBER, START_LINE, END_LINE) from tools.py to properties.py and GET_LOCAL_FILE_CONTENT definition into get_local_file_content.py to co-locate definitions with implementations.
  • Switched review_run_handler from 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.

- 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
@hiroshinishio hiroshinishio self-assigned this Feb 19, 2026
@hiroshinishio hiroshinishio merged commit 0c2f4b5 into main Feb 19, 2026
1 check passed
@hiroshinishio hiroshinishio deleted the wes branch February 19, 2026 06:36
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