@noobdemon/noob-cli 1.9.8 → 1.9.9
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 +1 -1
- package/src/agent.js +3 -0
package/package.json
CHANGED
package/src/agent.js
CHANGED
|
@@ -513,6 +513,9 @@ export async function runAgent({ history, model, signal, onTool, onStatus, onDel
|
|
|
513
513
|
|
|
514
514
|
const system = buildSystem(history, extraToolsDoc, goal, recentSessions);
|
|
515
515
|
const message = buildUserMessage(history);
|
|
516
|
+
// Cập nhật context tokens realtime — đếm system + message sau khi build xong.
|
|
517
|
+
// Mỗi iteration (tool call, steer) history thay đổi → size thay đổi → cần update.
|
|
518
|
+
tokenMeter?.setContext(countTokens(system) + countTokens(message));
|
|
516
519
|
tokenMeter?.addInput(countTokens(message));
|
|
517
520
|
onStatus?.("thinking");
|
|
518
521
|
onDelta?.({ type: "step-start" });
|