mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-09-13 03:13:41 +08:00
fix(skill): /skills/counts includes virtual MCP rows in MCP and All badges
This commit is contained in:
parent
9b9d0c8006
commit
f8069b1b5d
@ -99,7 +99,20 @@ public class SkillController {
|
||||
@Operation(summary = "获取各类型技能计数(tab 徽章用)")
|
||||
@GetMapping("/counts")
|
||||
public R<Map<String, Long>> counts() {
|
||||
return R.ok(skillService.countByType());
|
||||
Map<String, Long> result = skillService.countByType();
|
||||
// RFC-090 §3.2 — virtual MCP-derived skills aren't in mate_skill,
|
||||
// so countByType() misses them. Fold in the live count so the
|
||||
// "MCP" and "all" tab badges match what the list endpoint shows.
|
||||
try {
|
||||
long virtualMcp = mcpSkillBridge.listMcpDerivedSkillEntities().size();
|
||||
if (virtualMcp > 0) {
|
||||
result.merge("mcp", virtualMcp, Long::sum);
|
||||
result.merge("all", virtualMcp, Long::sum);
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
// Bridge failure must not break the badge fetch.
|
||||
}
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
@Operation(summary = "重新扫描单个技能(RFC-042 §2.3.4)")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user