Skip to content

Commit 907e06c

Browse files
committed
handle large files
1 parent 47e26dd commit 907e06c

1 file changed

Lines changed: 35 additions & 3 deletions

File tree

.github/workflows/claude.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
with:
7272
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
7373
github_token: ${{ secrets.GITHUB_TOKEN }}
74-
max_turns: 10
74+
max_turns: 20
7575
model: claude-opus-4-5-20251101
7676
custom_instructions: |
7777
You are reviewing a GAIA pull request. Provide a thorough, professional code review following GAIA standards.
@@ -82,6 +82,16 @@ jobs:
8282
- Repository is checked out at the PR head
8383
- Focus your review on the changed files and their impact
8484
85+
**CRITICAL: Efficient Review Strategy**
86+
- **ALWAYS read pr-diff.txt FIRST** to see exactly what changed
87+
- **DO NOT** read entire large files (>1000 lines) - you'll hit token limits
88+
- For large files like cli.py:
89+
1. Read pr-diff.txt to see the changed sections
90+
2. Use Grep with context to find related code: `grep -C 10 "pattern"`
91+
3. Use Read with offset/limit for specific line ranges
92+
- Focus on reviewing CHANGED code, not reading entire files
93+
- Complete your review even if you can't read every file
94+
8595
## Suggested Changes Policy
8696
8797
Use GitHub's suggestion feature for fixable issues. Provide suggestions for:
@@ -206,7 +216,7 @@ jobs:
206216
with:
207217
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
208218
github_token: ${{ secrets.GITHUB_TOKEN }}
209-
max_turns: 10
219+
max_turns: 20
210220
model: claude-opus-4-5-20251101
211221
custom_instructions: |
212222
You are GAIA's AI assistant helping with pull request discussions.
@@ -216,6 +226,12 @@ jobs:
216226
- Read pr-files.txt for the list of changed files
217227
- Repository is checked out at the PR head
218228
229+
**CRITICAL: File Reading Strategy**
230+
- Read pr-diff.txt first to see what changed
231+
- Use Grep for searching large files (>1000 lines)
232+
- Use Read with offset/limit for specific sections
233+
- Focus on changed code, not entire files
234+
219235
**When to provide suggested changes:**
220236
- User explicitly asks you to fix something (e.g., "@claude fix the formatting")
221237
- Simple, clear fixes like copyright headers, formatting, import sorting
@@ -316,7 +332,7 @@ jobs:
316332
with:
317333
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
318334
github_token: ${{ secrets.GITHUB_TOKEN }}
319-
max_turns: 10
335+
max_turns: 30
320336
model: claude-opus-4-5-20251101
321337
custom_instructions: |
322338
You are GAIA's helpful AI assistant. Follow the Issue Response Guidelines in CLAUDE.md.
@@ -327,6 +343,22 @@ jobs:
327343
328344
## For PR Conversation Comments
329345
346+
**CRITICAL: Handling Large Files**
347+
- **NEVER** read entire large files (>1000 lines). You will hit token limits and fail.
348+
- For large files like cli.py:
349+
1. Use Grep to search for specific changes: `grep -C 10 "pattern" file.py`
350+
2. Use Read with offset/limit for specific sections
351+
3. Focus on changed sections shown in pr-diff.txt
352+
- **ALWAYS** read pr-diff.txt first to see what actually changed
353+
- Only read full files if they are small (<500 lines)
354+
355+
**Review Approach:**
356+
1. Read pr-diff.txt and pr-files.txt first
357+
2. Focus review on changed lines, not entire files
358+
3. Use grep to search for patterns, imports, related code
359+
4. Read small files completely, large files selectively
360+
5. Provide review once you've analyzed all changes (don't stop early)
361+
330362
When responding to questions in PR conversation (not line-specific review comments):
331363
- **IMPORTANT:** Read pr-diff.txt to see the full diff of changes in this PR
332364
- Read pr-files.txt to see the list of changed files

0 commit comments

Comments
 (0)