Commit Graph

464 Commits

Author SHA1 Message Date
matevip
e5dff7acb1 fix(acp): detect keychain OAuth hijack on claude-code 'Request not allowed' 2026-05-01 20:15:01 +08:00
matevip
3d0797787b fix(agent): align skill tool whitelist with real @Tool method names + restore globally-promised tools 2026-05-01 20:14:56 +08:00
matevip
888200e1cd feat(acp): visual env editor with per-endpoint key suggestions 2026-05-01 20:14:49 +08:00
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
matevip
f8ec223bcb refactor(ui): migrate remaining ElMessageBox.confirm calls to mcConfirm 2026-05-01 10:58:21 +08:00
matevip
8ce7e7d26d feat(ui): agent integration of SkillIcon + SkillIconPicker 2026-05-01 10:58:15 +08:00
matevip
efb91796fb feat(skill): pixelarticons icon library + picker component 2026-05-01 09:52:12 +08:00
matevip
9c6b728704 feat(ui): MateClaw skill detail drawer + shared McPagination / McConfirm components 2026-05-01 09:52:04 +08:00
matevip
f8069b1b5d fix(skill): /skills/counts includes virtual MCP rows in MCP and All badges 2026-05-01 09:51:58 +08:00
matevip
9b9d0c8006 refactor(skill): trim Skills page — slim card + single status pill + drawer-owned Security 2026-05-01 09:51:52 +08:00
matevip
0db5767ec1 feat(skill): add coding-helper template to balance the gallery 2026-05-01 09:51:46 +08:00
matevip
9ff15bc9a7 fix(activity): mobile adaptation + fix blank detail drawer 2026-05-01 09:51:39 +08:00
matevip
895b96a840 fix(activity): pagination blank — coerce total to Number + drop redundant hide-on-single-page 2026-05-01 09:51:33 +08:00
matevip
71e75d0e83 fix(activity): blank pagination items — drop overzealous pagination style overrides 2026-05-01 09:51:26 +08:00
matevip
191eebca95 fix(activity): align initial pageSize with page-sizes options (30→20) 2026-05-01 09:51:20 +08:00
matevip
a3f25d9b03 fix(activity): hide pagination when result fits in one page 2026-05-01 09:51:14 +08:00
matevip
7dd70ecd2f feat(activity): real pagination + frosted-glass styling 2026-05-01 09:51:07 +08:00
matevip
c46beaea9c fix(activity): style cleanup 2026-05-01 09:51:00 +08:00
matevip
b321d5792e fix: address review comments (4 items) 2026-05-01 09:50:53 +08:00
matevip
b759eb8719 feat(skill): MCP-Skill bridge + system tool dedup + Lessons i18n 2026-05-01 09:50:45 +08:00
matevip
18c5c00797 feat(activity): redesign Activity page (taste pass) 2026-05-01 09:50:39 +08:00
matevip
f8524bf122 fix(skill): blank Tools / Features / Memory detail tabs 2026-05-01 09:50:32 +08:00
matevip
d76a5b994f feat(skill): Memory tab + auto-preflight after install 2026-05-01 09:50:25 +08:00
matevip
0b6d9faaf3 feat(skill): type=acp delegates to ACP endpoint 2026-05-01 09:50:18 +08:00
matevip
b8ce36f6cd feat(activity): three-source merged feed + detail drawer 2026-05-01 09:50:11 +08:00
matevip
170cb1f2f2 feat(skill): pre-flight install dialog + [Set Up] action 2026-05-01 09:50:04 +08:00
matevip
29a8b841d4 feat(skill): expand starter template gallery to 8 entries 2026-05-01 09:49:57 +08:00
matevip
e74f273ae2 feat(skill): card surface — Source / Used-by / Lessons count 2026-05-01 09:49:51 +08:00
matevip
442ffa9c9e fix(skill): clean separation of install / uninstall / hard-delete 2026-05-01 09:49:44 +08:00
matevip
7ca568c69b fix(skill): knowledge wrappers + provider routing + feature gates 2026-05-01 09:49:37 +08:00
matevip
38b66a2416 fix(cron): dedup scheduled jobs + connection pool guard (issue #50) 2026-05-01 09:49:30 +08:00
matevip
020a87ee7e feat(skill): ACP integration for external coding agents 2026-05-01 09:49:22 +08:00
matevip
f0991f543f feat(skill): skill template gallery + author wizard MVP 2026-05-01 09:49:14 +08:00
matevip
359600c77f feat(skill): per-skill LESSONS.md + self-evolution v1 2026-05-01 09:49:07 +08:00
matevip
d927521d51 feat(skill): install/uninstall split + Requirements API + provider router 2026-05-01 09:48:59 +08:00
matevip
91e231e7a5 feat(activity): promote Activity to top-level navigation 2026-05-01 09:48:53 +08:00
matevip
169a09506b feat(skill): detail drawer + Agent Tool Advanced fold 2026-05-01 09:48:46 +08:00
matevip
688b37b652 feat(skill): features matrix + effective-tool expansion 2026-05-01 09:48:39 +08:00
matevip
323ba1b82e feat(skill): manifest schema + parser (additive) 2026-05-01 09:48:32 +08:00
matevip
95144ef175 feat(skill): demote Tools to Settings + rename MCP Connections 2026-05-01 09:39:52 +08:00
matevip
4f3276b9e6 fix(skill): mark docs-only vs scripts+docs in Available Skills prompt (issue #49) 2026-04-30 18:04:11 +08:00
matevip
46ac58500c fix(skill): correct pagination total and sort order on SkillMarket (issue #48) 2026-04-30 17:45:02 +08:00
matevip
a0c6ed5a86 fix(agent): vision gate + history media drop + friendlier skip notice 2026-04-30 17:26:13 +08:00
matevip
47bdb97a3a fix(agent): per-model multimodal capability resolution (issue #44) 2026-04-30 17:25:51 +08:00
matevip
101aa3209e fix(skill): stop the LLM from calling skill names as tools (issue #46)
When a user-installed skill (e.g. RedisOps) was bound to an agent, the
model frequently called the skill name directly as a tool, hit
"Tool not found: RedisOps", and either gave up or fell back to shell
guessing. Two compounding causes:

1. The system prompt block injected by SkillRuntimeService listed each
   skill as `- **RedisOps** — desc`, which is the same format used for
   tool catalogs and primed the model to call the names directly. The
   "how to use" instructions referenced `read_skill_file` /
   `run_skill_script` — names that don't exist in the tool registry,
   so even a compliant LLM couldn't follow them.

2. ToolExecutionExecutor's `callback == null` branches returned a bare
   "Tool not found: <name>" string. The model had no recovery signal
   and no hint that the name it called was actually a skill.

Fix is two-layered:

- Prompt rewrite (SkillRuntimeService.buildSkillPromptEnhancement): lead
  with an explicit warning that skills are NOT directly callable, use the
  correct camelCase tool names (readSkillFile / runSkillScript), include
  a concrete worked example anchored to the first enabled skill, and
  render the listing as a markdown table so it stops looking like a
  callable tool list. listAvailableSkills tool description and output
  follow the same pattern.

- Runtime safety net (ToolExecutionExecutor): when toolCallbackMap.get
  misses, check if the requested name (case-insensitive) matches an
  active skill. If so, return a precise hint telling the LLM the right
  invocation pattern instead of the bare error. Wired through both the
  main execute path and the pre-approved replay path. SkillRuntimeService
  is attached via a setter from AgentGraphBuilder so the executor's many
  legacy constructors stay untouched, and it's nullable so isolated
  tests still work.

Adds 5 unit tests covering: skill match -> hint, case-insensitive match,
no-match -> bare error, no SkillRuntimeService wired -> bare error,
pre-approved replay path -> hint.

Reported and reproduced by @pipima9950-glitch in issue #46.
2026-04-30 16:36:30 +08:00
matevip
d20b440ce5 fix(skill): preserve skillContent/configJson on security scan write-back (issue #45)
SkillPackageResolver.persistScanOutcome built a fresh SkillEntity with only
id + scan fields, then called updateById. SkillEntity declares six columns
with @TableField(updateStrategy = FieldStrategy.ALWAYS) — name_zh, name_en,
config_json, source_code, skill_content, security_scan_result — so the
ALWAYS strategy emits UPDATE statements that write NULL to every one of
those columns not set on the partial entity.

Effect: every security re-scan that produced a status/findings change
silently wiped skill_content, config_json, source_code, name_zh, name_en
on the row. After importing a custom skill, the first scan tick destroyed
the imported content.

Fix: switch to LambdaUpdateWrapper so the UPDATE only touches the three
scan columns we actually want to change. Other skillMapper.updateById
call sites (SkillService, BuiltinSkillSeedService) pass DB-hydrated
existing entities and are unaffected.

Reported and diagnosed by @pipima9950-glitch in issue #45.
2026-04-30 15:28:56 +08:00
matevip
977e181949 feat(cron): unify output, add reminder task type, in-flight progress UI
Three layers landed together because they share the same routing /
lifecycle plumbing:

1. Cron output unification
   - New CronConversationResolver routes web-origin jobs to the per-workspace
     tasks_<wsId> conversation; IM-bound jobs go to the channel session
     conversation when one exists (matched by senderId then targetId);
     legacy cron_<id> remains as the fallback.
   - CronJobLifecycleService inserts a system-role header divider when a
     run starts so users browsing the unified tasks_<wsId> view can tell
     which job started a run. BaseAgent.sanitizeForLlm filters these
     headers so they never reach the model.
   - WorkspaceService seeds tasks_<wsId> on workspace creation; V65
     migration backfills existing workspaces.
   - DeliveryConfig gains a userId field so IM session lookup can match
     by senderId (replyToken-based targetId is not stable across runs).
   - ConversationVO recognizes tasks_/cron_ underscore prefix as cron
     source. MessageList renders the system header as a labeled divider.
   - ChatConsole pins tasks_* conversations and tracks per-conversation
     read state so new cron output gets a visible unread dot.

2. Reminder task type
   - New task_type='reminder' in CronJobEntity + service validation.
   - CronJobRunner short-circuits 'reminder' jobs: hands trigger_message
     to finishRunAndPublish verbatim, no LLM call. Fixes a regression
     where reminders were rephrased into echoed wrappers.
   - New create_reminder tool alongside create_cron_job, with descriptions
     tightened so the model picks the right one (verbatim push vs LLM
     query that needs computation).
   - CronJobs.vue gets a third radio option + dedicated reminder field.

3. In-flight progress placeholder
   - Cron uses non-streaming chat()/execute(); tool-heavy ReAct loops
     can run 1-5 minutes between start and finish with no visible
     state, looking hung.
   - New GET /api/v1/cron-jobs/active-runs returns runs in status=running
     for a conversation. ChatConsole polls it on the existing 4s tick
     (and on conversation switch) and shows a spinner bar with elapsed
     time. When run count drops to zero, it refetches messages so the
     assistant bubble appears within ~1s of finish.
2026-04-30 15:01:24 +08:00
matevip
5192cefa4b chore: bump spring boot 3.5.13 -> 3.5.14, spring ai 1.1.4 -> 1.1.5 2026-04-30 10:47:00 +08:00
matevip
efbc858868 fix(skill): align ClawHub client with actual marketplace API (issue #42) 2026-04-30 10:25:21 +08:00
matevip
b40cbfb0a1 fix(tool): clean up EXTERNAL_CDP profile dir + Chrome subprocesses on session stop 2026-04-30 10:25:00 +08:00