From 7634080da37355a6f5d028be7abdec7590b9d3ae Mon Sep 17 00:00:00 2001 From: Daniel Eder Date: Thu, 23 Apr 2026 07:44:29 +0200 Subject: [PATCH] feat: allow overwriting the openspec-plan agent configuration in opencode.json Previously the default agent configuration would overwrite config applied by opencode.json. Now the two configs are merged. --- src/config.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/config.ts b/src/config.ts index 4c66f67..4638eca 100644 --- a/src/config.ts +++ b/src/config.ts @@ -86,7 +86,11 @@ export function createConfigHook(ctx: { directory: string }): Hooks["config"] { // 3. Inject into configuration const agentConfig = (config.agent || {}) as any; - agentConfig["openspec-plan"] = openSpecAgent; + // Merge the existing user config on top of the default openSpecAgent + agentConfig["openspec-plan"] = { + ...openSpecAgent, + ...(agentConfig["openspec-plan"] || {}) + }; config.agent = agentConfig; }; }