Skip to content

74_cli_error_output.py asserts against a dict and can never pass #481

Description

@ambiorix2099

File: examples/agents/74_cli_error_output.py

Symptom: python examples/agents/74_cli_error_output.pyAssertionError: Agent did not surface CLI error output. The assertion message then prints a dict that visibly contains ls: /nonexistent_path_that_does_not_exist: No such file or directory — the exact text it says is missing. The agent behaved correctly.

Cause:

output = result.output or ""
assert "No such file or directory" in output or "nonexistent" in output

result.output is a dict, so in tests dict keys, never substrings. Always False.

Fix: Either assert against output["result"], or make result.output a string as the example expects. Pick deliberately: if other code treats result.output as a string, the SDK is the bug and this example is where it surfaced.

Verify: python examples/agents/74_cli_error_output.py prints PASS: agent correctly reported CLI error output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions