fix: bound agentflow token counting fallback#6562
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a robust token counting utility (createTokenCounter) with timeout handling and fallback mechanisms, integrating it across several agent flow nodes to manage memory limits safely. The feedback suggests addressing a potential timeout leak in getNumTokensWithTimeout if a synchronous error is thrown, and adding defensive checks in createTokenCounter to handle nullish or invalid llm objects.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
Tests
Notes