Files
open-code-review/internal/session
Ayush Dubey 579b931915 fix(llmloop): account for tool_calls and arguments in messageTokens (#1413)
Assistant turns issuing tool calls under OpenAI-compatible chat completions store their calls and arguments on ToolCalls rather than Native.Payload. Because messageTokens only inspected ExtractText() and Native.EstimatedTokens(), these turns evaluated to 0 tokens during active zone budget calculations, causing computeActiveZoneSize to pack too many rounds and risk exceeding model context limits.

Adds EstimatedTokens to ToolCall (including arguments and ExtraContent) and Message, and updates messageTokens to account for tool calls when not already covered by Native payload.
2026-09-28 15:16:11 +08:00
..