From 12434ebd1a5526f96e3e80e15471de42b161a525 Mon Sep 17 00:00:00 2001 From: bracesproul Date: Mon, 10 Mar 2025 14:58:51 -0700 Subject: [PATCH] cr --- .../hooks/use-interrupted-actions.tsx | 56 +++++++++++-------- src/components/thread/messages/ai.tsx | 3 +- 2 files changed, 34 insertions(+), 25 deletions(-) diff --git a/src/components/thread/agent-inbox/hooks/use-interrupted-actions.tsx b/src/components/thread/agent-inbox/hooks/use-interrupted-actions.tsx index 58b7775..8555bd6 100644 --- a/src/components/thread/agent-inbox/hooks/use-interrupted-actions.tsx +++ b/src/components/thread/agent-inbox/hooks/use-interrupted-actions.tsx @@ -80,21 +80,24 @@ export default function useInterruptedActions({ } }, [interrupt]); - const resumeRun = ( - response: HumanResponse[], - ): boolean => { + const resumeRun = (response: HumanResponse[]): boolean => { try { - thread.submit({}, { - command: { - resume: response, - update: { - messages: [{ - type: "human", - content: `Sending type '${response[0].type}' to interrupt...` - }] - } + thread.submit( + {}, + { + command: { + resume: response, + update: { + messages: [ + { + type: "human", + content: `Sending type '${response[0].type}' to interrupt...`, + }, + ], + }, + }, }, - }) + ); return true; } catch (e: any) { console.error("Error sending human response", e); @@ -258,17 +261,22 @@ export default function useInterruptedActions({ initialHumanInterruptEditValue.current = {}; try { - thread.submit({}, { - command: { - goto: END, - update: { - messages: [{ - type: "human", - content: "Marking thread as resolved." - }] - } - } - }) + thread.submit( + {}, + { + command: { + goto: END, + update: { + messages: [ + { + type: "human", + content: "Marking thread as resolved.", + }, + ], + }, + }, + }, + ); toast("Success", { description: "Marked thread as resolved.", diff --git a/src/components/thread/messages/ai.tsx b/src/components/thread/messages/ai.tsx index 76e2f7f..f3d06c6 100644 --- a/src/components/thread/messages/ai.tsx +++ b/src/components/thread/messages/ai.tsx @@ -80,7 +80,8 @@ export function AssistantMessage({ const contentString = getContentString(message.content); const thread = useStreamContext(); - const isLastMessage = thread.messages[thread.messages.length - 1].id === message.id; + const isLastMessage = + thread.messages[thread.messages.length - 1].id === message.id; const meta = thread.getMessagesMetadata(message); const interrupt = thread.interrupt; const parentCheckpoint = meta?.firstSeenState?.parent_checkpoint;