Skip to content

⚙️ FEATURE-#34: Add a way to force skills re-scan (--skills-refresh) - #35

Merged
FernandoCelmer merged 9 commits into
masterfrom
feature/34
Aug 16, 2026
Merged

⚙️ FEATURE-#34: Add a way to force skills re-scan (--skills-refresh)#35
FernandoCelmer merged 9 commits into
masterfrom
feature/34

Conversation

@FernandoCelmer

Copy link
Copy Markdown
Member

Description

  • src/core-client/process-args.ts — Adds optional skillsRefresh to ServeArgsOptions, pushes --skills-refresh when set.
  • src/features/chat/chat.controller.ts — Adds reloadSkills(): sets a one-shot pendingSkillsRefresh flag and reloads. ensureClient() reads and clears the flag when building serve args, so the refresh only applies to that one reconnect (not persisted like skills/delegation/memory).
  • src/vscode/webview/messages.ts / chatSidebarProvider.ts — Adds reloadSkills message, routed to ChatController.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-refresh forces 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.pyConfig(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

  • New feature (change which adds functionality)
  • Bug fix
  • Documentation

Checklist

  • I have performed a self-review of my own code
  • I have added tests that prove my feature works
  • I have updated the CHANGELOG
  • I have updated the documentation accordingly

@FernandoCelmer FernandoCelmer left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

placeholder

Comment thread src/features/chat/chat.controller.ts

@FernandoCelmer FernandoCelmer left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🔍 Code Review

Code issues found: 1

# Severity Comment
1 [Blocking] Stale flag on failed startConnection paths

@FernandoCelmer FernandoCelmer added the enhancement New feature or request label Aug 16, 2026

@FernandoCelmer FernandoCelmer left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

[Suggestion]

ProblempendingSkillsRefresh 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
}

@FernandoCelmer
FernandoCelmer merged commit 6a4d1e3 into master Aug 16, 2026
2 checks passed
@FernandoCelmer
FernandoCelmer deleted the feature/34 branch August 16, 2026 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a way to force skills re-scan (--skills-refresh)

1 participant