The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(dashboard): cron delivery targets, blueprints, recommended default, voice config, official skills and debug share answer an unknown ?profile= with 404
John Paul Soliva9ad715632444
diff --git a/hermes_cli/web_routers/audio.py b/hermes_cli/web_routers/audio.pyindex 340114d75e5..49ecb88cd3c 100644--- a/hermes_cli/web_routers/audio.py+++ b/hermes_cli/web_routers/audio.py@@ -156,6 +156,8 @@ async def get_client_voice_config(profile: Optional[str] = None):from tools.voice_client_config import resolve_client_voice_configtry:result = await _run_config_scoped(profile, resolve_client_voice_config)+ except HTTPException:+ raise # an unknown ?profile= is the scope's 404, not a reason to fall back to relayexcept Exception:_log.exception("Client voice-config resolution failed")fallback = {"mode": "relay", "reason": "resolution error"}diff --git a/hermes_cli/web_routers/cron.py b/hermes_cli/web_routers/cron.pyindex e2f9fbfea67..d2326ad332c 100644--- a/hermes_cli/web_routers/cron.py+++ b/hermes_cli/web_routers/cron.py@@ -647,6 +647,8 @@ async def get_cron_delivery_targets(profile: Optional[str] = None):with _config_profile_scope(profile):targets.extend(cron_delivery_targets())+ except HTTPException:+ raise # an unknown ?profile= is the scope's 404, not a missing platform listexcept Exception:_log.exception("GET /api/cron/delivery-targets failed")return {"targets": targets}@@ -782,6 +784,8 @@ async def list_cron_blueprints(profile: Optional[str] = None):with _config_profile_scope(profile):platforms = [t["id"] for t in cron_delivery_targets() if t.get("id")]deliver_options = ["origin", "local", *platforms]+ except HTTPException:+ raise # an unknown ?profile= is the scope's 404, not a reason for static optionsexcept Exception:_log.debug("cron_delivery_targets unavailable; using static deliver options", exc_info=True)@@ -794,6 +798,8 @@ async def list_cron_blueprints(profile: Optional[str] = None):f["options"] = deliver_optionsentries.append(entry)return {"blueprints": entries}+ except HTTPException:+ raiseexcept Exception as e:_log.exception("GET /api/cron/blueprints failed")raise HTTPException(status_code=500, detail=str(e))diff --git a/hermes_cli/web_routers/models.py b/hermes_cli/web_routers/models.pyindex fbb516a837b..1ba53280327 100644--- a/hermes_cli/web_routers/models.py+++ b/hermes_cli/web_routers/models.py@@ -204,6 +204,8 @@ def get_recommended_default_model(provider: str = "", profile: Optional[str] = Nmodels = [str(m) for m in (row.get("models") or [])]return {"provider": slug, "model": pick_silent_default_model(models, provider=slug), "free_tier": None}return {"provider": slug, "model": "", "free_tier": None}+ except HTTPException:+ raise # an unknown ?profile= is the scope's 404, not an empty recommendationexcept Exception:_log.exception("GET /api/model/recommended-default failed")return {"provider": slug, "model": "", "free_tier": None}diff --git a/hermes_cli/web_routers/status.py b/hermes_cli/web_routers/status.pyindex 0e998f1a8a8..faab5ffd33f 100644--- a/hermes_cli/web_routers/status.py+++ b/hermes_cli/web_routers/status.py@@ -795,6 +795,8 @@ async def run_debug_share_endpoint(body: DebugShareRequest | None = None,try:result = await config_scoped_to_thread(profile, lambda: build_debug_share(log_lines=max(1, min(int(req.lines), 5000)), redact=bool(req.redact)))+ except HTTPException:+ raise # an unknown ?profile= is the scope's 404, not a failed shareexcept RuntimeError as exc:# Required summary-report upload failed (offline / paste service down).raise HTTPException(status_code=502, detail=f"Upload failed: {exc}")diff --git a/hermes_cli/web_server_profiles.py b/hermes_cli/web_server_profiles.pyindex 1fbc7b54f04..9ddc6068bf8 100644--- a/hermes_cli/web_server_profiles.py+++ b/hermes_cli/web_server_profiles.py@@ -475,5 +475,7 @@ def _installed_hub_identifiers(profile: Optional[str] = None) -> dict:keys = ("name", "trust_level", "scan_verdict")return {entry["identifier"]: {k: entry.get(k) for k in keys}for entry in lock.list_installed() if entry.get("identifier")}+ except HTTPException:+ raise # an unknown profile is the scope's 404, not an unreadable lock fileexcept Exception:return {}diff --git a/tests/hermes_cli/test_web_unknown_profile_404.py b/tests/hermes_cli/test_web_unknown_profile_404.pyindex 87283fffa5b..4bbf73a332e 100644--- a/tests/hermes_cli/test_web_unknown_profile_404.py+++ b/tests/hermes_cli/test_web_unknown_profile_404.py@@ -18,6 +18,11 @@ def client(_isolate_hermes_home):("PUT", "/api/env", {"key": "FAKE_PROBE_KEY", "value": "fake-value"}),("GET", "/api/learning/graph", None),("GET", "/api/dashboard/plugins/hub", None),+ ("GET", "/api/cron/delivery-targets", None),+ ("GET", "/api/cron/blueprints", None),+ ("GET", "/api/model/recommended-default", None),+ ("GET", "/api/audio/voice-config", None),+ ("GET", "/api/skills/hub/official", None),])def test_unknown_profile_is_the_scopes_404(client, method, path, body):resp = client.request(method, path, params={"profile": "no-such-profile"}, json=body)diff --git a/website/docs/user-guide/features/web-dashboard.md b/website/docs/user-guide/features/web-dashboard.mdindex b2641f3e8f5..83800cead22 100644--- a/website/docs/user-guide/features/web-dashboard.md+++ b/website/docs/user-guide/features/web-dashboard.md@@ -443,8 +443,10 @@ The web dashboard exposes a REST API that the frontend consumes. You can also ca:::tip Profile-scoped endpointsThe management endpoint families — `/api/config`, `/api/env`, `/api/skills`,-`/api/tools/toolsets`, `/api/mcp`, `/api/model/{info,options,auxiliary,set}`,-`/api/learning/graph`, and `/api/dashboard/plugins/hub` —+`/api/tools/toolsets`, `/api/mcp`,+`/api/model/{info,options,auxiliary,set,recommended-default}`,+`/api/cron/{delivery-targets,blueprints}`, `/api/audio/voice-config`,+`/api/ops/debug-share`, `/api/learning/graph`, and `/api/dashboard/plugins/hub` —accept an optional `?profile=<name>` query parameter (or `"profile"` in theJSON body for writes) that scopes the read/write to that profile's`HERMES_HOME`. Omitted = the dashboard's own profile. Unknown profile names