qwen_agent/agent
2026-01-18 12:29:20 +08:00
..
__init__.py 新增agent文件夹,修改import引用,增加custom_mcp_manager 2025-11-26 17:23:02 +08:00
agent_config.py merge 2026-01-08 23:10:09 +08:00
agent_memory_cache.py 修改balance资源配置 2025-12-23 23:11:24 +08:00
chat_history_manager.py 添加聊天记录查询 2026-01-18 12:29:20 +08:00
checkpoint_manager.py 添加聊天记录查询 2026-01-18 12:29:20 +08:00
checkpoint_utils.py warm_up 2025-12-18 00:38:04 +08:00
config_cache.py 修改general_agent提示词 2025-12-03 17:53:18 +08:00
deep_assistant.py deep_agent支持 checkpoint 2026-01-11 00:08:19 +08:00
guideline_middleware.py guildline messages 2025-12-17 23:32:50 +08:00
logging_handler.py add agent/tool_use_cleanup_middleware.py 2025-12-23 12:04:26 +08:00
prompt_loader.py refactor: simplify path displays and remove sensitive config data 2025-12-31 20:30:44 +08:00
tool_output_length_middleware.py add MCP_HTTP_TIMEOUT and try catch 2025-12-23 20:13:46 +08:00
tool_use_cleanup_middleware.py 修复完成。主要改动: 1. 新增 _clean_content_blocks 方法:专门处理 content 字段的清理 - 当 content 是列表格式时,过滤掉 type: 'tool_use' 的块(如果 id 不在 valid_tool_call_ids 中) - 返回清理后的 content 和是否有文本内容的标志 2. 更新 _cleanup_tool_use_messages 方法: - 调用 _clean_content_blocks 来清理 content - 使用清理后的 cleaned_content 创建新的 AIMessage 问题根源:之前的代码只清空了 tool_calls=[],但没有从 content 列表中移除 type: 'tool_use' 的块。Anthropic API 会检查这两个地方,导致报错。 2025-12-23 19:11:27 +08:00