Keep the handoff continuation message when its turn is folded away
This commit is contained in:
Vendored
+3
-1
@@ -159,6 +159,7 @@ export function mountChat(root, src, makeHead) {
|
||||
unplaced: [],
|
||||
lastMessage: undefined,
|
||||
turnStart: undefined,
|
||||
keepTurnStart: false,
|
||||
quiet: false,
|
||||
handoff: undefined,
|
||||
root: src.root(),
|
||||
@@ -437,7 +438,7 @@ export function mountChat(root, src, makeHead) {
|
||||
openHandoff();
|
||||
}
|
||||
if (ev.kind === "turn.ended" && ctx.quiet && ctx.turnStart?.parentNode === transcript) {
|
||||
let node = ctx.turnStart;
|
||||
let node = ctx.keepTurnStart ? ctx.turnStart.nextSibling : ctx.turnStart;
|
||||
while (node && node !== spinner) {
|
||||
const next = node.nextSibling;
|
||||
node.remove();
|
||||
@@ -450,6 +451,7 @@ export function mountChat(root, src, makeHead) {
|
||||
put(el);
|
||||
if (ev.kind === "user.message" && p["mid_turn"] !== true) {
|
||||
ctx.turnStart = el;
|
||||
ctx.keepTurnStart = p["continuation"] === true;
|
||||
}
|
||||
if (ev.kind === "turn.ended" || ev.kind === "inbox.created") {
|
||||
addAnchor(ev.seq, el, ev.kind === "turn.ended");
|
||||
|
||||
Reference in New Issue
Block a user