fix: detect and warn about opencode-skills conflict
When opencode-skills plugin is registered alongside oh-my-openagent, all user skills are loaded twice, causing 'Duplicate tool names detected' warnings and HTTP 400 errors. This fix: 1. Detects if opencode-skills plugin is loaded in opencode.json 2. Emits a startup warning explaining the conflict 3. Suggests fixes: either remove opencode-skills or disable skills in oh-my-openagent Fixes #2881
This commit is contained in:
@@ -13,6 +13,7 @@ import { loadPluginConfig } from "./plugin-config"
|
||||
import { createModelCacheState } from "./plugin-state"
|
||||
import { createFirstMessageVariantGate } from "./shared/first-message-variant"
|
||||
import { injectServerAuthIntoClient, log, logLegacyPluginStartupWarning } from "./shared"
|
||||
import { detectExternalSkillPlugin, getSkillPluginConflictWarning } from "./shared/external-plugin-detector"
|
||||
import { startTmuxCheck } from "./tools"
|
||||
|
||||
let activePluginDispose: PluginDispose | null = null
|
||||
@@ -25,6 +26,12 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
||||
})
|
||||
logLegacyPluginStartupWarning()
|
||||
|
||||
// Detect conflicting skill plugins (e.g., opencode-skills)
|
||||
const skillPluginCheck = detectExternalSkillPlugin(ctx.directory)
|
||||
if (skillPluginCheck.detected && skillPluginCheck.pluginName) {
|
||||
console.warn(getSkillPluginConflictWarning(skillPluginCheck.pluginName))
|
||||
}
|
||||
|
||||
injectServerAuthIntoClient(ctx.client)
|
||||
startTmuxCheck()
|
||||
await activePluginDispose?.()
|
||||
|
||||
Reference in New Issue
Block a user