From 706488184e7355f4c2d805314bb611271801fce0 Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Thu, 12 Feb 2026 06:48:39 +0000 Subject: [PATCH 1/2] Initial plan From 9d750d6da9c3d9d2035de83c966ca9eec1a464ff Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Thu, 12 Feb 2026 07:00:19 +0000 Subject: [PATCH 2/2] fix: prevent docker output from contaminating command stdout The issue was that Docker Compose and Docker commands were using `stdio: 'inherit'` which caused container names like "awf-squid" and "awf-agent" to appear in the command stdout during container startup and teardown. This contaminated the output of user commands, causing test failures when tests checked the last line of stdout. Changes: - Changed stdio from 'inherit' to ['ignore', 'ignore', 'inherit'] in: - startContainers() docker compose up command (line 1138) - stopContainers() docker compose down command (line 1310) - stopContainers() docker rm commands (line 1325) This preserves stderr output for error messages while suppressing stdout that contains container names. Fixes the three failing tests in chroot-edge-cases.test.ts: - "should respect container-workdir in chroot mode" - "should fall back to home directory if workdir does not exist" - "should have HOME set correctly" Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com> --- src/docker-manager.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/docker-manager.ts b/src/docker-manager.ts index 0cdc409f3..0f290a3b1 100644 --- a/src/docker-manager.ts +++ b/src/docker-manager.ts @@ -1135,7 +1135,7 @@ export async function startContainers(workDir: string, allowedDomains: string[], } await execa('docker', composeArgs, { cwd: workDir, - stdio: 'inherit', + stdio: ['ignore', 'ignore', 'inherit'], // Only inherit stderr for errors, ignore stdout to prevent container names appearing in output }); logger.success('Containers started successfully'); @@ -1307,7 +1307,7 @@ export async function stopContainers(workDir: string, keepContainers: boolean): // Normal path: use docker compose down await execa('docker', ['compose', 'down', '-v'], { cwd: workDir, - stdio: 'inherit', + stdio: ['ignore', 'ignore', 'inherit'], // Ignore stdout to prevent container names appearing in output }); logger.success('Containers stopped successfully'); } else { @@ -1322,7 +1322,7 @@ export async function stopContainers(workDir: string, keepContainers: boolean): const { stdout } = await execa('docker', ['ps', '-aq', '-f', `name=^${name}$`]); if (stdout.trim()) { logger.debug(`Stopping container: ${name}`); - await execa('docker', ['rm', '-f', name], { stdio: 'inherit' }); + await execa('docker', ['rm', '-f', name], { stdio: ['ignore', 'ignore', 'inherit'] }); // Ignore stdout to prevent container names appearing in output } } catch (err) { logger.debug(`Could not stop container ${name}:`, err);