Repository navigation
Conversation
Play-now called Play and ignored the error when AddURIToQueue left out FirstTrackNumberEnqueued, so the command exited 0 without selecting the new queue item. Return that omission instead. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR returns an actionable error when Spotify or SMAPI play-now enqueues an item without receiving its queue position. Example: Run sonos open spotify:track:abc123 while older items remain queued, and the speaker omits FirstTrackNumberEnqueued.
Review scores
ProductKind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: it addresses a current false-success path, and the updated error resolves the previous recovery-message finding. Priority: P2 Decision needed
Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherCLI playback commands pass Spotify references or SMAPI items to the Sonos client, which enqueues them through SOAP and selects a reported queue position before playback. flowchart TD
A[CLI playback command] --> B[Spotify or SMAPI enqueue]
B --> C[Speaker AddURIToQueue]
C --> D[Shared playback decision]
D --> E[Known position selects queue and plays]
D --> F[Missing position returns recovery error]
Technical reviewBest possible solution: Keep one shared play-now decision that selects only a known queue position and otherwise preserves the queue with actionable recovery guidance. Do we have a high-confidence way to reproduce the issue? The current-main source establishes the failure path: an omitted field becomes position zero, then both play-now implementations discard the result of bare Play and return success; no runtime reproduction was run during this read-only review. Is this the best way to solve the issue? The shared helper is a focused repair using the existing queue playback owner, and it correctly avoids borrowing the favorites-only track-1 fallback. AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning medium; reviewed against 63f57580a780. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 7, 2026, 6:01 PM ET / 23:01 UTC (Revision 2). |
Playback stops before Play when the speaker omits the new queue index. The error now says the track is already queued and names sonos queue list and sonos queue play. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
|
@clawsweeper re-review Head 161dcb7 says playback was not started, the track is already on the queue, and the next commands are sonos queue list and sonos queue play . |
|
🦞👀 Re-review progress:
|
What Problem This Solves
sonos open,play-spotifywithout--enqueue, and SMAPI--openenqueue with play-now. WhenAddURIToQueueomitsFirstTrackNumberEnqueued, those commands calledPlayand ignored its error, then returned success.Playdoes not select the new queue item. The command could exit 0 while the new item never started.Favorites already treat a missing index as track 1 only because they clear the queue first. An ordinary enqueue does not, so track 1 can be an older item. The track is already on the queue when the position is missing, so the error has to say that playback did not start and how to play the queued item.
Evidence
Before this change, Spotify and SMAPI play-now with an empty
FirstTrackNumberEnqueuedreturned no error:The speaker client answered
Playwith HTTP 200, so the old path reported success. After this change, both calls return this error and do not sendPlayorSeek:A response that includes track 7 still seeks that track and plays it.
Real behavior proof
161dcb7. No Sonos speaker was on the network. A local HTTP speaker answeredAddURIToQueuewithoutFirstTrackNumberEnqueuedand would have acceptedPlay.go test -count=1 -run 'TestClientEnqueueSpotify_PlayNowMissingTrackNumber|TestEnqueueSMAPIItem_PlayNowMissingTrackNumber|TestStartEnqueuedPlaybackMissingPosition|TestClientEnqueueSpotify_PlayNowTrack|TestEnqueueSMAPIItem$' ./internal/sonos/PlayorSeek.sonos queue listandsonos queue play <pos>. A reported track number still selects that queue item.FirstTrackNumberEnqueuedwas not on the network.Description
EnqueueSpotifyandEnqueueSMAPIItemsharestartEnqueuedPlayback. A positive track number still usesplayFromQueueTrack. A missing number is returned to the caller with the queue list and queue play commands.