Commit a53668a
committed
fix(autonomous-loop): cap read_file and run_bash output
grep_tool capped its output at 64 KB; read_file_tool returned f.read() whole
and run_bash_tool returned the complete stdout and stderr. A 2 MB log or a
failing test suite therefore entered the transcript in full, and the loop
re-serializes its history into every later prompt, so one oversized result is
paid for on every remaining call of the run.
Lift grep's cap into a shared truncate_tool_output and route all three tools
through it. The marker now reports how much was cut, so the model can narrow
its query rather than guessing that output was complete.
read_file's memory note still reports the file's real length, not the
truncated one.
Closes kyegomez#19711 parent 8db8662 commit a53668a
2 files changed
Lines changed: 39 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
48 | 63 | | |
49 | 64 | | |
50 | 65 | | |
| |||
784 | 799 | | |
785 | 800 | | |
786 | 801 | | |
787 | | - | |
| 802 | + | |
| 803 | + | |
788 | 804 | | |
789 | 805 | | |
790 | 806 | | |
791 | 807 | | |
792 | | - | |
| 808 | + | |
793 | 809 | | |
794 | 810 | | |
795 | 811 | | |
| |||
1080 | 1096 | | |
1081 | 1097 | | |
1082 | 1098 | | |
1083 | | - | |
| 1099 | + | |
1084 | 1100 | | |
1085 | 1101 | | |
1086 | 1102 | | |
| |||
1099 | 1115 | | |
1100 | 1116 | | |
1101 | 1117 | | |
1102 | | - | |
1103 | | - | |
1104 | | - | |
1105 | 1118 | | |
1106 | 1119 | | |
1107 | 1120 | | |
| |||
1174 | 1187 | | |
1175 | 1188 | | |
1176 | 1189 | | |
1177 | | - | |
1178 | | - | |
1179 | | - | |
1180 | | - | |
| 1190 | + | |
1181 | 1191 | | |
1182 | 1192 | | |
1183 | 1193 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
| |||
224 | 228 | | |
225 | 229 | | |
226 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
227 | 245 | | |
228 | 246 | | |
229 | 247 | | |
| |||
0 commit comments