feat: add unified HITL approval utility for sensitive tool actions

This new module provides a `request_approval()` function that streamlines the process of requesting user approval for sensitive actions, including decision parsing and parameter merging. It enhances the interaction with tools by allowing for user modifications and handling trusted tools seamlessly.
This commit is contained in:
Anish Sarkar 2026-04-13 20:12:57 +05:30
parent 61b3f0d7e3
commit 0c4fd30cce
2 changed files with 141 additions and 1 deletions

View file

@ -470,7 +470,7 @@ async def create_surfsense_deep_agent(
SubAgentMiddleware(backend=StateBackend, subagents=[general_purpose_spec]),
create_summarization_middleware(llm, StateBackend),
PatchToolCallsMiddleware(),
DedupHITLToolCallsMiddleware(),
DedupHITLToolCallsMiddleware(agent_tools=tools),
AnthropicPromptCachingMiddleware(unsupported_model_behavior="ignore"),
]