fix(server): Address PR #733 review feedback and fix cross-platform tests

- Extract merge logic from pipeline-orchestrator to merge-service.ts to avoid HTTP self-call
- Make agent-executor error handling provider-agnostic using shared isAuthenticationError utility
- Fix cross-platform path handling in tests using path.normalize/path.resolve helpers
- Add catch handlers in plan-approval-service tests to prevent unhandled promise rejection warnings

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Kacper
2026-02-02 18:37:20 +01:00
parent 9fd2cf2bc4
commit a9d39b9320
9 changed files with 305 additions and 116 deletions

View File

@@ -1,5 +1,11 @@
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import path from 'path';
import type { Feature } from '@automaker/types';
/**
* Helper to normalize paths for cross-platform test compatibility.
*/
const normalizePath = (p: string): string => path.resolve(p);
import {
ExecutionService,
type RunAgentFn,
@@ -931,8 +937,8 @@ describe('execution-service.ts', () => {
// Should still run agent, just with project path
expect(mockRunAgentFn).toHaveBeenCalled();
const callArgs = mockRunAgentFn.mock.calls[0];
// First argument is workDir - should end with /test/project
expect(callArgs[0]).toMatch(/\/test\/project$/);
// First argument is workDir - should be normalized path to /test/project
expect(callArgs[0]).toBe(normalizePath('/test/project'));
});
it('skips worktree resolution when useWorktrees is false', async () => {