open-swe/apps/web/src/components/thread/messages/interrupt.tsx
Brace Sproul 1756575b4c
feat: Generate title for gh issues & better manager responses (#366)
* feat: Generate title for gh issues

* fix a lot

* fix: add proposed plan to gh issue body

* cr

* cr

* cr

* improve prompting

* cr
2025-07-09 21:38:15 +00:00

37 lines
1 KiB
TypeScript

import { isAgentInboxInterruptSchema } from "@/lib/agent-inbox-interrupt";
import { ThreadView } from "../agent-inbox";
import { GenericInterruptView } from "./generic-interrupt";
import { useStream } from "@langchain/langgraph-sdk/react";
interface InterruptProps {
interruptValue?: unknown;
isLastMessage: boolean;
hasNoAIOrToolMessages?: boolean;
forceRenderInterrupt?: boolean;
thread: ReturnType<typeof useStream>;
}
export function Interrupt({
interruptValue,
isLastMessage,
hasNoAIOrToolMessages,
forceRenderInterrupt,
thread,
}: InterruptProps) {
return (
<>
{isAgentInboxInterruptSchema(interruptValue) &&
(isLastMessage || hasNoAIOrToolMessages || forceRenderInterrupt) && (
<ThreadView
interrupt={interruptValue}
thread={thread}
/>
)}
{interruptValue &&
!isAgentInboxInterruptSchema(interruptValue) &&
(isLastMessage || forceRenderInterrupt) ? (
<GenericInterruptView interrupt={interruptValue} />
) : null}
</>
);
}