fix(acp): map pi, grok, and kimi to the skill dirs their engines scan - #218
Merged
Merged
Conversation
Astro-Han
force-pushed
the
fix/150-agents-skills-dirs
branch
3 times, most recently
from
August 31, 2026 10:24
a7c5b48 to
eea7f0e
Compare
pi loads ~/.agents/skills alongside ~/.pi/agent/skills, kimi's entry pointed at .kimi dirs its engine no longer scans, and grok and deepseek had no entry at all despite both being builtin agent types. A missing entry was worse than a missing dir: getAllowedSkillMentionDirs turned it into an empty but non-null whitelist, which filtered every $ candidate out. Return null there instead, keeping a registered empty mapping distinct from an unregistered agent type, and add a test so a builtin cannot go unregistered unnoticed. Closes LodyAI#150 Model: claude-opus-5
Astro-Han
force-pushed
the
fix/150-agents-skills-dirs
branch
from
August 31, 2026 10:30
eea7f0e to
ad7b7d4
Compare
wibus-wee
approved these changes
Sep 1, 2026
wibus-wee
left a comment
Member
There was a problem hiding this comment.
LGTM! Thanks for your contribution!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue
Closes #150
Problem / pressure
ACP_SKILL_DIRS_BY_AGENT_TYPEis a hand-maintained mirror of facts owned by each engine, and it had drifted from what the engines actually scan:packages/coding-agent/docs/skills.md, "Locations") scans~/.pi/agent/skillsand~/.agents/skills; the table listed only the first.MANAGED_BUILTIN_RUNTIMESmapsgrok-buildtoagentType: 'grok', but nogrokkey existed. Its skill roots come fromCompatConfig::skill_config_dirs()inxai-grok-tools/src/types/compat.rs, which returns[".grok", ".agents", ".claude", ".cursor"]under the all-onVendorCompat::default()(pinned by that file's ownskill_config_dirs_all_on_matches_legacy_constanttest), at every tier..kimi-code/skills+.agents/skillsper project and~/.kimi-code/skills+~/.agents/skillsglobally (packages/agent-core-v2/src/features/skill/catalog/skillRoots.ts). The table had.kimi/skillsand an empty global list..kimi/skillsis not in the engine's project tier at all, so it is stale rather than merely incomplete. (The documented first-launch migration copies the user dir~/.kimi/skills; the project dir was never migrated, it simply stopped being scanned.)BUILTIN_AGENTSmember.dsh-skill-filesystem— mounted by the standard and code presets (packages/acp-extension-dsh/presets/*/agent.cordis.yml) with no roots configured — discovers.dsh/skillsand.agents/skillsper project and~/.dsh/skillsand~/.agents/skillsper user (skill-filesystemconfig defaults:dshHome=$DSH_HOMEor~/.dsh,agentsHome=$DSH_AGENTS_HOMEor~/.agents).The grok symptom was worse than a missing row.
getAllowedSkillMentionDirsreturned an empty but non-nullSetfor an agent type absent from the table, andselectSkillMentionCandidatestreats non-null as "apply this whitelist" — so every scanned$skill was filtered out. A lookup miss meant "hide everything". The Skills panel, reading the same table viaannotateAndSortGroups, treats a miss as merely unannotated and hides nothing, so the two surfaces disagreed about the same miss. Customcustom-<uuid>agents hit this too.Nothing tied the table to the authoritative agent lists, so
grokanddeepseekcould go missing without any check noticing.Summary
grokanddeepseek, and alignpi/pi-acp/kimi/kimi-code/kimi-code-cliwith their engines' dirs.deepseektherefore gets the same treatment as the other three: it is a fourth agent that reads~/.agents/skillswhile Lody could not see it. (Theskills: enabled: falseinprofile.tsdisables the demo spine's own bundled wiring — alongsidetoolBash,goals, andpersona— because the host composition mounts the real skill registry and the presets mount the discovery and loader plugins.)null(no whitelist) fromgetAllowedSkillMentionDirsfor an unregistered agent type, via a newisRegisteredSkillAgentType. A registered entry that maps to nothing keeps its explicit empty whitelist — "reads no skills" and "we have no mapping" stay distinct.BUILTIN_AGENTStype is registered, so a new builtin cannot repeat this.KNOWN_SKILL_DIRS_VERSIONto 10 so cached scans re-fetch.This revives the
nullchange from #76 (closed unmerged understatus:needs-pr-body, not on technical grounds); #150 names that same mechanism.Before / after
$menu showed no skills for grok: an unregistered type produced an empty whitelist that filtered every candidate.~/.agents/skillswas invisible to pi, grok, and kimi although all three load it.~/.agents/skills..kimi/skillsand no global dir..kimi-code/skills,~/.kimi-code/skills, and~/.agents/skills.$menu was empty..dsh/skills,.agents/skills,~/.dsh/skills,~/.agents/skills.Test plan
pnpm --filter @lody/shared exec vitest run tests/acp-skills.test.ts— 22 passed.pnpm --filter @lody/components exec vitest run tests/mention-skill-source.test.ts— 22 passed.pnpm format, thenpnpm typecheck,pnpm lint,pnpm lint:i18n,pnpm check:code-collab-imports,pnpm check:platform-boundaries,pnpm check:public-boundary— all clean.packages/componentshas 19 test files / 72 tests failing on this branch, all pre-existing: the same 19/72 fail on an unmodified tree at the same base commit (use-chat-landing-defaults,vscode-diff-theme-registrationand similar jsdom teardown failures, none skill-related).mention-skill-source.tsxto the base revision makesreturns no whitelist for an unregistered agent type instead of an empty onefail while the other 21 cases pass, so that test fails on the old behavior through the production owner rather than a fixture..grok/skills,.kimi-code/skills,.cursor/skills,.dsh/skillsand loses.kimi/skills; global gains~/.grok/skills,~/.kimi-code/skills,~/.dsh/skills. Only.cursor/skillsis new to the shared scan set — the Claude dirs were already in it via theclaudeentry.kimi-code-clito no global dirs. It now usespromptscript, which keeps the same shape under test (project dirs, zero global dirs) rather than duplicating the adjacentclinecase.Context handoff
Instructions for reviewing agents
packages/shared/src/acp/skills.ts, and thenull-vs-empty whitelist change ingetAllowedSkillMentionDirs, which reaches every unregistered agent, not only grok..cursor/skillsto the shared project scan set. (2)deepseek's dirs hold for the standard and code presets;minimalmounts no skill plugin andcordisadds a packaged root, and this per-agent table cannot vary by preset. (3) [Bug] Skills panel and $ mention miss ~/.agents/skills for pi, grok, and kimi agents (stale per-agent skill-dir whitelist) #150 also proposed making.agents/skillsan unconditional baseline for every agent. Not done: it contradicts the invariant inmentions/AGENTS.mdthat the dir is "a provider-specific alias, not a universal fallback".KIMI_CODE_HOME, so the hardcoded~/.kimi-codemisses a relocated data root.Authoring context
$menu for unregistered agents (more candidates offered, never fewer); dropping.kimi/skills, which removes it from the shared project scan set so a project that still has one stops being surfaced, matching what the engine reads.extra_skill_dirsand built-in tiers are not modeled.nullcontract is already stated at the call site (null = show all). Lower confidence on whether the grok compat roots belong in the table given they are configurable.