Skip to content
This repository was archived by the owner on May 5, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/ui/src/builder/AgentBuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export function AgentBuilder() {
{rightTab === 'checkpoint' && isCheckpointEligible ? (
<div className="space-y-4">
<div className="text-[10px] uppercase text-muted-foreground">Checkpoint Stream</div>
<CheckpointStreamPanel />
<CheckpointStreamPanel agentId={selectedNode?.id} />
</div>
) : (
<RightPropertiesPanel node={selectedNode} onChange={updateNodeData} />
Expand Down
6 changes: 4 additions & 2 deletions apps/ui/src/components/stream/CheckpointStreamPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ import { StatusChip } from './StatusChip';

interface Props {
defaultThreadId?: string;
agentId?: string;
url?: string;
}

export function CheckpointStreamPanel({ defaultThreadId = '', url }: Props) {
export function CheckpointStreamPanel({ defaultThreadId = '', agentId, url }: Props) {
const [threadId, setThreadId] = useState(defaultThreadId);
const [autoScroll, setAutoScroll] = useState(true);

const { items, status, error, connected, isPaused, pause, resume, clear, retry, dropped } = useCheckpointStream({
url,
threadId: threadId || undefined,
agentId,
});

const listRef = useRef<HTMLDivElement | null>(null);
Expand Down Expand Up @@ -98,7 +100,7 @@ export function CheckpointStreamPanel({ defaultThreadId = '', url }: Props) {
/>
))}
</div>
<p className="text-xs text-muted-foreground">Leave both inputs empty to stream all writes (capped live list).</p>
<p className="text-xs text-muted-foreground">Leave threadId empty to stream all writes (capped live list).</p>
</div>
);
}
5 changes: 4 additions & 1 deletion apps/ui/src/hooks/useCheckpointStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface CheckpointWriteClient {
export interface UseCheckpointStreamParams {
url?: string;
threadId?: string;
agentId?: string;
maxItems?: number;
autoStart?: boolean;
}
Expand All @@ -27,6 +28,7 @@ interface InitialPayload { items: any[] } // eslint-disable-line @typescript-esl
export function useCheckpointStream({
url = 'http://localhost:3010',
threadId,
agentId,
maxItems = 500,
autoStart = true,
}: UseCheckpointStreamParams) {
Expand Down Expand Up @@ -93,12 +95,13 @@ export function useCheckpointStream({

const initPayload: Record<string, string> = {};
if (threadId) initPayload.threadId = threadId;
if (agentId) initPayload.agentId = agentId;
socket.emit('init', initPayload);

return () => {
socket.disconnect();
};
}, [url, threadId, isPaused, maxItems]);
}, [url, threadId, agentId, isPaused, maxItems]);

useEffect(() => {
if (!autoStart) return;
Expand Down