Skip to content

revert(skills): --skills-dir supports multi-path append instead of override#1606

Open
tempurai wants to merge 1 commit intomainfrom
revert-1578-fix/skills-dir-multi-path
Open

revert(skills): --skills-dir supports multi-path append instead of override#1606
tempurai wants to merge 1 commit intomainfrom
revert-1578-fix/skills-dir-multi-path

Conversation

@tempurai
Copy link
Copy Markdown
Collaborator

@tempurai tempurai commented Mar 27, 2026

Reverts #1578


Open with Devin

Copilot AI review requested due to automatic review settings March 27, 2026 08:34
@tempurai tempurai changed the title Revert "feat(skills): --skills-dir supports multi-path append instead of override" revert(skills): --skills-dir supports multi-path append instead of override Mar 27, 2026
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reverts the earlier change that made --skills-dir support multiple paths appended to the default skills discovery chain, restoring the single-path override behavior across CLI, runtime wiring, and tests.

Changes:

  • Change --skills-dir back to a single directory and treat it as an override (skipping user/project discovery).
  • Update runtime wiring (KimiCLI/Runtime) and e2e helpers/tests to pass a single skills_dir.
  • Adjust skill discovery precedence so later roots override earlier ones, and update/remove tests accordingly.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests_e2e/wire_helpers.py Updates wire test harness to accept a single skills_dir and emit one --skills-dir flag.
tests_e2e/test_wire_skills_mcp.py Updates e2e tests to pass skills_dir (singular).
tests/core/test_skill.py Updates skill discovery/root-resolution tests to match override behavior and later-root precedence.
src/kimi_cli/soul/agent.py Threads skills_dir override into skill root resolution during runtime creation.
src/kimi_cli/skill/__init__.py Reverts root-resolution API to skills_dir_override and switches dedup semantics to later-root-wins.
src/kimi_cli/cli/__init__.py Reverts CLI option type to a single Path and maps it to a single KaosPath override.
src/kimi_cli/app.py Wires the skills_dir override through KimiCLI.create() into Runtime.create().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 91 to 95
Resolve layered skill roots in priority order.

Built-in skills load first when supported by the active KAOS backend,
followed by user/project discovery, then any extra directories supplied
via ``--skills-dir``, and finally plugin directories. Extra directories
are **appended** to the default discovery chain — they never replace
user or project skills.
Built-in skills load first when supported by the active KAOS backend. When an
override is provided, user/project discovery is skipped.
"""
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolve_skills_roots() says it returns roots "in priority order", but the effective precedence is determined by discover_skills_from_roots() (which now makes later roots override earlier ones). Please clarify this docstring to explicitly state that later roots take precedence when the same skill name exists in multiple roots, and how plugins/builtin fit into that ordering.

Copilot uses AI. Check for mistakes.
Comment on lines 279 to 283
file_okay=False,
dir_okay=True,
readable=True,
help="Additional skills directories (repeatable). Appended to default discovery.",
help="Path to the skills directory. Overrides discovery.",
),
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --skills-dir option is now a single Path and described as overriding discovery, but existing user docs/reference pages describe it as repeatable and appended. Please update the docs (and any CLI reference tables) to match this reverted behavior, or consider keeping it repeatable to avoid a user-visible breaking change.

Copilot uses AI. Check for mistakes.
dir_okay=True,
readable=True,
help="Additional skills directories (repeatable). Appended to default discovery.",
help="Path to the skills directory. Overrides discovery.",
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The help text says "Overrides discovery", but resolve_skills_roots() still includes built-in skills (when supported) and always appends the plugins directory even when an override is provided. Consider clarifying the option help (e.g., overrides user/project discovery only) to avoid confusing users.

Suggested change
help="Path to the skills directory. Overrides discovery.",
help=(
"Path to the skills directory. Overrides user/project discovery; "
"built-in and plugin skills may still be used."
),

Copilot uses AI. Check for mistakes.
yolo,
extra_skills_dirs=extra_skills_dirs,
)
runtime = await Runtime.create(config, oauth, llm, session, yolo, skills_dir)
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Runtime.create(...) is being called with skills_dir as a positional argument. Since this is an optional parameter and the function signature has recently changed, using a keyword argument here would be more robust against future signature edits and improves readability.

Suggested change
runtime = await Runtime.create(config, oauth, llm, session, yolo, skills_dir)
runtime = await Runtime.create(config, oauth, llm, session, yolo, skills_dir=skills_dir)

Copilot uses AI. Check for mistakes.
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