Problem
GoldenPathRunner._detect_success() returns True (success) when the CLI output contains no recognizable success or failure patterns. This caused a false 100% success rate in a run where the agent completed 10 tasks in 1.6s each without generating any code.
Root Cause
In tests/e2e/cli/golden_path_runner.py (line 305-332):
def _detect_success(self, exit_code: int, output: str) -> bool:
# ...checks success_patterns, failure_patterns...
# If no clear signal, fall back to exit code
return exit_code == 0 # ← WRONG: defaults to success
When the agent doesn't actually execute (e.g., missing API key, stale run), the CLI returns exit code 0 with output that doesn't match any patterns. The fallback treats this as success.
Observed Behavior
A 31-second run where all 10 tasks "completed" in 1.6s each:
_detect_success() returned True for all tasks
test_all_tasks_succeed passed
- But
test_files_generated and test_tests_generated correctly failed (0 files generated)
Proposed Fix
Change the default fallback from True to False:
# If no clear signal, assume failure (conservative)
return False
Or better, require an explicit success pattern:
# No success pattern found — treat as failure
for pattern in success_patterns:
if pattern in output:
return True
return False
Related
The CLI itself should also be fixed to return non-zero exit codes for FAILED tasks (typer.Exit(1)), but that's a separate issue.
Files
tests/e2e/cli/golden_path_runner.py — _detect_success() method (line 305)
Problem
GoldenPathRunner._detect_success()returnsTrue(success) when the CLI output contains no recognizable success or failure patterns. This caused a false 100% success rate in a run where the agent completed 10 tasks in 1.6s each without generating any code.Root Cause
In
tests/e2e/cli/golden_path_runner.py(line 305-332):When the agent doesn't actually execute (e.g., missing API key, stale run), the CLI returns exit code 0 with output that doesn't match any patterns. The fallback treats this as success.
Observed Behavior
A 31-second run where all 10 tasks "completed" in 1.6s each:
_detect_success()returned True for all taskstest_all_tasks_succeedpassedtest_files_generatedandtest_tests_generatedcorrectly failed (0 files generated)Proposed Fix
Change the default fallback from
TruetoFalse:Or better, require an explicit success pattern:
Related
The CLI itself should also be fixed to return non-zero exit codes for FAILED tasks (
typer.Exit(1)), but that's a separate issue.Files
tests/e2e/cli/golden_path_runner.py—_detect_success()method (line 305)