From 38a98d46db21313df9f7dc0e7c51e11c6322b61c Mon Sep 17 00:00:00 2001 From: Adit Tanu Date: Fri, 6 Feb 2026 16:28:20 +0700 Subject: [PATCH] fix: address CodeRabbit review feedback - Fix parseFrontmatter to return consistent {frontmatter} key (was {data}) - Replace yaml.dump with yaml.stringify for yaml v2 compatibility - Add tasks and tools to setup() return value - Use stringifyFrontmatter for safe YAML generation in launcher - Update manager.js comment to include opencode.js --- tools/cli/installers/lib/ide/manager.js | 2 +- tools/cli/installers/lib/ide/opencode.js | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/tools/cli/installers/lib/ide/manager.js b/tools/cli/installers/lib/ide/manager.js index dc31f4b0f..88f3b66cf 100644 --- a/tools/cli/installers/lib/ide/manager.js +++ b/tools/cli/installers/lib/ide/manager.js @@ -44,7 +44,7 @@ class IdeManager { /** * Dynamically load all IDE handlers - * 1. Load custom installer files first (codex.js, kilo.js, kiro-cli.js) + * 1. Load custom installer files first (codex.js, kilo.js, kiro-cli.js, opencode.js) * 2. Load config-driven handlers from platform-codes.yaml */ async loadHandlers() { diff --git a/tools/cli/installers/lib/ide/opencode.js b/tools/cli/installers/lib/ide/opencode.js index cf5e8eec4..f92963754 100644 --- a/tools/cli/installers/lib/ide/opencode.js +++ b/tools/cli/installers/lib/ide/opencode.js @@ -82,6 +82,8 @@ class OpenCodeSetup extends BaseIdeSetup { agents: agentCount, workflows: workflowCommandCount, workflowCounts, + tasks, + tools, }; } @@ -145,7 +147,7 @@ class OpenCodeSetup extends BaseIdeSetup { parseFrontmatter(content) { const match = content.match(/^---\s*\n([\s\S]*?)\n---\s*\n?/); if (!match) { - return { data: {}, body: content }; + return { frontmatter: {}, body: content }; } const body = content.slice(match[0].length); @@ -162,10 +164,9 @@ class OpenCodeSetup extends BaseIdeSetup { stringifyFrontmatter(frontmatter) { const yamlText = yaml - .dump(frontmatter, { + .stringify(frontmatter, { indent: 2, lineWidth: -1, - noRefs: true, sortKeys: false, }) .trimEnd(); @@ -225,11 +226,12 @@ class OpenCodeSetup extends BaseIdeSetup { await this.ensureDir(agentsDir); - const launcherContent = `--- -name: '${agentName}' -description: '${metadata.title || agentName} agent' -mode: 'primary' ---- + const launcherFrontmatter = { + name: agentName, + description: `${metadata.title || agentName} agent`, + mode: 'primary', + }; + const launcherContent = `${this.stringifyFrontmatter(launcherFrontmatter)} You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.