Skip to content

fix: respect enabled: true as force-enable in shouldIncludeSkill#1109

Open
BingqingLyu wants to merge 2 commits intomainfrom
fork-pr-50978-fix-skills-enabled-override
Open

fix: respect enabled: true as force-enable in shouldIncludeSkill#1109
BingqingLyu wants to merge 2 commits intomainfrom
fork-pr-50978-fix-skills-enabled-override

Conversation

@BingqingLyu
Copy link
Copy Markdown
Owner

@BingqingLyu BingqingLyu commented Apr 27, 2026

Summary

  • enabled: false force-disables a skill, but enabled: true does not force-enable — it still checks requires.bins, OS restrictions, etc.
  • This creates an asymmetry: users cannot override runtime eligibility checks to force-include a skill they know works in their environment.
  • Fix: when enabled: true, skip evaluateRuntimeEligibility and return true. The isBundledSkillAllowed check still runs first, so allowBundled restrictions are respected.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

User-visible / Behavior Changes

Setting skills.entries.<key>.enabled: true in config now guarantees the skill is included, regardless of whether required binaries are installed or OS restrictions would normally exclude it.

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No (skill was already available, just gated by runtime check)
  • Data access scope changed? No

Repro + Verification

Steps

  1. Configure a skill that requires a binary not present on the system (e.g., requires: { bins: ["nonexistent"] })
  2. Set skills.entries.<skill-name>.enabled: true in config
  3. Check if the skill is included

Expected

  • Skill is included (force-enabled).

Actual

  • Before: Skill is excluded because evaluateRuntimeEligibility fails on the missing binary.
  • After: Skill is included because enabled: true bypasses runtime eligibility.

Evidence

  • Failing test/log before + passing after

New test file src/agents/skills/config.test.ts with 4 test cases covering force-disable, force-enable, fallthrough, and allowBundled interaction.

Human Verification (required)

  • Verified scenarios: Tested on a fork with a skill requiring a missing binary. enabled: true correctly force-enables, enabled: false correctly force-disables.
  • Edge cases checked: allowBundled restrictions are still respected even when enabled: true.
  • What you did not verify: Not every skill entry combination, but the logic is straightforward (3-line change with early return).

Compatibility / Migration

  • Backward compatible? Yes — enabled: undefined (default) behavior is unchanged.
  • Config/env changes? No new config keys.
  • Migration needed? No.

Failure Recovery (if this breaks)

  • How to disable/revert: Revert the 3-line change in config.ts.
  • Known bad symptoms: A skill that should be excluded by runtime checks appearing in the agent's skill list.

Risks and Mitigations

  • Risk: User force-enables a skill whose required binary is truly missing, leading to runtime errors.
    • Mitigation: This is an explicit opt-in (enabled: true). The user is taking responsibility for ensuring the skill works.

✍️ Author: Claude Code with @carrotRakko (AI-written, human-approved)

When a skill has `enabled: true` in config, bypass `evaluateRuntimeEligibility`
(which checks requires.bins, OS, etc.) so the skill is always included.
This makes `enabled: true` symmetric with `enabled: false` (force-disable).

The check runs after `isBundledSkillAllowed` so allowBundled restrictions
are still respected.

✍️ Author: Claude Code with @carrotRakko (AI-written, human-approved)
- Add comment explaining why enabled: true is checked after
  isBundledSkillAllowed (Greptile review feedback).
- Sync skills-status.ts eligibility with force-enable: when
  enabled: true, mark the skill as eligible in status reporting
  so CLI output matches runtime behavior (Codex review feedback).

✍️ Author: Claude Code with @carrotRakko (AI-written, human-approved)
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.

[Bug]: skills.entries.<key>.enabled: true does not override requires.bins check

2 participants