Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
isInternalStructuredSession,
noteStructuredOutputStep,
rememberSessionModel,
setConnectedProviders,
STRUCTURED_OUTPUT_AGENT,
STRUCTURED_OUTPUT_MAX_STEPS,
STRUCTURED_OUTPUT_TOOLS,
Expand Down Expand Up @@ -435,6 +436,14 @@ export const OpenCodeMemPlugin: Plugin = async (ctx: PluginInput) => {
}
} catch (error) {
log("Failed to refresh opencode provider state", { error: String(error) });
// The host provider directory may be unavailable (e.g. a plugin context
// without `ctx.provider`). Keep the explicitly configured provider
// connected so structured-output calls are attempted instead of being
// denied by the connectivity gate; a bad provider id still fails loudly
// on the call itself and falls back to the external API.
if (CONFIG.opencodeProvider) {
setConnectedProviders([CONFIG.opencodeProvider]);
}
}
};

Expand Down
Loading