notifyToolCall method
Notifies the reflection module about the most recent tool call.
Call this from the agent loop each time a tool is successfully invoked so the loop-detection window stays accurate.
Implementation
void notifyToolCall(String toolName, Map<String, dynamic> input) {
final key = '$toolName:${input.toString()}';
_recentToolCalls.add(key);
if (_recentToolCalls.length > _config.toolLoopWindowSize * 2) {
_recentToolCalls.removeRange(
0, _recentToolCalls.length - _config.toolLoopWindowSize * 2);
}
_consecutiveThinkOnlyIterations = 0;
}