Skip to content

[Phase 2.5] GoldenPathRunner._detect_success() has false positive when agent produces no output #374

Description

@frankbria

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingphase-2Phase 2: Server Layer as Thin Adapter

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions