Repository navigation
feat(tools): per-tool descriptor and skill-use tracking for every tool (#1221) - #1245
Conversation
bcd522d to
7d9c987
Compare
The PR description supplies sufficient built-CLI/e2e evidence. No testing-record finding; nothing from the PR was run, built, or installed. |
7d9c987 to
5832f54
Compare
|
No new findings in the scoped diff. Earlier findings are resolved:
The PR description documents sufficient built-CLI/e2e verification. No testing-record finding; deferred provider/agent coverage is not blocking. Nothing from the PR was run, built, or installed. |
…nce (Tencent#1221) TOOLS records each built-in tool's home directory and how its agent loads a skill (dedicated skill tool, prompt mention, or 'unknown'), with an evidence class per value. ToolId is derived from DEFAULT_TOOL_PATHS, so a new built-in tool fails tsc until it has a descriptor. KNOWN_AGENTS user skills paths for pi, omp and opencode now match their user-scope defaults; home detection and the init picker read home.dir so Pi detection does not move. Tests pin the tool lists to ToolId, every user-scope path under its home, and skillLoad to the tools that receive the wildcard post-tool-use hook.
Tencent#1221) One background skill-use handler on the wildcard post-tool-use pass credits a skill when the call is the tool's skill tool (TOOLS[tool].skillLoad) or a read of an installed skill's SKILL.md (classifyToolCall, shell reads with ~/ and $HOME/ included). Prompt-submit credits /name at the start, Codex $name, and the block Pi expands /skill:name into. Each skill counts once per session turn and only when installed under a root skill delivery uses. Removes the per-tool Skill hook, SKILL_TOOL_MATCHER, and the OpenCode matcher passes; OpenCode sends raw tool names, with a one-release Skill alias. A team that disabled the retired built-in key keeps tool-call tracking off.
5832f54 to
90c1b35
Compare
|
No new findings in the scoped diff. Earlier findings are resolved:
The PR description documents sufficient built-CLI/e2e verification. Deferred provider/agent coverage is not blocking. Nothing from the PR was run, built, or installed. |
Summary
Step A1 of #1221: one typed descriptor per tool, and skill usage recorded the same way for every tool.
flowchart LR subgraph callers ["callers"] hooks["hook-dispatch<br/>post-tool-use '*', prompt-submit"]:::added init["init<br/>home detection"]:::added pull["pull, uninstall, doctor,<br/>models switch, local agent"] test["matrix test"]:::todo end subgraph core ["src/tools.ts"] desc["TOOLS<br/>home, skillLoad"]:::added rest["channels, support"]:::todo locate["locate(tool, resource, install, host)"]:::todo end use["skill-use<br/>skill tool, SKILL.md read, mention<br/>installed only, once per turn"]:::added host{{"Host"}}:::todo page["docs/guide/tool-support.md"]:::todo old["per-tool Skill hook,<br/>SKILL_TOOL_MATCHER"]:::removed res["per-tool resolvers"] hooks --> use --> desc init --> desc pull & test -.-> locate locate -.-> desc locate -.-> rest & host rest -.-> page pull --> res hooks -.-> old classDef added fill:#2f8f4f,stroke:#1f6b39,color:#fff; classDef todo fill:#5c6670,stroke:#3d454c,color:#fff,stroke-dasharray:4 3; classDef removed fill:#a33a3a,stroke:#7a2a2a,color:#fff,stroke-dasharray:4 3;Green: this PR. Gray: later steps of #1221 (A2 Host and
locate, then B1-B4, C, E, D). Red: removed.SKILL.md(shell reads included), or the prompt names it:/name, Codex$name, Pi/skill:name. Once per turn, installed skills only.Skillis still accepted for one release.Hook dispatch post-tool-use Skillkeeps tracking off.Type of Change
Evidence
Before: on
main, the Codex, Pi, Copilot, OMP, dsh and OpenCode 2.x payloads captured for #1221 record no skill use.After: the built CLI at
90c1b356, isolatedHOME, user scope,teamai hook-dispatch ... --stdin:Earlier payloads from real runs (Pi
/skill:x, stale--matcher Skillhook, invalid team hook or builtin block, retired key,hooks.yamlsyntax error) are covered byskill-use.test.tsandhooks-skill-retire.test.ts.Test Plan
npx tsc --noEmitpassesnpm run lintpassesnpx vitest runpasses (11459 passed, 21 skipped)skill-use.test.ts,hooks-skill-retire.test.ts,tools.test.tsnpm run build, then the fullnpm run test:e2e: 1394 passed, 27 skipped, 2 failed. The 2 are the typed-terminal Ctrl-C cases inworkflow-signals.test.ts; they fail the same way onmain(c6bd1264) on this machine, and pass in main's CI.gitlabandgithubproviders.Merge Danger
Door: two-way. Reverting restores the Skill hook on the next pull.
Blast Radius: usage counts.
/nameonly at the start.hooks.jsontrust keys are positional, so removing the Skill entry re-trusts the later entries on pull.Related Issues
Part of #1221.