⚙️ FEATURE-#34: Add a way to force skills re-scan (--skills-refresh) - #35
Conversation
FernandoCelmer
left a comment
There was a problem hiding this comment.
🔍 Code Review
Code issues found: 1
| # | Severity | Comment |
|---|---|---|
| 1 | [Blocking] | Stale flag on failed startConnection paths |
FernandoCelmer
left a comment
There was a problem hiding this comment.
[Suggestion]
Problem — pendingSkillsRefresh is set in reloadSkills() but only cleared inside ensureClient(). If startConnection() exits early (no provider configured, CLI not installed), the flag persists indefinitely and silently fires --skills-refresh on the next unrelated reconnect.
Failure scenario — User clicks "Reload Skills" before configuring a provider. The flag is set. Later, they configure the provider and start a normal session. The first reconnect sends --skills-refresh unexpectedly, potentially invalidating a warm skill cache without user intent.
Fix — Also clear the flag in the early-return paths of startConnection(), or reset it unconditionally at the top of startConnection():
async startConnection(): Promise<void> {
this.pendingSkillsRefresh = false; // always reset at start
// ... rest of method
}
Description
src/core-client/process-args.ts— Adds optionalskillsRefreshtoServeArgsOptions, pushes--skills-refreshwhen set.src/features/chat/chat.controller.ts— AddsreloadSkills(): sets a one-shotpendingSkillsRefreshflag and reloads.ensureClient()reads and clears the flag when buildingserveargs, so the refresh only applies to that one reconnect (not persisted likeskills/delegation/memory).src/vscode/webview/messages.ts/chatSidebarProvider.ts— AddsreloadSkillsmessage, routed toChatController.reloadSkills().src/vscode/webview/html.ts/media/dom.js/media/menu.js/eslint.config.mjs— Adds a "Reload Skills" menu item next to "Reload Connection".Motivation and Context
pycodeloop serve --skills-refreshforces a re-scan of skill sources (.claude/skills,.cursor/rules,AGENTS.md, etc.) instead of using the cached list — verified wired end-to-end in the CLI (cli/serve.py→Config(skills_refresh=...)→core/config.py). The plugin never passed it, so after editing a skill file there was no way to pick it up short of reloading the whole extension host.Closes #34.
Types of changes
Checklist