2026-10-14 00:11:00 +08:00
|
|
|
import { SubagentThreadView } from "@/components/thread/SubagentThreadView";
|
|
|
|
|
import { useSubagentThread } from "@/components/thread/useSubagentThread";
|
|
|
|
|
import type { SubagentTaskSnapshot } from "@/lib/types";
|
2026-10-05 05:16:33 +08:00
|
|
|
|
|
|
|
|
interface SubagentThreadProps {
|
|
|
|
|
token: string;
|
|
|
|
|
sessionKey: string;
|
|
|
|
|
task: SubagentTaskSnapshot;
|
|
|
|
|
historyEnabled: boolean;
|
|
|
|
|
isStreaming: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function SubagentThread({ token, sessionKey, task, historyEnabled, isStreaming }: SubagentThreadProps) {
|
2026-10-14 00:11:00 +08:00
|
|
|
const { messages, loading, failed, activeTurnId, retry } = useSubagentThread({ token, sessionKey, task, historyEnabled });
|
|
|
|
|
return <SubagentThreadView messages={messages} loading={loading} failed={failed} isStreaming={isStreaming}
|
|
|
|
|
activeTurnId={activeTurnId} runStartedAt={task.created_at} onRetry={retry} />;
|
2026-10-05 05:16:33 +08:00
|
|
|
}
|