Skip to content

P2: BashTool 的 dedup_cache 是函数内 static — 跨实例/跨会话共享 #11

Description

@ULookup

问题

static std::unordered_map<std::string, std::pair<std::string, std::chrono::steady_clock::time_point>> dedup_cache;

所有 BashTool 实例共享同一个缓存,TTL 硬编码 60 秒。可能导致跨 Agent 实例获取到过期结果。

修复

  • 移到 ToolRegistry 中按 tool 实例管理,或改用实例成员

涉及文件

  • libs/tools/src/builtin_tools.cpp

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpriority/P2Nice to havesubsystem/toolsBuilt-in tools and registry

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions