Skip to content

Commit 111a013

Browse files
committed
fix: handle runtime status payloads without reachable
Treat successful runtime status calls as reachable when older runtime adapters omit the field so the setup workflow can unblock runtime and processing correctly.
1 parent e334038 commit 111a013

2 files changed

Lines changed: 25 additions & 1 deletion

File tree

tests/test_setup_view_models.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,30 @@ def test_build_runtime_view_accepts_list_shaped_local_models() -> None:
149149
assert view["next_action"] == "Run the first processing test"
150150

151151

152+
def test_build_runtime_view_treats_missing_reachable_as_successful_status() -> None:
153+
runtime = {
154+
"ollama_version": "0.6.0",
155+
"local_models": {
156+
"qwen3.5:4b-q4_K_M": {},
157+
"qwen3.5:2b-q4_K_M": {},
158+
},
159+
"running_models": [],
160+
"total_vram_mb": 0.0,
161+
"vram_budget_mb": 8192,
162+
"model_selection_reserve_mb": 768,
163+
"model_priority": ["qwen3.5:4b-q4_K_M", "qwen3.5:2b-q4_K_M"],
164+
"database_path": ".data/vra.db",
165+
"storage_dir": ".data",
166+
"models": ["qwen3.5:4b-q4_K_M", "qwen3.5:2b-q4_K_M"],
167+
}
168+
169+
view = build_runtime_view(runtime)
170+
171+
assert view["state"] == "ready"
172+
assert view["missing_models"] == []
173+
assert view["next_action"] == "Run the first processing test"
174+
175+
152176
def test_build_runtime_view_marks_ready_path_complete() -> None:
153177
runtime = {
154178
"reachable": True,

video_rss_aggregator/setup_view_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def build_runtime_view(runtime: dict[str, object]) -> dict[str, object]:
5858
models = [str(model) for model in _as_list(runtime.get("models"))]
5959
missing_models = [model for model in models if model not in local_models]
6060

61-
reachable = bool(runtime.get("reachable"))
61+
reachable = bool(runtime["reachable"]) if "reachable" in runtime else True
6262
state = "ready" if reachable and not missing_models else "blocked"
6363
if not reachable:
6464
next_action = "Check runtime"

0 commit comments

Comments
 (0)