mateclaw/mateclaw-server/src/main/java/vip/mate/agent
matevip 5e6764ecf1 fix(skill): tool-gate whitelist + markdown link host normalization
When an agent had any skill bound, the runtime tool gate was silently
hiding @Tool beans that aren't declared in any skill manifest, even
though the global system prompts (SOUL.md / "Web Search Capability" /
"File Reading Guidelines") explicitly tell the LLM these tools are
available. Result: the model would call search / renderDocx / read_file
/ etc., hit "Tool not found", then either give up or fall back to
unhelpful behaviour (e.g. dumping markdown text instead of producing a
.docx download).

This commit:

- Adds universally-promised, agent-wide tools to SYSTEM_LEVEL_TOOLS so
  they bypass the manifest restriction: document/media generation
  (renderDocx*, image_generate, music_generate, video_generate),
  global capability tools the system prompt mentions (search,
  browser_use, read_file / write_file / edit_file /
  execute_shell_command, detect_file_type, extract_*_text,
  readMateClawDoc), skill discovery siblings (listSkillFiles,
  listAvailableSkills), and the delegate triplet (delegateToAgent,
  delegateParallel, listAvailableAgents).

- Fixes 5 entries in the prior whitelist whose names did not match
  any real @Tool bean and were therefore silently dead:
    read_workspace_file   -> read_workspace_memory_file
    write_workspace_file  -> write_workspace_memory_file
    list_workspace_files  -> list_workspace_memory_files
    delegate_agent        -> delegateToAgent
    datetime              -> getCurrentDate / getCurrentDateTime / getCurrentTime
  Also adds the missing edit_workspace_memory_file.

- In the chat markdown renderer, strips any hallucinated
  https?://<host> prefix from /api/v1/files/generated/<id> download
  links before building the <a href>. Multiple LLMs have been
  observed prepending bogus hosts when echoing tool-returned download
  URLs back to the user, breaking the click. One-line defensive
  normalization independent of which model is in use.

Verified end-to-end on a previously-broken agent: search / browser_use
/ execute_shell_command / renderDocx all dispatch correctly now and
the final markdown link is a clean same-origin path. 36 whitelist
entries cross-checked against real @Tool method names.
AgentBindingServiceTest green.
2026-05-01 12:24:25 +08:00
..
binding fix(skill): tool-gate whitelist + markdown link host normalization 2026-05-01 12:24:25 +08:00
chatmodel fix(llm): apply read timeout to streaming chat WebClient (openai-compat + anthropic) 2026-04-30 08:54:46 +08:00
context feat(cron): channel delivery via ChatOrigin + Spring AI ToolContext 2026-04-28 21:43:58 +08:00
controller docs(readme): lead with team / IT-deployable positioning 2026-04-29 14:10:12 +08:00
graph fix(skill): stop the LLM from calling skill names as tools (issue #46) 2026-04-30 16:36:30 +08:00
model docs(readme): lead with team / IT-deployable positioning 2026-04-29 14:10:12 +08:00
prompt refactor(prompt): clean up prompt corpus, fix summary_budget bug, route fallbacks through i18n 2026-04-19 09:02:37 +08:00
repository Initial commit: MateClaw — Java + Vue 3 AI Assistant System 2026-04-04 19:03:49 +08:00
service docs(readme): lead with team / IT-deployable positioning 2026-04-29 14:10:12 +08:00
AgentGraphBuilder.java fix(skill): knowledge wrappers + provider routing + feature gates 2026-05-01 09:49:37 +08:00
AgentService.java feat(cron): channel delivery via ChatOrigin + Spring AI ToolContext 2026-04-28 21:43:58 +08:00
AgentState.java Initial commit: MateClaw — Java + Vue 3 AI Assistant System 2026-04-04 19:03:49 +08:00
AgentToolSet.java fix(agent): resolve agent tool bindings by class/bean/function name aliases (#24) 2026-04-27 23:51:48 +08:00
AssistantThinkingRelay.java test(agent): cover patchReasoningContent consumer 2026-04-24 18:16:12 +08:00
BaseAgent.java fix(agent): vision gate + history media drop + friendlier skip notice 2026-04-30 17:26:13 +08:00
GraphEventPublisher.java refactor(bootstrap): drop legacy tools-sync.sql in favor of per-tool Flyway migrations 2026-04-27 14:00:08 +08:00
StructuredStreamCapable.java Initial commit: MateClaw — Java + Vue 3 AI Assistant System 2026-04-04 19:03:49 +08:00
ThinkingLevelHolder.java feat(agent): add deep thinking toggle (RFC-001) 2026-04-12 11:29:32 +08:00