fix(chat): a stopped turn shows in its conversation, and the composer field draws no box of its own
deploy / plan (push) Successful in 8s
ci/woodpecker/push/deploy Pipeline was successful
deploy / gate (push) Successful in 7m41s
deploy / agent-image (push) Skipped
deploy / archied-image (push) Successful in 58s
deploy / dist-zip (push) Skipped

This commit is contained in:
sam committed 2026-11-10 23:33:30 +11:00
1 parent 8aa3540fa7
commit f3f90f3224
2 files changed
+8 -4

No files matched your search

+1 -1
View File
@@ -220,7 +220,7 @@ function onKeydown(event: KeyboardEvent): void {
aria-controls="slash-palette"
:aria-expanded="isCommandMenuOpen && commandMatches.length ? 'true' : 'false'"
:aria-activedescendant="isCommandMenuOpen && commandMatches.length ? `slash-palette-option-${commandSelection}` : undefined"
class="max-h-40 min-h-11 flex-1 resize-none border-0 bg-transparent! px-0 py-1 text-label focus-visible:ring-0"
class="max-h-40 min-h-11 flex-1 resize-none rounded-none border-0 bg-transparent! px-0 py-1 text-label shadow-none focus-visible:ring-0"
@input="onInput"
@keydown="onKeydown"
/>
+7 -3
View File
@@ -353,12 +353,13 @@ async function readTranscript(id: string): Promise<ChatMessage[]> {
api.chatTurns<ChatTurnView[]>(id),
]);
const byAssistantMessage = new Map<string, ChatTurnView>();
// A failed turn records no reply, so its error follows the message it failed on.
// A failed or stopped turn records no reply, so what happened follows the
// message it was answering.
const failedByInput = new Map<string, ChatTurnView>();
for (const turn of turns || []) {
const assistantID = turn.assistant_message_id || turn.AssistantMessageID;
if (assistantID) byAssistantMessage.set(assistantID, turn);
else if (turn.status === "failed" && turn.input_message_id)
else if ((turn.status === "failed" || turn.status === "cancelled") && turn.input_message_id)
failedByInput.set(turn.input_message_id, turn);
}
return (msgs || []).flatMap((message) => {
@@ -370,7 +371,10 @@ async function readTranscript(id: string): Promise<ChatMessage[]> {
message,
{
from: "assistant",
text: `Unable to complete that turn: ${failed.error || "unknown error"}`,
text:
failed.status === "cancelled"
? "Stopped before replying."
: `Unable to complete that turn: ${failed.error || "unknown error"}`,
tool_calls: failed.tool_calls || [],
},
];