Skip to content

The agent that turns websites into APIs!

fix(cli): report self-contained provider errors in plain output

kalil032135844f9f6baa
diff --git a/src/reverse_api/cli.py b/src/reverse_api/cli.py
index 740cfb5..fd8c9e2 100644
--- a/src/reverse_api/cli.py
+++ b/src/reverse_api/cli.py
@@ -1775,6 +1775,7 @@ def agent(prompt, url, model, output_dir, no_interactive, as_json, json_stream,
headless=headless,
)
if isinstance(result, dict) and result.get("error"):
+ click.echo(f"error: {result['error']}", err=True)
sys.exit(1)
return
@@ -2208,7 +2209,7 @@ def run_auto_capture(
**(
{"error": "interrupted"}
if interrupted
- else {"error": "Agent analysis produced no result. Check the provider error above."}
+ else {"error": "Agent analysis produced no result."}
if result is None
else {}
),
diff --git a/tests/test_cli_agent_json.py b/tests/test_cli_agent_json.py
index 94d91a2..24e1928 100644
--- a/tests/test_cli_agent_json.py
+++ b/tests/test_cli_agent_json.py
@@ -539,6 +539,9 @@ def test_provider_failure_is_not_reported_as_success(tmp_path, output_flag):
assert payload["status"] == "error"
assert payload["error_kind"] == "engine_failure"
assert payload["script_path"] is None
+ assert payload["error"] == "Agent analysis produced no result."
+ else:
+ assert "error: Agent analysis produced no result." in result.stderr
engine.stop_sync.assert_called_once()