acuvo-code 0.6.0 → 0.6.1
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/ENTERPRISE.md +3 -3
- package/lib/model.mjs +1524 -1490
- package/lib/turn.mjs +16 -3
- package/package.json +1 -1
package/lib/turn.mjs
CHANGED
|
@@ -4996,7 +4996,7 @@ export async function runTurn({ toolNames = SINGLE_SHOT_TOOL_NAMES, ...rest }) {
|
|
|
4996
4996
|
* looks right. A reported zero, by contrast, IS printed — that is the expensive
|
|
4997
4997
|
* case and the one worth seeing.
|
|
4998
4998
|
*/
|
|
4999
|
-
function cacheClause(cache) {
|
|
4999
|
+
function cacheClause(cache, servedBy = null) {
|
|
5000
5000
|
if (!cache || cache.hitRate === null) return '';
|
|
5001
5001
|
const pct = Math.round(cache.hitRate * 100);
|
|
5002
5002
|
// ⚠️ Disclosed, not averaged away: a partial figure that does not say it is
|
|
@@ -5030,7 +5030,20 @@ function cacheClause(cache) {
|
|
|
5030
5030
|
const firstClause = first && typeof first.hitRate === 'number' && first.promptTokens > 0
|
|
5031
5031
|
? `; round 1 ${Math.round(first.hitRate * 100)}%`
|
|
5032
5032
|
: '';
|
|
5033
|
-
|
|
5033
|
+
/**
|
|
5034
|
+
* ── 💰⭐⭐ NAME THE UPSTREAM ON A MISS — A MISS WITHOUT ONE IS UNDIAGNOSABLE ─
|
|
5035
|
+
*
|
|
5036
|
+
* Measured 2026-08-22: each provider keeps its OWN prompt cache, and an
|
|
5037
|
+
* OpenRouter provider `order` is a PREFERENCE — three names rotate
|
|
5038
|
+
* (StreamLake, Baidu, StreamLake) and every switch is a guaranteed miss.
|
|
5039
|
+
* Only `only:[name]` is sticky.
|
|
5040
|
+
*
|
|
5041
|
+
* ⭐ SO THE UPSTREAM *IS* THE EXPLANATION, and printing the rate without it
|
|
5042
|
+
* was reporting a symptom with the cause deleted. Shown only when the rate is
|
|
5043
|
+
* poor: on a good run it is noise, and on a bad one it is the whole answer.
|
|
5044
|
+
*/
|
|
5045
|
+
const who = servedBy && pct < 50 ? ` · served by ${servedBy}` : '';
|
|
5046
|
+
return ` · cache ${pct}% (${cache.cachedTokens} of ${cache.promptTokens} prompt tokens${firstClause}${partial})${who}`;
|
|
5034
5047
|
}
|
|
5035
5048
|
|
|
5036
5049
|
/**
|
|
@@ -5571,7 +5584,7 @@ export function formatSummary(outcome) {
|
|
|
5571
5584
|
* `labelForModelId` falls back to the raw id for anything we did not ship,
|
|
5572
5585
|
* so a model somebody chose themselves still prints honestly.
|
|
5573
5586
|
*/
|
|
5574
|
-
lines.push(`${labelForModelId(outcome.model)}${roundsPart} · ${tokens ?? '?'} tokens · $${cost.toFixed(6)}${cacheClause(outcome.usage?.cache)}`);
|
|
5587
|
+
lines.push(`${labelForModelId(outcome.model)}${roundsPart} · ${tokens ?? '?'} tokens · $${cost.toFixed(6)}${cacheClause(outcome.usage?.cache, outcome.servedBy)}`);
|
|
5575
5588
|
lines.push(...cacheWarning(outcome));
|
|
5576
5589
|
}
|
|
5577
5590
|
|