Skip to content

fix(spotify): infer URI types and guard playback on an active device - #142

Closed
salch-cred wants to merge 3 commits into
NousResearch:mainfrom
salch-cred:feature/spotify-uri-and-device-guards
Closed

salch-cred wants to merge 3 commits into
NousResearch:mainfrom
salch-cred:feature/spotify-uri-and-device-guards

Conversation

@salch-cred

Copy link
Copy Markdown
Contributor

Queue and playback calls forwarded whatever they were handed, so a malformed
id or a URL reached Spotify and came back as a generic "Bad URI", and a
playback command with no active device came back as a 403 that reads like a
permissions problem rather than the actual cause.

  • spotify_uri_type() reads the type out of a URI or an open.spotify.com
    URL, so a caller can canonicalize without hardcoding one type.
  • Queue targets are canonicalized per input: a typed URI or URL keeps its own
    type, a bare id becomes a track, and a type Spotify cannot queue is refused
    locally instead of at the API.
  • Playback-changing commands and queue add ask for an active device when the
    call names none, and say so. A failed lookup surfaces as itself rather than
    being masked as "no active device".

The related core work (hermes-agent#56043) was closed unmerged when the
Spotify plugin moved out of core, so the gap is live here.

Closes #13.

Queue and playback calls forwarded whatever they were handed, so a malformed
id or a URL reached Spotify and came back as a generic "Bad URI", and a
playback command with no active device came back as a 403 that reads like a
permissions problem rather than the actual cause.

- spotify_uri_type() reads the type out of a URI or an open.spotify.com URL,
  so a caller can canonicalize without hardcoding one type.
- Queue targets are canonicalized per input: a typed URI or URL keeps its own
  type, a bare id becomes a track, and a type Spotify cannot queue is refused
  locally instead of at the API.
- Playback-changing commands and queue add ask for an active device when the
  call names none, and say so. A failed lookup surfaces as itself rather than
  being masked as "no active device".
@salch-cred
salch-cred requested a review from teknium1 as a code owner October 21, 2026 19:08
@salch-cred
salch-cred force-pushed the feature/spotify-uri-and-device-guards branch from 2430423 to cbbef4f Compare October 21, 2026 19:13
… follow main's tool tests

main's test_spotify_tools_misc (7b26951) asserts exact call lists and that a
missing queue uri reports 'Spotify URI/url/id is required.'; with the guard
first it reported 'no active device' instead. Validation now runs first so a
bad URI never costs a devices call, and the misc fake answers the guard's
devices lookup.
teknium1 added a commit to salch-cred/hermes-official-plugins that referenced this pull request Nov 19, 2026
So the handler tests stay green once the active-device guard (NousResearch#142) or the
default device (NousResearch#145) makes playback calls list devices first.
@teknium1

Copy link
Copy Markdown
Contributor

Thank you @salch-cred! This landed on main through #446, which stacked the 34 reviewed official-plugin PRs on current main so their shared files (CHANGELOGs, versions, the README grid) conflicted only once. Your commits are kept with your authorship; this PR's tip is 1de98d8. To get it now: hermes plugins install NousResearch/hermes-official-plugins#<plugin> --force; hermes plugins update follows once the catalog pin moves (in progress).

@teknium1 teknium1 closed this Nov 19, 2026
teknium1 added a commit that referenced this pull request Nov 20, 2026
So the handler tests stay green once the active-device guard (#142) or the
default device (#145) makes playback calls list devices first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spotify tools: Bad URI / active device guidance gap in playback/queue tools

2 participants