Commit 78f07b0
committed
fix: only count assistant messages when limiting consecutive tool calls
Before this change, the number of consecutive tool calls was counted by
looking at all messages since the last time a message with role "user"
was sent. This was bad logic because the LLM could ask for many parallel
tool calls.
This change addresses this problem by only considering messages with
role "assistant" with tool calls since the last user message.
Signed-off-by: Donnie Adams <donnie@acorn.io>1 parent a89c442 commit 78f07b0
1 file changed
+11
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
403 | | - | |
| 403 | + | |
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
409 | 417 | | |
410 | | - | |
411 | 418 | | |
412 | | - | |
413 | | - | |
| 419 | + | |
| 420 | + | |
414 | 421 | | |
415 | 422 | | |
416 | 423 | | |
| |||
0 commit comments