File: examples/agents/74_cli_error_output.py
Symptom: python examples/agents/74_cli_error_output.py → AssertionError: 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.
File:
examples/agents/74_cli_error_output.pySymptom:
python examples/agents/74_cli_error_output.py→AssertionError: Agent did not surface CLI error output. The assertion message then prints a dict that visibly containsls: /nonexistent_path_that_does_not_exist: No such file or directory— the exact text it says is missing. The agent behaved correctly.Cause:
result.outputis a dict, sointests dict keys, never substrings. Always False.Fix: Either assert against
output["result"], or makeresult.outputa string as the example expects. Pick deliberately: if other code treatsresult.outputas a string, the SDK is the bug and this example is where it surfaced.Verify:
python examples/agents/74_cli_error_output.pyprintsPASS: agent correctly reported CLI error output.