Skip to content

Commit 12b1940

Browse files
yaozheng-fangclaude
andcommitted
feat(cli): show version column in agentkit list harness
Add the runtime's current released version (CurrentVersionNumber) as a "Version" column in the `agentkit list harness` table output, so deployed harness runtimes can be told apart by version at a glance. JSON/YAML output already carries the field via model_dump. Covered by tests asserting the version appears in both table and JSON output. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent f09df89 commit 12b1940

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

agentkit/toolkit/cli/cli_list.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ def build_request(next_token_val):
117117
("RuntimeId", "RuntimeId", "cyan"),
118118
("Name", "Name", "white"),
119119
("Status", "Status", "green"),
120+
("CurrentVersionNumber", "Version", "blue"),
120121
("ProjectName", "ProjectName", "yellow"),
121122
("UpdatedAt", "UpdatedAt", "magenta"),
122123
]

tests/toolkit/cli/test_cli_list_harness.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@
2626
runner = CliRunner()
2727

2828

29-
def _runtime(runtime_id, name, *, tags):
29+
def _runtime(runtime_id, name, *, tags, version=1):
3030
return rt.AgentKitRuntimesForListRuntimes.model_validate(
3131
{
3232
"RuntimeId": runtime_id,
3333
"Name": name,
3434
"Status": "Ready",
35+
"CurrentVersionNumber": version,
3536
"Tags": [{"Key": k, "Value": v} for k, v in tags],
3637
}
3738
)
@@ -111,14 +112,28 @@ def test_list_harness_quiet_prints_only_ids(monkeypatch):
111112
def test_list_harness_json_output(monkeypatch):
112113
_patch_client(
113114
monkeypatch,
114-
[_runtime("rt-harness", "my-harness", tags=[_HARNESS_TAG])],
115+
[_runtime("rt-harness", "my-harness", tags=[_HARNESS_TAG], version=3)],
115116
)
116117

117118
result = runner.invoke(app, ["list", "harness", "--output", "json"])
118119

119120
assert result.exit_code == 0, result.output
120121
data = json.loads(result.output)
121122
assert [r["RuntimeId"] for r in data] == ["rt-harness"]
123+
assert data[0]["CurrentVersionNumber"] == 3
124+
125+
126+
def test_list_harness_table_shows_version(monkeypatch):
127+
_patch_client(
128+
monkeypatch,
129+
[_runtime("rt-harness", "my-harness", tags=[_HARNESS_TAG], version=7)],
130+
)
131+
132+
result = runner.invoke(app, ["list", "harness"])
133+
134+
assert result.exit_code == 0, result.output
135+
assert "Version" in result.output
136+
assert "7" in result.output
122137

123138

124139
def test_list_harness_follows_pagination(monkeypatch):

0 commit comments

Comments
 (0)