refactor(agents): split dedup_tool_calls; move HITL middleware to main_agent

DedupHITLToolCallsMiddleware is only wired by the main_agent stack, but
its module also exports dedup-key resolvers consumed by the shared MCP
tool layer. Splitting keeps the resolvers (dedup_key_full_args,
wrap_dedup_key_by_arg_name, DedupResolver) in shared and moves the
middleware class verbatim into main_agent/middleware/dedup_hitl.py
(merged with its builder), eliminating the shared->main_agent dependency
that a flat move would create. No behavior change.
This commit is contained in:
CREDO23 2026-06-05 11:17:44 +02:00
parent afa51e97cf
commit fbd5ccc35a
5 changed files with 127 additions and 111 deletions

View file

@ -6,7 +6,7 @@ import pytest
from langchain_core.messages import AIMessage
from langchain_core.tools import StructuredTool
from app.agents.shared.middleware.dedup_tool_calls import (
from app.agents.multi_agent_chat.main_agent.middleware.dedup_hitl import (
DedupHITLToolCallsMiddleware,
)

View file

@ -2,8 +2,10 @@ import pytest
from langchain_core.messages import AIMessage
from langchain_core.tools import StructuredTool
from app.agents.shared.middleware.dedup_tool_calls import (
from app.agents.multi_agent_chat.main_agent.middleware.dedup_hitl import (
DedupHITLToolCallsMiddleware,
)
from app.agents.shared.middleware.dedup_tool_calls import (
wrap_dedup_key_by_arg_name,
)