Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion services/claude/tools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
# NOTE: No strict=True here because line_number, keyword, start_line, end_line are optional
GET_REMOTE_FILE_CONTENT: ToolUnionParam = {
"name": "get_remote_file_content",
"description": "Fetches the content of a file from GitHub remote repository given a file_path when you need to read or modify the file content.",
"description": "Fetches the content of a file from GitHub remote repository given a file_path when you need to read or modify the file content. IMPORTANT: Always read the FULL file by default - do NOT use start_line/end_line/line_number/keyword to truncate the read. Only use start_line/end_line for files over 2000 lines. Truncating reads causes you to miss critical context like required fields, data structures, and execution order.",
"input_schema": {
"type": "object",
"properties": {
Expand Down
8 changes: 8 additions & 0 deletions services/github/files/get_remote_file_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ def get_remote_file_content(
decoded_content: str = base64.b64decode(s=encoded_content).decode(encoding=UTF8)
lb: str = detect_line_break(text=decoded_content)
lines = decoded_content.split(lb)

# Ignore truncation parameters for files under 2000 lines to prevent missing context
if len(lines) < 2000:
line_number = None
keyword = None
start_line = None
end_line = None

width = len(str(len(lines)))
numbered_lines = [f"{i + 1:>{width}}:{line}" for i, line in enumerate(lines)]
file_path_with_lines = file_path
Expand Down
Loading
Loading