mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-09-13 11:13:43 +08:00
Issue #304. Operators who want an agent with NO knowledge base had no way to express it: leaving the KB picker empty fell through to "inherit workspace-wide" (every KB visible), so the agent ended up ingesting every KB's context. This adds the same opt-out toggle that skills_disabled (V126) / tools_disabled already provide. Backend: - V154 migration (h2 + mysql + kingbase): mate_agent.wiki_disabled BOOLEAN/TINYINT/SMALLINT NOT NULL DEFAULT FALSE. Legacy agents stay bit-identical. - AgentEntity.wikiDisabled: Boolean field, @TableField("wiki_disabled"). - AgentBindingService.getBoundKbIds: short-circuit at the top — wiki_disabled=true returns Set.of() regardless of binding rows. Mirrors the precedence contract of getBoundSkillIds vs skills_disabled. - AgentBindingService.setKbBindings: a non-empty save auto-clears a stale wiki_disabled flag (same contract as setSkillBindings / setToolBindings on their respective flags). Empty saves leave the flag untouched — the UI toggle owns the bit, not the binding writer. - AgentBindingServiceWikiDisabledTest: 5 cases covering all three return states + the stale-flag auto-clear + empty-save no-op. Frontend: - Agents.vue KB picker: add the "此智能体不使用任何知识库" / "This agent uses no knowledge bases" toggle, mirroring the skills / tools picker layout. Tab badge shows "Off" when the toggle is on. - types/index.ts: add Agent.wikiDisabled?: boolean. - Save logic: when wikiDisabled is on, send an empty KB list (the setKbs contract then leaves the flag alone server-side, exactly as setSkills / setTools behave for their opt-out flags). - i18n (zh + en): new strings for toggle label, hint, badge, and the scope description shown when the toggle is on. Stacked on top of #382 (which introduced AgentBindingResolver .getBoundKbIds). No agent-runtime changes — wiki tools already degrade cleanly when getBoundKbIds returns Set.of(). |
||
|---|---|---|
| .. | ||
| public | ||
| src | ||
| test | ||
| .npmrc | ||
| index.html | ||
| package-lock.json | ||
| package.json | ||
| pnpm-lock.yaml | ||
| TEST_CASES.md | ||
| tsconfig.json | ||
| vite.config.ts | ||
| vitest.config.ts | ||
| yarn.lock | ||