Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions agentrace/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ def cmd_check(args) -> int:

def cmd_show(args) -> int:
runs = _load(args)
if args.id == "":
console.print("[red]Please provide a run ID[/]", file=sys.stderr)
return 1
match = [r for r in runs if r.tool_use_id.endswith(args.id)]
if not match:
console.print(f"[red]No run matching {args.id!r}[/]")
Expand Down
8 changes: 8 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ def test_empty_result_names_selected_file(tmp_path):
assert result.returncode == 0
assert "No subagent runs found." in result.stdout
assert f"Looked in {transcript}." in result.stdout

def test_show_empty_id_errors(tmp_path):
transcript = tmp_path / "empty.jsonl"
transcript.write_text("")
result = run_cli("--file", str(transcript), "show", "")

assert result.returncode == 1
assert "Please provide a run ID" in result.stderr


def test_empty_result_names_selected_directory(tmp_path):
Expand Down
Loading