feat: Enhance usage tracking across response handlers

This commit is contained in:
decolua committed 2026-02-03 00:29:22 +07:00
1 parent c1e88a9d01
commit a33924b336
8 files changed
+299 -66

No files matched your search

@@ -12,7 +12,6 @@ export function adjustMaxTokens(body) {
// Tool calls with large content (like writing files) need more tokens
if (body.tools && Array.isArray(body.tools) && body.tools.length > 0) {
if (maxTokens < DEFAULT_MIN_TOKENS) {
console.log(`[AUTO-ADJUST] max_tokens: ${maxTokens} → ${DEFAULT_MIN_TOKENS} (tool calling detected)`);
maxTokens = DEFAULT_MIN_TOKENS;
}
}