Workers screen shows each agent's version and protocol, and who is behind
The hello carries the fluksio-worker version. An agent refused for an older protocol stays listed as Needs upgrade until it attaches again. Docs gain an Upgrading workers section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WgBfkm4rCmtd1T4vHWjEPx
This commit is contained in:
@@ -38,6 +38,27 @@ def test_the_token_names_the_worker_and_its_labels(
|
||||
assert [(w["name"], w["labels"]) for w in attached] == [("gpu-box", ["gpu"])]
|
||||
|
||||
|
||||
def test_the_list_names_each_version_and_who_is_behind(
|
||||
client: TestClient, superuser_token_headers: dict[str, str]
|
||||
) -> None:
|
||||
issued = mint(client, superuser_token_headers)
|
||||
url = f"{PREFIX}/attach?token={issued['token']}"
|
||||
|
||||
def listed() -> list[tuple[object, ...]]:
|
||||
answer = client.get(PREFIX, headers=superuser_token_headers).json()
|
||||
return [(w["protocol"], w["version"], w["behind"]) for w in answer]
|
||||
|
||||
with client.websocket_connect(url) as ws:
|
||||
ws.send_json({**hello(), "protocol": PROTOCOL - 1, "version": "0.1.5"})
|
||||
assert ws.receive_json()["op"] == "refused"
|
||||
assert listed() == [(PROTOCOL - 1, "0.1.5", True)]
|
||||
|
||||
with client.websocket_connect(url) as ws:
|
||||
ws.send_json({**hello(), "version": "0.2.0"})
|
||||
ws.receive_json()
|
||||
assert listed() == [(PROTOCOL, "0.2.0", False)]
|
||||
|
||||
|
||||
def test_a_worker_cannot_claim_a_label_its_token_lacks(
|
||||
client: TestClient, superuser_token_headers: dict[str, str]
|
||||
) -> None:
|
||||
|
||||
Reference in New Issue
Block a user