Skip to content

fix: drop the trigger word for an Agent that cannot read the Skill - #2

Merged
Vieeeeeee merged 1 commit into
mainfrom
fix/phantom-triggers
Aug 27, 2026
Merged

Vieeeeeee merged 1 commit into
mainfrom
fix/phantom-triggers

Conversation

@Vieeeeeee

Copy link
Copy Markdown
Owner

浏览器端逐个走查写操作时抓到的:面板会显示一个根本用不了的触发词。

复现

  1. 在面板里卸载 bravo
  2. 从回收站恢复它(弹窗明确说了「各 Agent 的软链不会一起回来」)
  3. 表格里 bravo 这一行显示 /bravo (Claude·Gemini)

但磁盘上 .claude/skills/bravo 和 .gemini/config/skills/bravo 都不存在,registry 自己也如实记着 agents = {claude:false, gemini:false, codex:true}。用户照着面板敲 /bravo,什么都不会发生。

unlink 是更常见的触发路径:skillhub unlink charlie claude 之后,agents.claude=false 但 triggers.claude="/charlie" 照旧。

根因

registry.mjs 里 triggers 只按「Agent 是否可见」和 agentOnly 特例过滤,没问「这个 Agent 到底读不读得到」。而那条原则代码注释里已经写了:

An Agent that cannot read the Skill has no trigger word for it. Listing one told the user to type a command that does nothing.

只是当时只用在了 agentOnly 一个分支上。

改法

改用上面几行刚算好的 agents 映射来过滤——它本来就是「链接存在,或该 Agent 原生扫描 SSOT」的答案。这一改同时覆盖 unlink 和回收站恢复,并且把 agentOnly 那个特例吸收掉了(agentOnly 的 skill 本来就只有那一个 agent 为 true)。

净效果是删掉一个特例,不是加一个分支。

验证

  • npm test 98/98 通过(含新增的回归断言:抽掉链接后触发词消失、原生 Agent 的触发词保留)
  • 真实面板复跑:charlie / bravo / alpha 三种状态下幽灵触发词均为 0

⚠️ CI 可能跑不起来:GitHub Actions 目前是 major_outage。本地 98/98 已通过。

🤖 Generated with Claude Code

The dashboard listed "/bravo (Claude·Gemini)" for a Skill neither Agent could
load. Restoring from the trash puts the Skill back without its links — the
modal says so — and `unlink` removes one link on purpose. Both left the trigger
column advertising a command that does nothing.

registry.mjs already had the rule written down, and applied it only to the
agent-only case. The `agents` map computed a few lines above is the real answer
to "can this Agent reach it": the link exists, or the Agent scans the SSOT
natively. Asking that map covers unlink and restore as well, and subsumes the
agent-only special case.

Found by walking the dashboard by hand: uninstall bravo, restore it from the
trash, then read what the table claims against what is on disk.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Vieeeeeee
Vieeeeeee merged commit f21b570 into main Aug 27, 2026
0 of 9 checks passed
@Vieeeeeee
Vieeeeeee deleted the fix/phantom-triggers branch August 27, 2026 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant