From 3e9e5689a494c81b166d41e13ce0e7c7c6f3098c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 31 Jan 2026 11:14:38 +0000 Subject: [PATCH 1/3] Initial plan From 2f7b3c990072963174735c5c0aa8719ded16c21f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 31 Jan 2026 11:30:31 +0000 Subject: [PATCH 2/3] Fix flaky e2e tests: github-models-integration and docker-utils Co-authored-by: gtanczyk <1281113+gtanczyk@users.noreply.github.com> --- e2e-tests/docker-utils.test.ts | 4 ++++ e2e-tests/github-models-integration.test.ts | 14 +++++++------ .../container-task/utils/docker-utils.ts | 21 +++++++++++-------- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/e2e-tests/docker-utils.test.ts b/e2e-tests/docker-utils.test.ts index 85ec149..cf91157 100644 --- a/e2e-tests/docker-utils.test.ts +++ b/e2e-tests/docker-utils.test.ts @@ -235,8 +235,12 @@ describe('Docker Utils E2E Tests', () => { const files = output .split('\n') .map((f) => f.trim()) + .filter((f) => f.length > 0) .sort(); + // Log actual files for debugging in case of flaky failures + console.log('Files found in container:', JSON.stringify(files, null, 2)); + expect(files).toContain('/data/root.txt'); expect(files).toContain('/data/nested/nested.txt'); // Note: Empty directories are included in the transfer diff --git a/e2e-tests/github-models-integration.test.ts b/e2e-tests/github-models-integration.test.ts index 953f09e..0a21b66 100644 --- a/e2e-tests/github-models-integration.test.ts +++ b/e2e-tests/github-models-integration.test.ts @@ -70,22 +70,24 @@ describe('GitHub Models Integration E2E Tests', () => { const command = `node "${CLI_PATH}" --ai-service=github-models --explicit-prompt="${prompt}" --dry-run`; try { - const { stderr } = await execAsync(command, { + const { stdout, stderr } = await execAsync(command, { env: { ...process.env, GITHUB_TOKEN: '', // Explicitly unset the token }, - timeout: 10000, + timeout: 60000, // Increased timeout since the command takes time to load plugins and scan files }); // Should show error message when no token is provided - // Note: The command may exit with code 0 or non-zero, but the error message should be in stderr - expect(stderr).toContain('GitHub Models API token not configured'); + // Note: The error message may appear in stdout (via console output) or stderr + const combinedOutput = stdout + stderr; + expect(combinedOutput).toContain('GitHub Models API token not configured'); } catch (error: unknown) { const execError = error as { code?: unknown; stdout?: string; stderr?: string }; - // If the command fails, the error message should still be in stderr - expect(execError.stderr).toContain('GitHub Models API token not configured'); + // If the command fails, the error message should be in either stdout or stderr + const combinedOutput = (execError.stdout || '') + (execError.stderr || ''); + expect(combinedOutput).toContain('GitHub Models API token not configured'); } }); }); diff --git a/src/prompt/steps/step-iterate/handlers/container-task/utils/docker-utils.ts b/src/prompt/steps/step-iterate/handlers/container-task/utils/docker-utils.ts index 649ae2b..6361eda 100644 --- a/src/prompt/steps/step-iterate/handlers/container-task/utils/docker-utils.ts +++ b/src/prompt/steps/step-iterate/handlers/container-task/utils/docker-utils.ts @@ -206,15 +206,18 @@ function addDirectoryToPack(pack: tar.Pack, directoryPath: string, relativeTo: s const items = fs.readdirSync(directoryPath); const dirStats = fs.lstatSync(directoryPath); - pack.entry( - { - name: relativeTo.endsWith('/') ? relativeTo : relativeTo + '/', - type: 'directory', - mode: dirStats.mode & 0o777, - mtime: dirStats.mtime, - }, - () => {}, - ); + // Only add directory entry if not the root (to avoid creating a '/' entry which can cause issues) + if (relativeTo !== '') { + pack.entry( + { + name: relativeTo.endsWith('/') ? relativeTo : relativeTo + '/', + type: 'directory', + mode: dirStats.mode & 0o777, + mtime: dirStats.mtime, + }, + () => {}, + ); + } for (const item of items) { const fullPath = path.join(directoryPath, item); From 047e650279054379336d0c06ebfc06b6851ec942 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 31 Jan 2026 11:33:55 +0000 Subject: [PATCH 3/3] Remove debug logging from docker-utils test Co-authored-by: gtanczyk <1281113+gtanczyk@users.noreply.github.com> --- e2e-tests/docker-utils.test.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/e2e-tests/docker-utils.test.ts b/e2e-tests/docker-utils.test.ts index cf91157..5597885 100644 --- a/e2e-tests/docker-utils.test.ts +++ b/e2e-tests/docker-utils.test.ts @@ -238,9 +238,6 @@ describe('Docker Utils E2E Tests', () => { .filter((f) => f.length > 0) .sort(); - // Log actual files for debugging in case of flaky failures - console.log('Files found in container:', JSON.stringify(files, null, 2)); - expect(files).toContain('/data/root.txt'); expect(files).toContain('/data/nested/nested.txt'); // Note: Empty directories are included in the transfer