feat: add DedupHITLToolCallsMiddleware to prevent duplicate tool calls

- Introduced DedupHITLToolCallsMiddleware to prevent duplicate HITL tool calls within a single LLM response, ensuring only the first occurrence of each tool call is retained.
- Updated the create_surfsense_deep_agent function to include the new middleware, enhancing the efficiency of tool interactions.
- Added a new middleware file for better organization and maintainability of the codebase.
This commit is contained in:
Anish Sarkar 2026-03-21 03:47:30 +05:30
parent 744ad1fa79
commit ff6514a99f
13 changed files with 97 additions and 51 deletions

View file

@ -5,7 +5,6 @@ import {
CalendarIcon,
CornerDownLeftIcon,
MailIcon,
Trash2Icon,
UserIcon,
} from "lucide-react";
import { useCallback, useEffect, useState } from "react";
@ -185,7 +184,6 @@ function ApprovalCard({
{/* Header */}
<div className="flex items-start justify-between px-5 pt-5 pb-4 select-none">
<div className="flex items-center gap-2">
<Trash2Icon className="size-4 text-muted-foreground shrink-0" />
<div>
<p className="text-sm font-semibold text-foreground">
{decided === "reject"