Skip to content

Commit c5bf24a

Browse files
committed
fix(claude-plugin): sync current provider config to settings.json on toggle enable
When enableClaudePluginIntegration is turned on, determine the actual provider type instead of hardcoding official: false, and call syncCurrentProvidersLiveSafe to write full config to ~/.claude/settings.json. This fixes the issue where first-time users enable the toggle but the VS Code extension cannot connect due to an empty settings.json.
1 parent de49f6f commit c5bf24a

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/hooks/useSettings.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,19 @@ export function useSettings(): UseSettingsResult {
321321
) {
322322
try {
323323
if (payload.enableClaudePluginIntegration) {
324-
await settingsApi.applyClaudePluginConfig({ official: false });
324+
// Determine the actual provider type instead of hardcoding official: false
325+
const currentId = await providersApi.getCurrent("claude");
326+
let isOfficial = false;
327+
if (currentId) {
328+
const allProviders = await providersApi.getAll("claude");
329+
isOfficial = allProviders[currentId]?.category === "official";
330+
}
331+
await settingsApi.applyClaudePluginConfig({
332+
official: isOfficial,
333+
});
334+
335+
// Sync current provider's full config to ~/.claude/settings.json
336+
await syncCurrentProvidersLiveSafe();
325337
} else {
326338
await settingsApi.applyClaudePluginConfig({ official: true });
327339
}

0 commit comments

Comments
 (0)