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

@@ -9,9 +9,16 @@
*/
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import path from 'path';
import { RecoveryService, DEFAULT_EXECUTION_STATE } from '@/services/recovery-service.js';
import type { Feature } from '@automaker/types';
/**
* Helper to normalize paths for cross-platform test compatibility.
* Uses path.normalize (not path.resolve) to match path.join behavior in production code.
*/
const normalizePath = (p: string): string => path.normalize(p);
// Mock dependencies
vi.mock('@automaker/utils', () => ({
createLogger: () => ({
@@ -288,7 +295,7 @@ describe('recovery-service.ts', () => {
expect(result).toBe(true);
expect(secureFs.access).toHaveBeenCalledWith(
'/test/project/.automaker/features/feature-1/agent-output.md'
normalizePath('/test/project/.automaker/features/feature-1/agent-output.md')
);
});