From d994e0503b84a6b7d975a64d801148214a5cc57a Mon Sep 17 00:00:00 2001 From: Affaan Mustafa Date: Thu, 12 Mar 2026 15:46:50 -0700 Subject: [PATCH] test: fix cross-platform orchestration regressions --- tests/hooks/hooks.test.js | 14 ++++++++++++-- tests/lib/tmux-worktree-orchestrator.test.js | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/hooks/hooks.test.js b/tests/hooks/hooks.test.js index a9ca850b..a9d6315d 100644 --- a/tests/hooks/hooks.test.js +++ b/tests/hooks/hooks.test.js @@ -4570,10 +4570,20 @@ async function runTests() { const files = fs.readdirSync(sessionsDir).filter(f => f.endsWith('.tmp')); assert.ok(files.length > 0, 'Should create session file'); const content = fs.readFileSync(path.join(sessionsDir, files[0]), 'utf8'); + const summaryMatch = content.match( + /([\s\S]*?)/ + ); // The real string message should appear assert.ok(content.includes('Real user message'), 'Should include the string content user message'); - // Numeric/boolean/object content should NOT appear as text - assert.ok(!content.includes('42'), 'Numeric content should be skipped (else branch → empty string → filtered)'); + assert.ok(summaryMatch, 'Should include a generated summary block'); + const summaryBlock = summaryMatch[1]; + // Numeric/boolean/object content should NOT appear as task bullets + assert.ok( + !summaryBlock.includes('\n- 42\n'), + 'Numeric content should be skipped (else branch → empty string → filtered)' + ); + assert.ok(!summaryBlock.includes('\n- true\n'), 'Boolean content should be skipped'); + assert.ok(!summaryBlock.includes('[object Object]'), 'Object content should be skipped'); } finally { fs.rmSync(isoHome, { recursive: true, force: true }); } diff --git a/tests/lib/tmux-worktree-orchestrator.test.js b/tests/lib/tmux-worktree-orchestrator.test.js index e4ee3204..819850fa 100644 --- a/tests/lib/tmux-worktree-orchestrator.test.js +++ b/tests/lib/tmux-worktree-orchestrator.test.js @@ -161,9 +161,10 @@ test('buildOrchestrationPlan exposes shell-safe launcher aliases alongside raw d workers: [{ name: 'Docs Fixer', task: 'Update docs' }] }); const quote = value => `'${String(value).replace(/'/g, `'\\''`)}'`; + const resolvedRepoRoot = plan.workerPlans[0].repoRoot; assert.ok( - plan.workerPlans[0].launchCommand.includes(`bash ${quote(repoRoot)}/scripts/orchestrate-codex-worker.sh`), + plan.workerPlans[0].launchCommand.includes(`bash ${quote(resolvedRepoRoot)}/scripts/orchestrate-codex-worker.sh`), 'repo_root_sh should provide a shell-safe path' ); assert.ok(