WeKnora/docs
Ochan Kwon 809bda7b2f
fix(agent): make agent tool selection match the tools the runtime registers (#4211)
The tools a smart-reasoning agent may use were defined in three places
that never checked each other: the agent editor's checkboxes, the stored
allowed_tools, and what registerTools registers. The editor drew from a
hard-coded list that had drifted (search_conversations, a default tool,
had no checkbox), hid stored entries outside that list, and could not
untick a tool whose knowledge base capability was missing. The save API
stored any name. And an empty list could not mean "no tools": three
places treated it as "use the default tools", so clearing every checkbox
gave an agent without a knowledge base search_conversations, while the
editor's preview said it had none.

One source for the tool list: GET /api/v1/agents/tools serves the tools
of AvailableToolDefinitions with their group, danger flag and knowledge
base requirement, the default tools, and the tools other agent settings
register whatever the list says. The editor renders from it, falling
back to the catalog's label for a tool it has no translation for.

Stored values stay visible: a missing capability only blocks ticking a
tool, and stored names the catalog does not offer are shown ticked in
their own section and can be removed.

An empty list now means no built-in tools; only a list that was never
set selects the defaults. tools.EffectiveAllowedTools makes that
decision for tool registration, the session config and the rerank
requirement. Migration 000116 (SQLite 000035) writes the default tools
into the empty list of every existing smart-reasoning agent, so they
keep the tools they ran with. The knowledge base filter follows the
stored list, so such an agent with an "all" scope now gets the same
scope as one that ticked the defaults: bases search_knowledge cannot use
leave it. The editor writes the defaults into an unset list it loads,
so saving does not silently turn the defaults into no tools.

Saving validates the list: retired names are rewritten, switch-managed
and retired skill tools are dropped, names the request adds that no
tool answers to are rejected with a 400 that lists them, and unknown
names already stored are kept so an existing agent can still be saved.
The response reports what was kept or dropped.
2026-10-13 11:29:24 +08:00
..
assets fix(ui): 优化知识库文档交互与对话布局 (#3420) 2026-09-19 11:58:49 +08:00
images feat(system): add platform user management and streamline settings (#4153) 2026-10-11 17:07:00 +08:00
poc/docker-sandbox docs: 迁移有效文档至 website-docs 并清理旧文档 (#3580) 2026-09-22 23:25:40 +08:00
LITE.md refactor(terminology): rename user-facing tenant labels to workspace 2026-07-14 16:14:43 +08:00
README.md docs: 迁移有效文档至 website-docs 并清理旧文档 (#3580) 2026-09-22 23:25:40 +08:00
docs.go fix(agent): make agent tool selection match the tools the runtime registers (#4211) 2026-10-13 11:29:24 +08:00
swagger.json fix(agent): make agent tool selection match the tools the runtime registers (#4211) 2026-10-13 11:29:24 +08:00
swagger.yaml fix(agent): make agent tool selection match the tools the runtime registers (#4211) 2026-10-13 11:29:24 +08:00
swagger_contract_test.go fix(wiki): resolve titles for unloaded backlinks (#3931) 2026-10-09 10:50:52 +08:00

README.md

文档已迁至 website-docs

产品、部署、API 和开发文档统一维护在 website-docs。已迁移、重复和过时的旧手写文档已删除;历史内容可从 Git 历史查看。

本目录仅保留以下工程资源及本入口说明:

  • docs.go、swagger.json、swagger.yaml 与契约测试:参与后端编译和测试,生成物仍由 make docs 更新。
  • LITE.md:Lite 发布包复制为离线 README。
  • images/、assets/:README、Helm 等仍使用的图片资源。
  • poc/docker-sandbox/:独立 Go 实验模块,保留源码和运行说明,不作为当前产品指南。

这些资源尚有编译、发布或历史实验用途,不能直接整目录删除。新的产品说明不要再放入此处。