From 034294492443878264c6c8aa77b1e4ef5b0732a7 Mon Sep 17 00:00:00 2001 From: zhing2006 <382601573@qq.com> Date: Sun, 25 Jan 2026 10:29:22 +0800 Subject: [PATCH] fix: correct regex trailing whitespace and add missing projectRoot param - Add \s* to parseTasksFile regex to handle trailing whitespace in task lines - Add missing projectRoot argument to resolveSchema call in generateApplyInstructions Co-Authored-By: Claude Opus 4.5 --- src/commands/workflow/instructions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/workflow/instructions.ts b/src/commands/workflow/instructions.ts index 5add248b..f2d343e0 100644 --- a/src/commands/workflow/instructions.ts +++ b/src/commands/workflow/instructions.ts @@ -221,7 +221,7 @@ function parseTasksFile(content: string): TaskItem[] { for (const line of lines) { // Match checkbox patterns: - [ ] or - [x] or - [X] - const checkboxMatch = line.match(/^[-*]\s*\[([ xX])\]\s*(.+)$/); + const checkboxMatch = line.match(/^[-*]\s*\[([ xX])\]\s*(.+)\s*$/); if (checkboxMatch) { taskIndex++; const done = checkboxMatch[1].toLowerCase() === 'x'; @@ -314,7 +314,7 @@ export async function generateApplyInstructions( const changeDir = path.join(projectRoot, 'openspec', 'changes', changeName); // Get the full schema to access the apply phase configuration - const schema = resolveSchema(context.schemaName); + const schema = resolveSchema(context.schemaName, projectRoot); const applyConfig = schema.apply; // Determine required artifacts and tracking file from schema