-
Notifications
You must be signed in to change notification settings - Fork 16
Gate skills behind RLM_ENABLED_TOOLS (default: edit) #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,14 +39,32 @@ def _normalize_skill_name(name: str) -> str: | |
| return name.replace("-", "_") | ||
|
|
||
|
|
||
| DEFAULT_ENABLED_TOOLS = "edit" | ||
|
|
||
|
|
||
| def _parse_enabled_tools() -> frozenset[str] | None: | ||
| """Parse RLM_ENABLED_TOOLS into an allowlist of skill names. | ||
|
|
||
| Returns None when the env var is ``*`` (allow every discovered skill). | ||
| Empty string disables every skill. Unset defaults to ``edit``. | ||
| """ | ||
| raw = os.environ.get("RLM_ENABLED_TOOLS", DEFAULT_ENABLED_TOOLS).strip() | ||
| if raw == "*": | ||
| return None | ||
| return frozenset(name.strip() for name in raw.split(",") if name.strip()) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Enabled tools not normalized, breaking hyphenated skill matchingLow Severity
Additional Locations (1)Reviewed by Cursor Bugbot for commit d4b7209. Configure here. |
||
|
|
||
|
|
||
| def get_installed_skills() -> list[str]: | ||
| """Return installed skill names discovered from distribution metadata.""" | ||
| """Return installed skill names, filtered by RLM_ENABLED_TOOLS.""" | ||
| skills: set[str] = set() | ||
| prefix = "rlm-skill-" | ||
| for dist in metadata.distributions(): | ||
| name = dist.metadata.get("Name", "") | ||
| if name.startswith(prefix): | ||
| skills.add(_normalize_skill_name(name[len(prefix) :])) | ||
| enabled = _parse_enabled_tools() | ||
| if enabled is not None: | ||
| skills &= enabled | ||
| return sorted(skills) | ||
|
|
||
|
|
||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated default diverges from named constant
Low Severity
tools.pyintroduces aDEFAULT_ENABLED_TOOLSconstant to centralize the default, but the duplicated_parse_enabled_tools()inkernel_shim.pyhardcodes the string"edit"directly. If someone updatesDEFAULT_ENABLED_TOOLS, the kernel shim's default silently diverges, causing the system prompt and kernel to disagree on which skills are enabled.Additional Locations (1)
src/rlm/tools.py#L41-L42Reviewed by Cursor Bugbot for commit d4b7209. Configure here.