From 32ae34e48724737e074fac92f8c7206ffc39683b Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Fri, 13 Feb 2026 01:50:17 +0000 Subject: [PATCH 1/2] Initial plan From 6fc8650607500ad4f97dd3ff2d65fa6dd8db83ea Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Fri, 13 Feb 2026 01:52:48 +0000 Subject: [PATCH 2/2] fix: correct exit code success detection in test runner The awf-runner was incorrectly handling undefined exit codes from execa. When exitCode was undefined, it would set exitCode field to 0 (via || operator) but success field would evaluate undefined === 0 which is false. This caused tests to fail with the confusing message: "Expected awf to succeed, but it failed with exit code 0" Fixed by normalizing exitCode to a variable first using ?? operator, then using that normalized value for both fields. Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com> --- tests/fixtures/awf-runner.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/fixtures/awf-runner.ts b/tests/fixtures/awf-runner.ts index 93dc9995e..5028fee54 100644 --- a/tests/fixtures/awf-runner.ts +++ b/tests/fixtures/awf-runner.ts @@ -141,11 +141,14 @@ export class AwfRunner { // Extract work directory from stderr logs const workDir = this.extractWorkDir(result.stderr || ''); + // Normalize exit code to handle undefined (defaults to 0) + const exitCode = result.exitCode ?? 0; + return { - exitCode: result.exitCode || 0, + exitCode, stdout: result.stdout || '', stderr: result.stderr || '', - success: result.exitCode === 0, + success: exitCode === 0, timedOut: false, workDir, }; @@ -285,11 +288,14 @@ export class AwfRunner { const workDir = this.extractWorkDir(result.stderr || ''); + // Normalize exit code to handle undefined (defaults to 0) + const exitCode = result.exitCode ?? 0; + return { - exitCode: result.exitCode || 0, + exitCode, stdout: result.stdout || '', stderr: result.stderr || '', - success: result.exitCode === 0, + success: exitCode === 0, timedOut: false, workDir, };