From 3cfa8328b5d6e514f1a19395fa023175d3ccc0bc Mon Sep 17 00:00:00 2001 From: "jinli.yl" Date: Fri, 17 Apr 2026 11:48:00 +0800 Subject: [PATCH] feat(memory): add chat_with_agent tool detection for markdown files - Added condition to detect chat_with_agent tools when processing markdown files - Modified md_file_tool_ids set to include chat_with_agent tool IDs during processing - Ensured proper handling of tool names in lowercase for comparison --- reme/memory/file_based/components/tool_result_compactor.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reme/memory/file_based/components/tool_result_compactor.py b/reme/memory/file_based/components/tool_result_compactor.py index d80b2f61..a4268887 100644 --- a/reme/memory/file_based/components/tool_result_compactor.py +++ b/reme/memory/file_based/components/tool_result_compactor.py @@ -108,6 +108,13 @@ class ToolResultCompactor(BaseOp): and ".md" in (block.get("raw_input") or "").lower() ): md_file_tool_ids.add(tool_id) + + + if ( + block.get("name", "").lower() == "chat_with_agent" + ): + md_file_tool_ids.add(tool_id) + except Exception as e: logger.warning("Failed to detect md file tool ids: %s", e) logger.info(f"md_file_tool_ids: {md_file_tool_ids}")