Skip to content

fix: preserve skill mentions for custom agents - #76

Closed
1-WEEK wants to merge 1 commit into
LodyAI:mainfrom
1-WEEK:fix/custom-agent-skill-mentions
Closed

fix: preserve skill mentions for custom agents#76
1-WEEK wants to merge 1 commit into
LodyAI:mainfrom
1-WEEK:fix/custom-agent-skill-mentions

Conversation

@1-WEEK

@1-WEEK 1-WEEK commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Author type

  • I am an Agent (check this if an LLM agent authored this PR)
  • I am a human

Problem / pressure

Custom command configurations receive generated custom-<uuid> agent types that are not registered in ACP_SKILL_DIRS_BY_AGENT_TYPE. The skill mention source converted that missing mapping into an empty Set, which is truthy and therefore filtered every scanned $ skill candidate out of the menu.

Summary

  • Return null from getAllowedSkillMentionDirs when the selected agent type is not registered, preserving the existing meaning of null as no whitelist restriction.
  • Keep registered agents on the existing directory aggregation path, including explicit empty mappings such as deepagents.
  • Add regression coverage for custom and unknown agents, known directory mappings, explicit empty mappings, and candidate preservation.
  • Document the registered-versus-unregistered whitelist contract near the mention source.

Before / after

Before After
Custom and unknown agents received a truthy empty whitelist, so all scanned skill candidates were removed. Custom and unknown agents have no whitelist restriction and retain all scanned candidates.
Registered empty mappings and missing mappings were indistinguishable. Registered empty mappings remain explicit empty whitelists while missing mappings return null.

Test plan

  • Red regression run on the pre-fix implementation: @lody/components suite reported the three new assertions failing while 2,735 existing tests passed.
  • corepack pnpm --filter @lody/components exec vitest run tests/mention-skill-source.test.ts — 23 tests passed.
  • corepack pnpm --filter @lody/components test — 382 files and 2,738 tests passed.
  • corepack pnpm --filter @lody/components typecheck — passed.
  • corepack pnpm exec oxlint --quiet packages/components/src/components/mentions/mention-skill-source.tsx packages/components/tests/mention-skill-source.test.ts — no warnings or errors.
  • Prettier check and git diff --check — passed.

Agent handoff

Instructions for reviewing agents

  • Review focus: Check the registered-agent membership guard in mention-skill-source.tsx and the custom/known/explicit-empty cases in mention-skill-source.test.ts.
  • Decisions to challenge: Confirm that null correctly means no mention-directory restriction for unregistered agents while a registered empty mapping remains restrictive.
  • Plausible failures / evidence gaps: The pure selector and full component suite were exercised, but the packaged Electron UI was not launched for an interactive $ menu smoke test.

Authoring context

  • User goal / directives: Fix empty $ skill candidates for custom commands, add focused tests, commit the change, fork the repository, and open an upstream pull request.
  • Constraints / non-goals: Keep the change in the mention source, import the shared agent directory registry, preserve known-agent and explicit-empty semantics, and avoid redundant fallback logic or unrelated refactoring.
  • Risk-bearing decisions: Unregistered agent types may use every skill already scanned by Lody instead of being constrained by a provider directory whitelist.
  • Destructive or irreversible behavior: None; the change only affects candidate filtering and documentation.
  • Deliberately not done or tested: No packaged Electron build or interactive UI smoke test was run because the behavior is covered at the pure selection boundary and by the complete component suite.
  • Unknowns / confidence: High confidence in the filtering fix; residual risk is limited to integration behavior outside the tested component paths.

Sharing consent (author side)

  • Author-side user explicitly allowed publishing the Authoring context above
  • Author-side user explicitly declined publishing Authoring context and understands that maintainers may decline or close the contribution; keep every field as N/A / redacted

Unknown agent types previously collapsed missing directory mappings into a truthy empty Set, so the candidate filter removed every scanned skill. Return null before aggregation when the agent type is unregistered, while retaining explicit empty mappings for known agents.

Model: gpt-5.6-sol
@github-actions github-actions Bot added scope: components status:needs-pr-body PR body does not meet the contribution template labels Aug 27, 2026
@github-actions

Copy link
Copy Markdown

@1-WEEK, this pull request body does not match Lody's PR template.

This PR is marked status:needs-pr-body. Update the description and satisfy every required section by 2026-09-04 15:28:06 UTC. The label and this comment are removed automatically after the body passes validation.

If the body remains invalid for 7 days, this PR will be closed and marked status:pr-body-expired. To contribute after that, open a new pull request using the current template.

Every external PR must link a Lody issue and provide a complete public Context handoff with concise, PR-specific review instructions. N/A and redacted context are not accepted because maintainers need enough provenance, scope, and risk information to assess the contribution.

Checker findings
PR body does not match the Lody pull request template:

- Missing required heading: ## Related issue
- Missing required heading: ## Context handoff
- Context handoff must keep <!-- context-handoff:begin/end --> markers.

See `.github/PULL_REQUEST_TEMPLATE.md`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: components status:needs-pr-body PR body does not meet the contribution template

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant