Commit ac9ceaf
committed
fix: prevent infinite loop in extract_toc_content
The while loop exit condition used len(chat_history), but chat_history
was rebuilt every iteration with exactly 2 elements, making the check
len(chat_history) > 5 never true.
Replace with explicit attempt counter and max_attempts limit.1 parent 823c11e commit ac9ceaf
1 file changed
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
183 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
184 | 191 | | |
185 | | - | |
186 | | - | |
| 192 | + | |
| 193 | + | |
187 | 194 | | |
188 | 195 | | |
189 | 196 | | |
190 | 197 | | |
191 | 198 | | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | 199 | | |
197 | 200 | | |
198 | 201 | | |
| |||
0 commit comments