Hide handoff continuations and NO_REPLY turns with leading text
This commit is contained in:
+3
-6
@@ -56,7 +56,6 @@ type Ctx = {
|
||||
taskId: string | undefined;
|
||||
lastMessage: HTMLElement | undefined;
|
||||
turnStart: HTMLElement | undefined;
|
||||
keepTurnStart: boolean;
|
||||
quiet: boolean;
|
||||
handoff: { summary: HTMLElement; body: HTMLElement } | undefined;
|
||||
watchReport: (el: HTMLElement, itemId: string) => void;
|
||||
@@ -220,7 +219,6 @@ export function mountChat(root: HTMLElement, src: ChatSource, makeHead: (rerende
|
||||
run: undefined,
|
||||
lastMessage: undefined,
|
||||
turnStart: undefined,
|
||||
keepTurnStart: false,
|
||||
quiet: false,
|
||||
handoff: undefined,
|
||||
root: src.root,
|
||||
@@ -464,7 +462,7 @@ export function mountChat(root: HTMLElement, src: ChatSource, makeHead: (rerende
|
||||
openHandoff();
|
||||
}
|
||||
if (ev.kind === "turn.ended" && ctx.quiet && ctx.turnStart?.parentNode === transcript) {
|
||||
let node: ChildNode | null = ctx.keepTurnStart ? ctx.turnStart.nextSibling : ctx.turnStart;
|
||||
let node: ChildNode | null = ctx.turnStart;
|
||||
while (node && node !== spinner) {
|
||||
const next: ChildNode | null = node.nextSibling;
|
||||
node.remove();
|
||||
@@ -477,7 +475,6 @@ export function mountChat(root: HTMLElement, src: ChatSource, makeHead: (rerende
|
||||
put(el);
|
||||
if (ev.kind === "user.message" && p["mid_turn"] !== true) {
|
||||
ctx.turnStart = el;
|
||||
ctx.keepTurnStart = p["continuation"] === true;
|
||||
}
|
||||
}
|
||||
if (contextChanged) {
|
||||
@@ -908,7 +905,7 @@ function renderEvent(ev: ByreEvent, ctx: Ctx): HTMLElement | null {
|
||||
const brief = first.length > 120 ? `${first.slice(0, 120)}…` : first;
|
||||
return h(
|
||||
"details",
|
||||
{ class: "tool byre-prompt" },
|
||||
{ class: "tool byre-prompt", hidden: p["continuation"] === true },
|
||||
h("summary", {}, h("span", { class: "tool-name" }, "byre"), " ", h("span", { class: "tool-brief" }, brief), " ", when),
|
||||
markdown(text, "text md", md),
|
||||
);
|
||||
@@ -925,7 +922,7 @@ function renderEvent(ev: ByreEvent, ctx: Ctx): HTMLElement | null {
|
||||
if (parentOf(p)) {
|
||||
return h("div", { class: "msg agent subagent" }, h("div", { class: "who" }, subagentTag(parentOf(p), ctx), " ", when), markdown(String(p["text"]), "text md", md));
|
||||
}
|
||||
if (String(p["text"]).trim() === quietReply) {
|
||||
if (String(p["text"]).trim().split("\n").pop()?.trim() === quietReply) {
|
||||
ctx.quiet = true;
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user