@blockrun/franklin 3.15.42 → 3.15.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/loop.js +9 -2
- package/package.json +1 -1
package/dist/agent/loop.js
CHANGED
|
@@ -1236,9 +1236,16 @@ export async function interactiveSession(config, getUserInput, onEvent, onAbortR
|
|
|
1236
1236
|
savings: routingSavings,
|
|
1237
1237
|
contextPct: Math.round(contextUsagePct),
|
|
1238
1238
|
});
|
|
1239
|
-
// Record usage for stats tracking (franklin stats command)
|
|
1239
|
+
// Record usage for stats tracking (franklin stats command).
|
|
1240
|
+
// Pass the fallback flag so franklin-stats.json's totalFallbacks +
|
|
1241
|
+
// per-model fallbackCount stay in sync with the audit log a few
|
|
1242
|
+
// lines below — same `turnFailedModels.size > 0` predicate, same
|
|
1243
|
+
// turn. Without this, stats showed 0 fallbacks across 5150 real
|
|
1244
|
+
// requests on a machine that visibly hit fallback paths in
|
|
1245
|
+
// franklin-debug.log; `franklin insights` was therefore useless
|
|
1246
|
+
// for spotting a hot routing chain.
|
|
1240
1247
|
const costEstimate = estimateCost(resolvedModel, inputTokens, usage.outputTokens, 1);
|
|
1241
|
-
recordUsage(resolvedModel, inputTokens, usage.outputTokens, costEstimate, 0);
|
|
1248
|
+
recordUsage(resolvedModel, inputTokens, usage.outputTokens, costEstimate, 0, turnFailedModels.size > 0);
|
|
1242
1249
|
// ── Circuit breakers: prevent infinite-loop wallet drain ──
|
|
1243
1250
|
// Per-turn $-cap was removed in v3.11.0 — runaway loops are caught by
|
|
1244
1251
|
// MAX_TOOL_CALLS_PER_TURN (25) and MAX_TINY_RESPONSES (2) above; the
|
package/package.json
CHANGED