Skip to content

Conversation

Copy link

Copilot AI commented Jan 16, 2026

The saveConfig() calls in enablePlugin and disablePlugin were only writing enabledPlugins and lastUsed, dropping any other fields that might exist in the config.

Changes:

  • Spread existing config object before overriding fields in both functions
  • Handle null config in enablePlugin with ...(config ?? {})
// Before
await saveConfig({
  enabledPlugins: [...enabledPlugins, pluginName],
  lastUsed: new Date().toISOString(),
});

// After
await saveConfig({
  ...(config ?? {}),
  enabledPlugins: [...enabledPlugins, pluginName],
  lastUsed: new Date().toISOString(),
});

This ensures forward compatibility if additional config fields are added.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: scaryrawr <661373+scaryrawr@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issues based on feedback for plugin/marketplace commands Preserve all config fields when updating plugin state Jan 16, 2026
Copilot AI requested a review from scaryrawr January 16, 2026 01:30
@scaryrawr scaryrawr marked this pull request as ready for review January 16, 2026 01:34
@scaryrawr scaryrawr merged commit b69fa25 into plugin-commands Jan 16, 2026
1 check passed
@scaryrawr scaryrawr deleted the copilot/sub-pr-4 branch January 16, 2026 01:34
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.

2 participants