Repository navigation
feat(spotify): gateway slash-command handlers for common playback actions - #186
Closed
salch-cred wants to merge 4 commits into
Closed
salch-cred wants to merge 4 commits into
salch-cred wants to merge 4 commits into
Conversation
…ions Five terse gateway commands without a full agent turn: /play [query], /pause, /skip, /nowplaying (alias /np), /queue <query>. The handlers call the same tools the model does and format one line, so state handling and Premium/device restrictions behave identically. Handlers and formatting only; dispatch lives in core and is a follow-up, and availability gating needs core's gateway_availability_fn hook (toolset enabled AND a stored login). Search picks the top result; no interactive pickers.
…not configured' spotify/.coverage was a 53 KB coverage database committed by accident; it is removed and ignored. SpotifyClient() raises SpotifyAuthRequiredError outside the tool's error boundary, so every handler raised instead of returning the 'Spotify not configured' line the issue asks for.
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
added a commit
that referenced
this pull request
Nov 20, 2026
Reworks #186's handlers into a single command registered through the documented plugin API (ctx.register_command), so it works in the CLI and every messaging gateway now instead of waiting on a core dispatch change: /spotify play [query] | pause | skip | np | queue <track> One /spotify name keeps clear of core's own /pause and /queue (register_command skips a name that clashes with a built-in). np is now playing. An unknown or missing subcommand prints the usage line. Sync handler: core runs it on the gateway pool, not the event loop. Version 2.2.0 (plugin.yaml now matches pyproject). Fixes #18
Contributor
|
Thank you @salch-cred! This landed on main through #451, reworked into one |
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.
feat(spotify): gateway slash-command handlers for common playback actions
Summary
Issue #18 asks for gateway slash commands so common actions do not need a full agent turn. This lands the plugin half:
spotify/gateway_commands.pywithplay(query),pause(),skip(),nowplaying()andqueue(query), each returning one terse line (the issue's table), plus 13 tests.Behaviour
spotify_*tools, so playback, device resolution and Premium restrictions behave exactly as the model path does./playwithout a query resumes; with one, the top search hit plays (no pickers, per the non-goals).hermes spotify login"), otherwise the tool message.? Blackbird ? The Beatles ? 0:42 / 9:22 ? Kitchen Sonos,Skipped ? next: ?,Queued: ?.Draft, pending core
Dispatch (
/play? handler) and visibility gating live in core: the issue'sgateway_availability_fnextension plus a dispatch block ingateway/run.py. Availability must be two-factor (toolset enabled AND login stored). Until that lands the handlers are callable directly and exercised by tests.Tests
tests/test_spotify_gateway_commands.py: 13 passed (resume, search-and-play, no match, pause, skip naming the next track, nowplaying with/without device/track, queue add/usage, four error mappings).ruffclean.Refs #18.