Commit 0ad0342
committed
Add file reading guardrails to prevent review agent hallucination loops
The root review agent was entering infinite loops of guessing file paths
that don't exist, burning through the entire 40-minute timeout without
ever posting a review. In one observed case, the agent made 500+
consecutive read_file calls to hallucinated paths like "gordon/raft.md",
"gordon/six-sigma.md", etc.
This adds explicit guardrails to the root agent instructions:
- Circuit breaker: stop after 3 consecutive "not found" reads
- Cap total file reads at 10 for the root agent
- Prohibit guessing file paths (use list_directory first)
- Prohibit enumerating general concepts as file paths
- Remove directory_tree from root agent toolset to discourage deep
exploration (drafter/verifier handle file analysis)1 parent 68c6c67 commit 0ad0342
1 file changed
+19
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
137 | 155 | | |
138 | 156 | | |
139 | 157 | | |
| |||
200 | 218 | | |
201 | 219 | | |
202 | 220 | | |
203 | | - | |
| 221 | + | |
204 | 222 | | |
205 | 223 | | |
206 | 224 | | |
| |||
0 commit comments