deerflow2/backend/src
DanielWalnut d27a7a5f54
fix(middleware): fix DanglingToolCallMiddleware inserting patches at wrong position (#904)
Previously used before_model which returned {"messages": patches}, causing
LangGraph's add_messages reducer to append patches at the end of the message
list. This resulted in invalid ordering (ToolMessage after a HumanMessage)
that LLMs reject with tool call ID mismatch errors.

Switch to wrap_model_call/awrap_model_call to insert synthetic ToolMessages
immediately after each dangling AIMessage before the request reaches the LLM,
without persisting the patches to state.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 22:29:33 +08:00
..
agents fix(middleware): fix DanglingToolCallMiddleware inserting patches at wrong position (#904) 2026-02-25 22:29:33 +08:00
community Refactor base paths with centralized path management (#901) 2026-02-25 21:30:33 +08:00
config Refactor base paths with centralized path management (#901) 2026-02-25 21:30:33 +08:00
gateway Refactor base paths with centralized path management (#901) 2026-02-25 21:30:33 +08:00
mcp fix: ensure MCP and skills config changes are immediately reflected 2026-01-25 22:40:09 +08:00
models feat(subagents): make subagent timeout configurable via config.yaml (#897) 2026-02-25 08:39:29 +08:00
reflection chore: use ruff to lint and auto-format 2026-01-14 09:08:20 +08:00
sandbox Refactor base paths with centralized path management (#901) 2026-02-25 21:30:33 +08:00
skills fix: ensure MCP and skills config changes are immediately reflected 2026-01-25 22:40:09 +08:00
subagents feat(subagents): make subagent timeout configurable via config.yaml (#897) 2026-02-25 08:39:29 +08:00
tools feat(subagents): make subagent timeout configurable via config.yaml (#897) 2026-02-25 08:39:29 +08:00
utils feat: add thread-safety and graceful shutdown to AioSandboxProvider (#7) 2026-01-16 22:28:19 +08:00
__init__.py chore: add an empty __init__.py 2026-01-14 07:16:27 +08:00