Repository navigation
Move player supported_commands from client/hello to client/state - #400
Merged
chrisuthe merged 5 commits intoSep 16, 2026
Conversation
Player settability now comes from the supported_commands list in the latest client/state player object, which accepts volume, mute and set_output_delay and may change mid-session. Reported volume/muted without the matching command is applied as read-only rather than discarded and flagged, and an initial state omitting the list is flagged. A hello still declaring supported_commands is accepted and flagged; its commands seed the list on connect and extend any later state list.
The SDK no longer sends supported_commands in the hello. Commands an embedder declares on player_support are folded into the state list, which is always sent (as an empty list when there are none), and a server/command absent from the last reported list is ignored.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Event callbacks can observe and act on the previous command-capability list.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Moves player command capabilities from handshake metadata to dynamic client state while retaining temporary legacy compatibility.
Changes:
- Updates server models, validation, and command gating.
- Updates SDK state reporting and unsupported-command filtering.
- Adds unit, compatibility, and integration coverage.
File summaries
| File | Description |
|---|---|
aiosendspin/models/player.py |
Updates player command models. |
aiosendspin/server/connection.py |
Flags legacy hello declarations. |
aiosendspin/server/roles/player/v1.py |
Tracks state-level command capabilities. |
aiosendspin/client/client.py |
Merges legacy commands into state configuration. |
aiosendspin/client/connection.py |
Reports capabilities and filters commands. |
tests/models/test_player.py |
Tests model parsing and serialization. |
tests/server/test_multi_server.py |
Tests strict and legacy hello handling. |
tests/server/roles/test_player_v1.py |
Tests role capability behavior. |
tests/test_client_protocol_callbacks.py |
Tests SDK reporting and filtering. |
tests/integration/test_player_supported_commands.py |
Adds end-to-end coverage. |
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The implementation matches the specified protocol transition and includes comprehensive compatibility and integration coverage.
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 0 new
- Review effort level: Balanced
chrisuthe
marked this pull request as ready for review
September 16, 2026 14:12
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.
Implements spec PR Sendspin/spec#177: player
supported_commandsmoves from theclient/helloplayer@v1_supportobject into theclient/stateplayer object, where it may change mid-session. Audit item B1 of #399 (PL-2, PL-3, PL-4, PL-7, R-4).Server
PlayerStatePayload.supported_commandsacceptsvolume,muteandset_output_delay, withset_static_delaystill accepted under the existing spec-pr-164 tolerance. An empty list round-trips as[].ClientHelloPlayerSupport.supported_commandsis now optional, so a spec-shaped hello parses. Before this change, a hello without the field failed to parse and the client was disconnected.PlayerV1Role.state_supported_commandsis now the only place the role checks which commands a player accepts.set_volumeandset_mutefollow the latestclient/statelist, so a mid-session change takes effect without a reconnect. The list is reset on every connect, so no player command is sent before the connection's initialclient/state(spec Bump ruff from 0.15.16 to 0.15.17 #270).volumeormutedvalue reported without the matching command is now applied and carried onVolumeChangedEventas a read-only value. It is no longer flagged or discarded.initial_state_deviationschecks the initial state's own list. An initial player state that omitssupported_commandsis flagged.Client SDK
supported_commands.[]when there are no commands.player_support.supported_commandsare folded into the state list, so existing embedders keep working.server/commandwhose command is not in the last reported list is ignored and logged at debug level.Tolerances added (all marked
DEPRECATED(spec-pr-177), removed by #391)player@v1_support.supported_commandsis parsed (volume/mute only)models/player.py_flag_noncompliance; a strict server (allow_noncompliant_clients=False) rejects itserver/connection.pyclient/stateon (with or without a state list) and are merged with later state lists, since a pre-#177 state list only ever held delay commandsserver/roles/player/v1.py(on_client_state,_legacy_hello_commands)server/roles/player/v1.py(initial_state_deviations)player_support.supported_commandsinto the state list and strips it from the helloclient/client.py,client/connection.pyLegacy acceptance tests carry the same marker. The marker's
<version>is left for the maintainer to fill in.Known limitation of the merge: a client that declares volume/mute in its hello cannot withdraw them through
client/state. That client is already flagged as non-compliant.Out of scope
supported_commandswhen a player's list changes (Controller group volume and mute: exclude non-supporting players, trimsupported_commands, publish on membership change #383).client/state(Artwork channel configuration viaclient/state.artwork#370, Visualizer configuration viaclient/state.visualizer; hello keeps onlybuffer_capacity#371).Closes #368