fix(config): skip permission migration for Claude Code agents
Claude Code uses whitelist-based tools format which is semantically different from OpenCode's denylist-based permission system. Apply migration only to plugin agents for compatibility. 🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) assistance
This commit is contained in:
@@ -96,26 +96,18 @@ export function createConfigHandler(deps: ConfigHandlerDeps) {
|
|||||||
config.model as string | undefined
|
config.model as string | undefined
|
||||||
);
|
);
|
||||||
|
|
||||||
const rawUserAgents = (pluginConfig.claude_code?.agents ?? true)
|
// Claude Code agents: Do NOT apply permission migration
|
||||||
|
// Claude Code uses whitelist-based tools format which is semantically different
|
||||||
|
// from OpenCode's denylist-based permission system
|
||||||
|
const userAgents = (pluginConfig.claude_code?.agents ?? true)
|
||||||
? loadUserAgents()
|
? loadUserAgents()
|
||||||
: {};
|
: {};
|
||||||
const rawProjectAgents = (pluginConfig.claude_code?.agents ?? true)
|
const projectAgents = (pluginConfig.claude_code?.agents ?? true)
|
||||||
? loadProjectAgents()
|
? loadProjectAgents()
|
||||||
: {};
|
: {};
|
||||||
const rawPluginAgents = pluginComponents.agents;
|
|
||||||
|
|
||||||
const userAgents = Object.fromEntries(
|
// Plugin agents: Apply permission migration for compatibility
|
||||||
Object.entries(rawUserAgents).map(([k, v]) => [
|
const rawPluginAgents = pluginComponents.agents;
|
||||||
k,
|
|
||||||
v ? migrateAgentConfig(v as Record<string, unknown>) : v,
|
|
||||||
])
|
|
||||||
);
|
|
||||||
const projectAgents = Object.fromEntries(
|
|
||||||
Object.entries(rawProjectAgents).map(([k, v]) => [
|
|
||||||
k,
|
|
||||||
v ? migrateAgentConfig(v as Record<string, unknown>) : v,
|
|
||||||
])
|
|
||||||
);
|
|
||||||
const pluginAgents = Object.fromEntries(
|
const pluginAgents = Object.fromEntries(
|
||||||
Object.entries(rawPluginAgents).map(([k, v]) => [
|
Object.entries(rawPluginAgents).map(([k, v]) => [
|
||||||
k,
|
k,
|
||||||
|
|||||||
Reference in New Issue
Block a user