Repository navigation
Description
What happened? / 发生了什么?
On a fresh home, the Main Bot (Chief) that onboarding creates after dsh web has started does not get the tree's team-building tools (create_team, create_child_bot, and with them the other gated tree tools). Asking Chief to build a team does nothing: the model never sees the tools, so it just answers in text. After restarting the web server for that home (nothing else changed), the same Chief Session has the tools and create_team / create_child_bot work at once.
Evidence from the mock model's request log (core/dev/mock-llm.mjs logs a hash of the tool list per request; a local demo scenario calls create_team for "组队 …" and create_child_bot for "加子 …" only when the tool is in the list):
- Home C, Chief Session
session-c045…: Chief created 10:49:27 (UTC+8). Requests at 10:49:32 (组队 研发: Backend: 后端工程师; Frontend: 前端工程师) and 10:49:38 (加子 QA: 测试) carry tool-list hash378cb52c60a4and fall through to the generic reply收到:组队 研发: …/收到:加子 QA: 测试— i.e. neither tool was offered. Still the same at 10:51:03 and 10:51:31. dsh webfor that home restarted at 10:52:02 (UTC+8). The next request in the same Session at 10:52:11 carries hasha4bdb388c0a0and callscreate_team→ the team appears in the tree.- Home D reproduced the same: Chief's first request at 11:00:27 (UTC+8) has
378cb52c60a4; after a web restart at 11:00:35 its next request (11:00:46) hasa4bdb388c0a0andcreate_team/create_child_botwork.
Expected: a Main Bot created while the server is running gets the tree tools (and every other tool its role allows) from its first turn, with no restart.
Likely cause (code reading, origin/main 645a291 — hypothesis, not yet confirmed with a test)
- The tree tools are gated by
visibleTo: inTree=tree.isMember(botId)(plugins/tree/src/tools.js:63-70), which is true only once the Bot hastreeRole/parentfields (plugins/tree/src/tree.js:207). Chief gets them whenadoptChief()runs (tree.js:109-125), triggered fromplugins/tree/index.js:57-63(startup timers 0/1/5/15 s andfb.onBotCreated). - The host turns
visibleTointo a per-Agent deny mask inhidePluginTools(core/src/host/hooks.js:743-762). It is recomputed only onagent/created(hooks.js:764) and when FlyBot itself resolves an Agent for Bot-to-Bot delivery (core/src/host/delivery.js:63-67,rt.flybotHideTools). - So if Chief's Agent is created before the tree has adopted it (onboarding creates the Bot and its Session at once), the mask denies the tree tools, and nothing recomputes it when the tree later sets Chief's fields or when the user chats with Chief directly through DSH. A restart re-runs
agent/createdwith Chief already in the tree, which matches the log above.
Not verified: whether core Main-only tools (e.g. group creation) were also missing; the log only proves the tree tools.
Change scope (suggested)
Recompute the plugin-tool mask when a Bot's tree membership/role changes (e.g. on the tree's field change for treeRole/parent, or on every Agent resolve, not only delivery), so a newly adopted Chief gets the tools on its next turn. Add a test: create the Main Bot after startup, resolve its Agent before adoption, then adopt — the next turn's tools must include create_team and create_child_bot.
Screenshot / 截图
None useful (the symptom is a missing tool call). Evidence is the mock request log on the recording box: /workspace/slides/flybot-intro-834wrk/run/home-c/mock.jsonl and run/home-d/mock.jsonl (fields t, session, tools, out).
Steps to reproduce / 复现步骤
- Start
dsh webon a fresh home (no Bots yet) with the FlyBot core and@flybot/tree. - Finish onboarding so Chief is created while the server runs.
- Ask Chief to create a team or a child Bot (e.g. "建一个研发小组:Backend 和 Frontend"). With the mock, inspect the tool list of the request: no
create_team/create_child_bot. - Restart
dsh webfor that home, send the same message in the same chat: the tools are there and work.
Diagnostics / 诊断信息
FlyBot main @ 4f6a53d (these code paths unchanged on 645a291), @deepseek-ai/dsh 0.2.0-rc.2 (dsh web), @flybot/tree linked from the checkout, mock model core/dev/mock-llm.mjs (with a local, uncommitted demo-scenario patch that only maps "组队"/"加子" to the tools when they are offered). Found while recording demos, not by the self-test routine.
Privacy / 隐私
- This report has no API keys, tokens or personal data.
Activity
Birfy commentedon Oct 21, 2026
Triaged (maintenance round, 2026-10-21): reproducible from the mock-model tool-list hash — a Main Bot onboarding creates after
dsh webstarts keeps the older tool list (378cb52c60a4, nocreate_team/create_child_bot) and the same Session gets them after a restart (a4bdb388c0a0).Expected: a Bot created while the server runs sees every tool its role allows from its first turn, with no restart.
Scope: the tree tools' visibility gate (
visibleToupstream) and wherever the per-turn tool list is built/cached; I will pin the exact seam with a failing test before touching it.agent-ready— queued behind #593.Recompute plugin tool masks when a turn starts (ThinkFlowLab#598)