Fix dashboard fallback auth in profile browsing (#499 regression)#710
Open
JulianMendezw wants to merge 1 commit into
Open
Fix dashboard fallback auth in profile browsing (#499 regression)#710JulianMendezw wants to merge 1 commit into
JulianMendezw wants to merge 1 commit into
Conversation
fetchDashboardProfiles() and readProfileWithFallback() sent a static bearer token (HERMES_API_TOKEN/CLAUDE_API_TOKEN/CLAUDE_DASHBOARD_TOKEN) to the dashboard's /api/profiles route. That route only accepts the dashboard's ephemeral per-boot session token, so the static token was always rejected and the fallback silently degraded to the (empty) local filesystem. Use dashboardFetch() from gateway-capabilities.ts instead — the same helper skills.ts/toggle-skill.ts already use for their dashboard proxy calls, and the only thing the dashboard accepts. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#499 ("Profile UI in split-host deployments returns empty list") was closed by #520, which added a dashboard-API fallback to
profiles-browser.ts. That fallback authenticates against the dashboard's/api/profilesroute using a static bearer token (HERMES_API_TOKEN/CLAUDE_API_TOKEN/CLAUDE_DASHBOARD_TOKEN). The dashboard's/api/profilesroute does not accept static bearer tokens — it only recognizes its own ephemeral per-boot session token (scraped from the dashboard's root HTML). So the fallback request always gets a 401 and silently degrades back to the (empty) local filesystem read, meaning #499 is not actually fixed for the scenario it describes.Confirmed this on a real split-host deployment:
hermes-workspacecontainer with no/data/hermesmount,HERMES_DASHBOARD_URLpointed at a working dashboard —/api/profiles/listreturned only the syntheticdefaultprofile until this fix, then returned all real profiles afterward.Fix
fetchDashboardProfiles()andreadProfileWithFallback()now usedashboardFetch()fromgateway-capabilities.ts— the same ephemeral-token scrape/retry helperskills.tsandtoggle-skill.tsalready use for their own dashboard-proxied routes — instead of the hand-rolled static-token fetch. Removed the now-unusedgetDashboardToken().Test plan
POST /api/authlogin +GET /api/profiles/listnow returns all configured profiles (previously onlydefault) with correct model/provider/skillCount/hasEnv metadata.