Skip to content

The agent that turns websites into APIs!

fix(types): align optional CLI inputs and cover configured SDK defaults

kalil032161f472d4c5e8
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a124f5b..e6b8873 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -37,6 +37,7 @@ jobs:
typecheck:
if: github.event_name != 'workflow_dispatch' || !inputs.live_windows
name: mypy
+ timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
diff --git a/src/reverse_api/cli.py b/src/reverse_api/cli.py
index 9e5a8e5..054293a 100644
--- a/src/reverse_api/cli.py
+++ b/src/reverse_api/cli.py
@@ -2338,7 +2338,7 @@ Exit codes:
help="Emit NDJSON progress events on stdout during the run, then a final {\"event\":\"result\",...} line. Implies --no-interactive.",
)
def engineer(
- run_id: str,
+ run_id: str | None,
prompt: str | None,
fresh: bool,
model: str | None,
@@ -2649,7 +2649,7 @@ JSON output (--json) is always a flat array (possibly empty []).
@click.option("--mode", "-m", type=str, default=None, help="Filter by mode (auto/manual/agent/engineer/collector).")
@click.option("--model", type=str, default=None, help="Filter by model name.")
@click.option("--search", "-s", type=str, default=None, help="Case-insensitive substring match on prompt.")
-def list_runs(as_json: bool, full: bool, limit: int, mode: str | None, model: str | None, search: str | None) -> None:
+def list_runs(as_json: bool, full: bool, limit: int | None, mode: str | None, model: str | None, search: str | None) -> None:
"""List generated scripts and runs with optional filters."""
from rich.table import Table
@@ -2738,7 +2738,7 @@ Exit codes (--json):
)
@click.argument("run_id", required=False)
@click.option("--json", "as_json", is_flag=True, help="Output as JSON object.")
-def show_run(run_id: str, as_json: bool) -> None:
+def show_run(run_id: str | None, as_json: bool) -> None:
"""Show detailed info for a specific run."""
from rich.table import Table
from rich.text import Text
diff --git a/tests/test_cli_settings.py b/tests/test_cli_settings.py
index dd1fcfb..b3c3728 100644
--- a/tests/test_cli_settings.py
+++ b/tests/test_cli_settings.py
@@ -15,9 +15,10 @@ from reverse_api import cli
("cursor", "cursor_model", "composer-2.5"),
])
@pytest.mark.parametrize("saved", [None, "", "custom-model"])
-def test_default_model_handles_empty_settings(sdk, key, default, saved):
- with patch.object(cli.config_manager, "get", side_effect=lambda name: {key: saved}.get(name)):
- assert cli.default_model_for_configured_sdk(sdk) == (saved or default)
[email protected]("infer_sdk", [False, True])
+def test_default_model_handles_empty_settings(sdk, key, default, saved, infer_sdk):
+ with patch.object(cli.config_manager, "get", side_effect=lambda name, fallback=None: {"sdk": sdk, key: saved}.get(name, fallback)):
+ assert cli.default_model_for_configured_sdk(None if infer_sdk else sdk) == (saved or default)
def test_settings_stays_open_until_back():