@noobdemon/noob-cli 1.10.16 → 1.10.18

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noobdemon/noob-cli",
3
- "version": "1.10.16",
3
+ "version": "1.10.18",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/agent.js CHANGED
@@ -524,10 +524,8 @@ export async function runAgent({ history, model, signal, onTool, onStatus, onDel
524
524
 
525
525
  const system = buildSystem(history, extraToolsDoc, goal, recentSessions);
526
526
  const message = buildUserMessage(history);
527
- // Cập nhật context tokens realtime — đếm system + message sau khi build xong.
528
- // Mỗi iteration (tool call, steer) history thay đổi → size thay đổi → cần update.
529
- tokenMeter?.setContext(countTokens(system) + countTokens(message));
530
- tokenMeter?.addInput(countTokens(message));
527
+ tokenMeter?.addInput(countTokens(system) + countTokens(message));
528
+ tokenMeter?.setContext(tokenMeter.total);
531
529
  onStatus?.("thinking");
532
530
  onDelta?.({ type: "step-start" });
533
531
  // Stream + auto-retry: bao lớp resilience cho lỗi stream cut / empty / network.
package/src/repl.js CHANGED
@@ -1368,7 +1368,6 @@ NGUYÊN TẮC:
1368
1368
  // 60% (120k tokens) → nhắc nhẹ.
1369
1369
  try {
1370
1370
  const totalTokens = countMessages(state.history);
1371
- tokenMeter.setContext(totalTokens);
1372
1371
  const k = Math.round(totalTokens / 1000);
1373
1372
  const pct = Math.round((totalTokens / CONTEXT_WINDOW) * 100);
1374
1373
  // Mốc 3 (≥80% — 160k tokens): TỰ ĐỘNG compact.