Skip to content

Commit 9a240d6

Browse files
yasinBursaliclaude
andcommitted
fix: expire orphaned initial progress after 2 min + add has_data to catalog
- If host agent never picks up an install request, the initial progress file (written by dashboard-api) stays at "pulling" with started_at == updated_at. After 2 min, treat as stale so extension stops showing "installing" and falls through to normal status. - Add has_data field to catalog response so UI can hide purge button when there's no data directory to purge. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 734d23b commit 9a240d6

File tree

1 file changed

+10
-2
lines changed
  • dream-server/extensions/services/dashboard-api/routers

1 file changed

+10
-2
lines changed

dream-server/extensions/services/dashboard-api/routers/extensions.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,14 @@ def _compute_extension_status(ext: dict, services_by_id: dict) -> str:
104104
if progress:
105105
ps = progress.get("status", "")
106106
if ps in ("pulling", "starting"):
107-
return "installing"
107+
# If the progress was never updated by the host agent (started_at == updated_at)
108+
# and is older than 2 min, the agent likely never picked it up — ignore.
109+
started = progress.get("started_at", "")
110+
updated = progress.get("updated_at", "")
111+
if started == updated and _is_stale(updated, max_age_seconds=120):
112+
pass # fall through to normal status logic
113+
else:
114+
return "installing"
108115
if ps == "setup_hook":
109116
return "setting_up"
110117
if ps == "error":
@@ -507,7 +514,8 @@ async def extensions_catalog(
507514
ext_id = ext["id"]
508515
user_dir = USER_EXTENSIONS_DIR / ext_id
509516
source = "user" if user_dir.is_dir() else ("core" if ext_id in SERVICES else "library")
510-
enriched = {**ext, "status": status, "installable": installable, "source": source}
517+
has_data = (Path(DATA_DIR) / ext_id).is_dir()
518+
enriched = {**ext, "status": status, "installable": installable, "source": source, "has_data": has_data}
511519

512520
if category and ext.get("category") != category:
513521
continue

0 commit comments

Comments
 (0)