Skip to content

fix(cli): remove duplicate skill catalog - #13210

Merged
marius-kilocode merged 3 commits into
mainfrom
fix-deduplicate-skill-catalog
Aug 18, 2026
Merged

fix(cli): remove duplicate skill catalog#13210
marius-kilocode merged 3 commits into
mainfrom
fix-deduplicate-skill-catalog

Conversation

@marius-kilocode

@marius-kilocode marius-kilocode commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

The skill catalog was being emitted twice in ordinary agent requests: once in the system prompt and again in the dynamically generated skill tool description. This repeated the same available-skill context on every request and increased prompt size without improving discoverability.

This change keeps the system-prompt catalog as the single effective catalog. The skill tool retains its static usage instructions and input schema, and invoking it still lazy-loads the complete skill body. The registry deletion is limited to the Kilo-specific dynamic description path, so permission filtering, project/global/builtin discovery, trusted skill handling, plugin definition hooks, and subagent behavior remain unchanged.

Historical provenance: the removed describeSkill block was introduced by commit bfcb911648d in PR #12204, the OpenCode v1.17.4 compatibility merge. That compatibility work added the concise skill inventory to the tool description, while the system-prompt catalog remained present. This PR removes only that later duplicate representation and preserves the surrounding upstream-compatible tool behavior.

Validation included 50 skill, registry, discovery, permission, built-in, trust, worktree, system-prompt, and lazy-loading tests, plus CLI typecheck, lint, formatting, changeset, promise-facade, and OpenCode annotation guards.

The generated /experimental/tool endpoint was measured before and after using deterministic JSON character counts. The endpoint continued to expose 17 tools, while total tool-definition JSON decreased from 41,583 to 35,706 characters. The skill description decreased from 6,247 to 399 characters, and its catalog-marker count changed from 1 to 0. A live backend check returned the same corrected 399-character static description and unchanged schema for both a normal worktree and an Agent Manager-managed worktree.

The persisted local session for this worktree also showed lower uncached model input after the fix. Comparing recorded step-finish data around the registry change, average uncached input fell from 7,268 to 2,502 tokens per step, a 65.6% reduction. Cache-read tokens naturally increased as the conversation grew, so they were not used as the prompt-size comparison.

@kilo-code-bot

kilo-code-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • .changeset/fix-duplicate-skill-catalog.md
  • packages/opencode/src/tool/registry.ts
  • packages/opencode/test/kilocode/skill-catalog.test.ts
  • packages/opencode/test/tool/skill.test.ts

Reviewed by grok-4.6 · Input: 53.3K · Output: 10K · Cached: 424.8K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit c90f5d6 into main Aug 18, 2026
32 checks passed
@marius-kilocode
marius-kilocode deleted the fix-deduplicate-skill-catalog branch August 18, 2026 15:13
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.

2 participants