Send track ids on the queue command, not track objects - #124
Merged
Conversation
The Mac client merged in familiar-apple #87 decodes a queue command as {"type":"queue","track_ids":[...]}, and the server was still sending "tracks". PlaybackCommand.decode returns nil for a frame without track_ids, so queueing would have silently done nothing — the command would arrive, be ignored, and the tool would still report delivered: true. This change was written while building the Mac side and never committed, so #121 merged without it. Caught by `git status` complaining during --delete-branch, which is a poor substitute for noticing. Ids are the right shape regardless. The clients already fetch tracks by id through the generated client — ServerTrackMetadataSource.loadTracks(ids:) on the Mac, fifty at a time — and a second, untyped copy of the Track shape on this channel is exactly the hand-parsed surface ADR-0007 exists to prevent, which already cost ADR-0022 a bug. The tool's reply still carries the resolved tracks, because that is for the model to read. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
A mismatch between two things merged an hour apart.
The Mac client merged in
familiar-apple#87 decodes a queue command as{"type":"queue","track_ids":[...]}. The server merged in #121 was still sending"tracks".PlaybackCommand.decodereturnsnilfor a queue frame withouttrack_ids, so queueing would have silently done nothing — the command arrives, is ignored, and the tool still reportsdelivered: true. Exactly the failure shape this whole channel was built to avoid.I wrote this change while building the Mac side and never committed it, so #121 merged without it. It surfaced because
--delete-branchcomplained about a dirty tree, which is a poor substitute for noticing.Ids are the right shape regardless
The clients already fetch tracks by id through the generated client —
ServerTrackMetadataSource.loadTracks(ids:)on the Mac, fifty at a time, the same path a queue restored from disk uses. A second, untyped copy of the Track shape on this channel is precisely the hand-parsed surface ADR-0007 exists to prevent, and that tradeoff already cost ADR-0022 a bug.The tool's reply still carries the resolved tracks, because that part is for the model to read.
Verification
17 tests pass; the queue test now asserts
track_idsexplicitly, with the reason in the assertion message. Lint clean.Needs to land before any end-to-end test of playback — without it, "play something" reaches the Mac and does nothing.
🤖 Generated with Claude Code