@yeaft/webchat-agent 1.0.453 → 1.0.454
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.
|
Binary file
|
package/package.json
CHANGED
package/yeaft/engine.js
CHANGED
|
@@ -4616,6 +4616,18 @@ export class Engine {
|
|
|
4616
4616
|
// Loop back to call adapter again with tool results
|
|
4617
4617
|
}
|
|
4618
4618
|
|
|
4619
|
+
// Store the final provider-call count on the response row itself. Debug
|
|
4620
|
+
// events are transient; the response card must retain the count after a
|
|
4621
|
+
// reload without inventing a second counter.
|
|
4622
|
+
const llmCountMessage = lastPersistedAssistantTextMessage || lastPersistedAssistantMessage;
|
|
4623
|
+
if (llmCountMessage && typeof this.#conversationStore?.update === 'function') {
|
|
4624
|
+
const updated = this.#conversationStore.update(llmCountMessage, {
|
|
4625
|
+
llmCallCount: turnNumber,
|
|
4626
|
+
});
|
|
4627
|
+
if (updated?.id === lastPersistedAssistantTextMessage?.id) lastPersistedAssistantTextMessage = updated;
|
|
4628
|
+
if (updated?.id === lastPersistedAssistantMessage?.id) lastPersistedAssistantMessage = updated;
|
|
4629
|
+
}
|
|
4630
|
+
|
|
4619
4631
|
// feat-6af5f9f1 PR B: turn closed. Emits final totals so the debug
|
|
4620
4632
|
// panel can show "Turn done · 4 loops · 12.4s · 5.0k tok" without
|
|
4621
4633
|
// having to reduce the loops itself. Always fires (every break path
|
package/yeaft/web-bridge.js
CHANGED
|
@@ -1349,6 +1349,7 @@ function projectPersistedToHistoryEntry(m, { includeReflections = false } = {})
|
|
|
1349
1349
|
if (m.turnId) entry.turnId = m.turnId;
|
|
1350
1350
|
if (m.imageAssetAnchor) entry.imageAssetAnchor = true;
|
|
1351
1351
|
if (m.responseKind === 'progress' || m.responseKind === 'result') entry.responseKind = m.responseKind;
|
|
1352
|
+
if (Number.isInteger(m.llmCallCount) && m.llmCallCount > 0) entry.llmCallCount = m.llmCallCount;
|
|
1352
1353
|
if (m.incomplete === true) entry.incomplete = true;
|
|
1353
1354
|
if (typeof m.stopReason === 'string' && m.stopReason) entry.stopReason = m.stopReason;
|
|
1354
1355
|
if (m.sessionId) entry.sessionId = m.sessionId;
|
|
@@ -1489,6 +1490,7 @@ function projectVisibleHistoryChunkMessages(messages = []) {
|
|
|
1489
1490
|
...(Array.isArray(m.images) && m.images.length > 0 ? { images: m.images } : {}),
|
|
1490
1491
|
...(m.speakerVpId ? { speakerVpId: m.speakerVpId } : {}),
|
|
1491
1492
|
...(m.responseKind === 'progress' || m.responseKind === 'result' ? { responseKind: m.responseKind } : {}),
|
|
1493
|
+
...(Number.isInteger(m.llmCallCount) && m.llmCallCount > 0 ? { llmCallCount: m.llmCallCount } : {}),
|
|
1492
1494
|
...(m.incomplete === true ? { incomplete: true } : {}),
|
|
1493
1495
|
...(typeof m.stopReason === 'string' && m.stopReason ? { stopReason: m.stopReason } : {}),
|
|
1494
1496
|
...(Array.isArray(m.todos) ? { todos: m.todos } : {}),
|