mateclaw/mateclaw-ui
matevip 64b8e167d5 fix(mcp): refresh agent cache on MCP connection change + non-blocking connect (#289)
Closes #289 — after an MCP server (re)connects, chat queries kept replying
"from memory" instead of calling MCP tools.

Root cause: agents snapshot their tool set at build time and are cached in
AgentService.agentInstances, but MCP server lifecycle changes never
invalidated that cache (unlike model-config / tool-guard changes which do).
A stale, tool-less agent graph survived until process restart.

Changes:
- Add McpServerChangedEvent; McpServerService publishes it on connect /
  disconnect / reconnect / delete / (re)connect-failure / batch refresh /
  startup init. AgentService listens and calls refreshAllAgents(), so the
  next turn rebuilds against the live MCP tool set. Also closes the boot
  race where the web server accepts requests before the @Order(200) MCP
  init runner finishes.
- Make create/update/toggle connect asynchronously on a dedicated pool
  ("mcp-connect") so a slow/unreachable server can no longer freeze the
  admin request; status returns immediately as "connecting".
- UI: render the new "connecting" status (pulsing amber dot), show a
  friendly "connecting in background" toast, and poll until the status
  settles (window widened to ~40s to outlast the default connect timeout).
- UI: MCP config modal no longer closes on outside/backdrop click — only
  the × and Cancel buttons close it, so an accidental click can't discard
  unsaved config.

Verified E2E: ckjia-shopping (参考价) MCP server connected at runtime with
no backend restart; the cached 通用助手 agent immediately enabled and called
ckjia_shopping_recommend, returning real product cards.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 14:14:08 +08:00
..
public feat(ui): add the xAI (Grok) provider brand icon 2026-05-18 10:01:05 +08:00
src fix(mcp): refresh agent cache on MCP connection change + non-blocking connect (#289) 2026-06-09 14:14:08 +08:00
test feat(ui): add agent binding search (#106) 2026-05-12 18:18:39 +08:00
.npmrc fix(ui-build): invoke node directly with heap flag + .npmrc fallback for workers 2026-05-10 21:17:09 +08:00
index.html feat(ui): design system upgrade — responsive layout, collapsible panels, and unified tokens 2026-04-10 18:14:23 +08:00
package-lock.json Initial commit: MateClaw — Java + Vue 3 AI Assistant System 2026-04-04 19:03:49 +08:00
package.json chore: bump version to 1.6.0-SNAPSHOT 2026-06-06 20:50:40 +08:00
pnpm-lock.yaml feat(wiki): slug-first wikilink resolution and safe DOM postprocess 2026-05-28 08:16:56 +08:00
TEST_CASES.md fix(deploy): drop DASHSCOPE_API_KEY requirement so Docker boots with no LLM key configured (#99) 2026-05-11 20:44:31 +08:00
tsconfig.json Initial commit: MateClaw — Java + Vue 3 AI Assistant System 2026-04-04 19:03:49 +08:00
vite.config.ts fix(ui): pre-bundle echarts subpaths to stop dev-server 504 re-optimization 2026-05-17 21:15:15 +08:00
vitest.config.ts feat(wiki): slug-first wikilink resolution and safe DOM postprocess 2026-05-28 08:16:56 +08:00
yarn.lock Initial commit: MateClaw — Java + Vue 3 AI Assistant System 2026-04-04 19:03:49 +08:00