WeKnora/internal/agent/tools
wizardchen d199628701 fix(agent): exclude wiki-only KBs from quick-answer (RAG) mode
Quick-answer agent mode retrieves purely through vector/keyword chunk
search and ships with no `allowed_tools`, so the existing capability
filter (which only reads from `allowed_tools`) let wiki-only KBs through
in every entry point. End result: users could @-mention, select, and
receive suggested questions from wiki-only KBs in quick-answer mode,
but the underlying retrieval always returned empty.

Treat "RAG-only" as an implicit property of `agent_mode = quick-answer`
and union it with the tool-derived filter. The same predicate is now
used everywhere the user can pick or be steered toward a KB:

Backend
- `tools.DeriveKBFilterForAgent` / `KBSatisfiesAgentRequirements`
  layer the implicit quick-answer requirement on top of tool derivation.
- `ListKnowledgeBases`, `SearchKnowledge` (shared-agent `@file`),
  `resolveKnowledgeBasesFromAgent` (chat runtime), `/search` IM command,
  and `GetSuggestedQuestions` now all use the agent-mode-aware variant.
- `GetSuggestedQuestions` also skips the wiki-page fallback for
  quick-answer agents to cover the `selected` / explicit-kb-ids paths
  where a wiki-only KB could still slip through.

Frontend
- `deriveKbFilterForAgent` / `kbSatisfiesAgentRequirements` mirror the
  Go helpers.
- `@` mention dropdown (`Input-field.vue`) uses the new helper.
- Agent editor's "specified KB" picker (`AgentEditorModal.vue`) grays
  out wiki-only KBs for quick-answer agents with a tooltip, and the
  pre-save warning fires for quick-answer mode too.
- i18n: add `agentEditor.agentType.kbMismatch.quickAnswer` across all
  four locales.
2026-05-12 16:27:28 +08:00
..
capabilities.go fix(agent): exclude wiki-only KBs from quick-answer (RAG) mode 2026-05-12 16:27:28 +08:00
data_analysis.go fix(data-analysis): capture LOCAL_STORAGE_BASE_DIR at init time (#1040) 2026-05-06 11:19:56 +08:00
data_analysis_duckdb_test.go
…
data_analysis_materialize_test.go
…
data_analysis_test.go feat: data_analysis sql validation & type processing 2026-04-28 23:47:34 +08:00
data_schema.go
…
database_query.go
…
definitions.go
…
exec_context.go fix(agent): 加固 MCP 工具人审批的跨实例与并发语义 2026-05-10 22:57:12 +08:00
final_answer.go
…
final_answer_test.go
…
get_document_info.go
…
grep_chunks.go
…
json_repair.go
…
json_repair_test.go
…
knowledge_search.go
…
list_knowledge_chunks.go
…
mcp_tool.go fix(agent): 加固 MCP 工具人审批的跨实例与并发语义 2026-05-10 22:57:12 +08:00
mcp_tool_image_test.go
…
mcp_tool_test.go
…
normalize_id.go
…
normalize_id_test.go
…
param_cast.go
…
param_cast_test.go
…
param_validate.go
…
param_validate_test.go
…
query_knowledge_graph.go fix(agent): correct graph config reporting 2026-05-06 11:04:55 +08:00
query_knowledge_graph_test.go test(agent): expand graph query regression fixture 2026-05-06 11:04:55 +08:00
registry.go
…
sanitize_messages.go
…
sanitize_messages_test.go
…
sequentialthinking.go
…
skill_execute.go
…
skill_read.go
…
strip_think.go
…
strip_think_test.go
…
todo_write.go
…
tool.go
…
truncate.go
…
truncate_test.go
…
web_fetch.go
…
web_search.go fix(web-search): normalize default tenant web search config at runtime 2026-04-30 15:28:35 +08:00
wiki_delete_page.go
…
wiki_flag_issue.go
…
wiki_index_overview_test.go perf(wiki): move ingest log to event table and index to on-demand API 2026-05-08 21:48:52 +08:00
wiki_read_issue.go
…
wiki_read_source_doc.go
…
wiki_rename_page.go
…
wiki_replace_text.go
…
wiki_tools.go perf(wiki): move ingest log to event table and index to on-demand API 2026-05-08 21:48:52 +08:00
wiki_tools_test.go
…
wiki_update_issue.go
…
wiki_write_page.go
…