Repository navigation
Conversation
extendResources merged extension-provided skill/prompt/theme paths into the active lists without consulting noSkills / noPromptTemplates / noThemes. Plugin-declared resources therefore bypassed the flags on every session start: a plugin under ~/.stepcode/plugins/ that declares skills had its SKILL.md content injected into the system prompt even with --no-skills set, widening what a third-party plugin can put in front of the model. Drop the extension paths at the extendResources entry when the matching flag is set, so the flags' documented "disable discovery and loading" semantics cover the extension path too. Explicitly supplied CLI paths are unaffected: they are resolved in reload(), not through extendResources. Adds regression tests for all three flags plus a flags-off control.
li-xiu-qi
requested review from
MelodyVAR,
Uking-xxx,
ZouR-Ma and
liuedcson
as code owners
October 24, 2026 19:13
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.
Fixes #216
Problem
The
--no-skills,--no-prompt-templates, and--no-themesoptions disable their respective resource types during normal discovery, but extension-contributed paths enter through a second channel.AgentSessionpasses those paths toDefaultResourceLoader.extendResources(), which merges and loads them without checking any of the three flags.As a result, a plugin can still inject a
SKILL.mdinto the system prompt after the user explicitly requested--no-skills. The same bypass applies to extension-provided prompt templates and themes. On cleanmainat81e79bc, the production plugin-discovery reproduction produced[]afterreload()and["evil-skill"]afterextendResources()despitenoSkills: true.Changes
extendResources()admission point when the matching flag is set.reload()guards and the separate explicit-resource path unchanged. Explicitly suppliedadditionalSkillPaths,additionalPromptTemplatePaths, andadditionalThemePathsstill load under their corresponding--no-*flag.Behavior and compatibility
--no-skills,--no-prompt-templates, and--no-themesnow also cover resources contributed by plugins and other extensions during startup and reload.Validation
main(81e79bc) using the production plugin discovery function andDefaultResourceLoader:before: [],after: ["evil-skill"]withnoSkills: true.cd packages/coding-agent && pnpm exec vitest --run test/resource-loader-extension-flags.test.ts: 5/5 passed.cd packages/coding-agent && pnpm exec vitest --run test/resource-loader-extension-flags.test.ts test/resource-loader-no-skills.test.ts test/resource-loader.test.ts: 49/49 passed.DefaultResourceLoadercovered 122 tests: 121 passed, 1 failed. The failure is the Windows Git path-quoting assertion inskill-loading-regressions.test.ts(nested gitignore basename patterns must apply to all descendants in that scope); the same assertion fails on unmodifiedmain.npm run checkfrom the repository root: passed on Windows with Node v24.21.0.git diff --check upstream/main: passed. Public-content review found no private paths, credentials, AI attribution, debug residue, third-party reference attribution, or unrelated files.0fcc02c: run 40123588861 completed withconclusion: success; Build, Check, and Test all passed on Ubuntu.conclusion: success; Build, Check, and Test all passed on Ubuntu.Limitations
skill-loading-regressions.test.ts(nested gitignore basename patterns must apply to all descendants in that scope) remains outside this PR's scope. It fails identically on unmodifiedmainand is neither introduced nor fixed by this change.