@chenacc/agentbridge 0.2.5 → 0.2.6
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/public/transcript.js +5 -2
package/package.json
CHANGED
package/public/transcript.js
CHANGED
|
@@ -332,7 +332,10 @@ function inputEntry(event, options, settledOutcome) {
|
|
|
332
332
|
* full turned one request into a wall of overlapping drafts on a phone screen.
|
|
333
333
|
*/
|
|
334
334
|
function collapsedEntry(event, label, summary, text, className, options) {
|
|
335
|
-
|
|
335
|
+
// A streaming row changes on every chunk, so it must never be cached — caching it
|
|
336
|
+
// froze the collapsed text at the first batch while the answer kept growing.
|
|
337
|
+
const stable = event.kind !== "message.delta";
|
|
338
|
+
const cached = stable ? cachedEntry(options.cache, event) : null;
|
|
336
339
|
if (cached) return cached;
|
|
337
340
|
const content = renderMessageMarkdown(String(text ?? ""), options.math ? { math: options.math } : undefined);
|
|
338
341
|
const entry = {
|
|
@@ -340,7 +343,7 @@ function collapsedEntry(event, label, summary, text, className, options) {
|
|
|
340
343
|
className,
|
|
341
344
|
html: `<time class="event-time">${formatTime(event.time, options.formatMessageTime)}</time><div class="event-body"><strong>${escapeHtml(label)}</strong><details class="step-detail"><summary>${escapeHtml(summary)}</summary><div class="message-markdown">${content}</div></details></div>`,
|
|
342
345
|
};
|
|
343
|
-
return rememberEntry(options.cache, event, entry);
|
|
346
|
+
return stable ? rememberEntry(options.cache, event, entry) : entry;
|
|
344
347
|
}
|
|
345
348
|
|
|
346
349
|
/** Turn a session's events into the list of transcript entries to display. */
|