mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-03 10:20:30 +08:00
tools[] heads the provider prompt-cache key, so a tool that one turn mounts and the next drops re-bills the whole history on both turns. Three gates were still read off a single turn: - has_kb: detaching the knowledge base removed rag / kb_files / knowledge_frontier. They now stay mounted once seen (outside exclusive capabilities); while no KB is attached, dispatch passes an empty _attached_kb_names and the tools refuse every kb_name, so this never reaches a detached KB. - has_book_authoring: a turn without a single referenced book page dropped propose_book_edit. It stays; the tool already refuses without a page. - has_scientific_research where nothing can be deferred (a partner whitelist without load_tools): the message regex mounted the research tools for one message only. Once mounted they stay. Also, the setup capability's message/intro heuristic no longer activates on a partner turn (which can write nothing and is already not offered the deferred setup tools); with a whitelist lacking load_tools it mounted the setup tools and a system block on a fresh install's first message and dropped them next. Adds tools_gated_by() to tool_composition so the sticky checks name gated tools from the single _CONDITIONAL_MOUNT_FLAGS table. Refs #3183