toolWithMaxBudget formats a tool name with a per-call budget annotation when the configured maximum is greater than 1. This helps agents understand that multiple calls to the same tool are allowed for the current workflow. Returns "toolname" when max is nil or "1" (default single-call behavior). Re
(name string, max *string)
| 511 | // Returns "toolname" when max is nil or "1" (default single-call behavior). |
| 512 | // Returns "toolname(max:N)" when max > 1 so agents know the real action budget. |
| 513 | func toolWithMaxBudget(name string, max *string) string { |
| 514 | if max == nil || *max == "1" { |
| 515 | return name |
| 516 | } |
| 517 | return fmt.Sprintf("%s(max:%s)", name, *max) |
| 518 | } |
| 519 | |
| 520 | // buildSafeOutputsSections returns the PromptSections that form the <safe-output-tools> block. |
| 521 | // The block contains: |
no outgoing calls