hermes - 💡(How to fix) Fix Dashboard: Spotify Web Playback widget (browser becomes a Spotify Connect device) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#15182Fetched 2026-04-25 06:24:01
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

Root Cause

  • Premium only. Spotify's Web Playback SDK refuses to initialize on Free accounts. Widget should detect and show a clear message, not break silently.
  • Token handoff from auth.json to browser. The dashboard is a Hermes plugin with server-side access to ~/.hermes/auth.json. It needs to hand the Spotify access token to the browser for SDK init, and handle refresh (the SDK calls a user-provided callback when the token expires — that callback should hit a dashboard endpoint that returns a fresh token, refreshing via our existing _refresh_spotify_oauth_state if needed).
  • Device registration. The SDK emits a ready event with a device_id. Widget should expose that device in the UI ("This tab is registered as 'Hermes Dashboard' — agent can target it").
  • Control surface. Standard transport bar (play/pause/skip/seek, volume slider, current track + album art). Progress bar ticks locally between SDK state updates.
  • Agent-triggered playback. When the agent calls spotify_playback play with device_id = this tab's id, the SDK handles it. Nothing special from our side — it just works because the browser is a real Connect device.
  • Graceful degradation. If the tab loses focus / network / SDK connection, reconnect automatically. Don't leave zombie devices in the user's Spotify Connect list.
RAW_BUFFERClick to expand / collapse

Follow-up to the Spotify integration rollout (#15121, #15130, #15135, #15154, #15174, #15180).

The goal

A dashboard plugin that makes the browser tab itself a Spotify Connect device. Audio plays out of the browser. The agent can control it directly via the existing spotify_devices and spotify_playback tools — no new backend code, it just shows up as a device the agent can target.

Why this tier (vs. a remote-control widget)

A simpler "remote control" widget would just poll get_currently_playing and show album art + play/pause buttons that call the existing tools. Useful, but it only controls a Spotify client you're already running elsewhere (phone, desktop app, Sonos).

The Web Playback SDK approach is strictly more capable: the browser IS the client. You don't need Spotify open anywhere else. The agent can say 'play X' from a fresh cron session and audio comes out of the dashboard tab that's already open. This is the natural home for a Hermes user who lives in the dashboard anyway.

Requirements

  • Premium only. Spotify's Web Playback SDK refuses to initialize on Free accounts. Widget should detect and show a clear message, not break silently.
  • Token handoff from auth.json to browser. The dashboard is a Hermes plugin with server-side access to ~/.hermes/auth.json. It needs to hand the Spotify access token to the browser for SDK init, and handle refresh (the SDK calls a user-provided callback when the token expires — that callback should hit a dashboard endpoint that returns a fresh token, refreshing via our existing _refresh_spotify_oauth_state if needed).
  • Device registration. The SDK emits a ready event with a device_id. Widget should expose that device in the UI ("This tab is registered as 'Hermes Dashboard' — agent can target it").
  • Control surface. Standard transport bar (play/pause/skip/seek, volume slider, current track + album art). Progress bar ticks locally between SDK state updates.
  • Agent-triggered playback. When the agent calls spotify_playback play with device_id = this tab's id, the SDK handles it. Nothing special from our side — it just works because the browser is a real Connect device.
  • Graceful degradation. If the tab loses focus / network / SDK connection, reconnect automatically. Don't leave zombie devices in the user's Spotify Connect list.

Reference

  • Web Playback SDK overview
  • SDK quick start
  • Existing Hermes dashboard plugin pattern: plugins/example-dashboard/, plugins/strike-freedom-cockpit/
  • Existing Spotify client module: plugins/spotify/client.py (has refresh logic we should reuse)
  • Existing auth: hermes_cli/auth.py _refresh_spotify_oauth_state and get_provider_auth_state("spotify")

Scope estimate

  • Dashboard plugin: ~400 LOC (SDK bootstrap, token refresh endpoint, transport UI, device state sync)
  • No changes to the core Spotify integration
  • Opt-in — only users who load the dashboard plugin pay for it

Non-goals

  • Playlist/library browsing UI. The agent handles that through tools. Widget stays focused on "what's playing + transport controls."
  • Offline playback. SDK doesn't support it.
  • Replacing the existing remote-control tools. The transport buttons in the widget should call the same spotify_playback tools so an external agent can drive the UI too.

Acceptance

  • User opens dashboard → sees Spotify widget showing login state
  • Clicks login → PKCE flow completes → tab shows 'Hermes Dashboard' as active device
  • Agent 'play miles davis' → music plays in the tab
  • Skip/pause buttons in the widget work and the agent sees the state change via get_currently_playing
  • Free users see a clear 'Spotify Premium required for in-browser playback' message

extent analysis

TL;DR

To implement the Spotify dashboard plugin, focus on token handoff, device registration, and control surface implementation using the Web Playback SDK.

Guidance

  • Verify that the auth.json file contains the necessary Spotify access token and implement token refresh logic using the existing _refresh_spotify_oauth_state function.
  • Register the browser tab as a Spotify Connect device using the Web Playback SDK's ready event and expose the device ID in the UI.
  • Implement a control surface with play/pause, skip, and seek functionality, as well as a volume slider and current track display.
  • Ensure that the widget handles agent-triggered playback and graceful degradation when the tab loses focus or network connection.

Example

// Token refresh callback example
const refreshAccessToken = async () => {
  const freshToken = await _refresh_spotify_oauth_state();
  // Update the SDK with the new token
  spotifySDK.setAccessToken(freshToken);
};

Notes

The implementation requires careful handling of token refresh and device registration to ensure seamless playback and control. The existing plugins/spotify/client.py and hermes_cli/auth.py modules can be used as references for token refresh logic.

Recommendation

Apply the workaround by implementing the token handoff and device registration using the Web Playback SDK, and ensure that the control surface and agent-triggered playback are properly handled. This approach allows for a more capable and integrated Spotify experience within the dashboard plugin.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix Dashboard: Spotify Web Playback widget (browser becomes a Spotify Connect device) [1 participants]