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
This commit is contained in:
jinli.yl 2026-04-17 11:48:00 +08:00
parent 935e886af3
commit 3cfa8328b5

View file

@ -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}")