Skip to content

Send track ids on the queue command, not track objects - #124

Merged
jeffcrouse merged 1 commit into
mainfrom
fix/queue-command-track-ids
Aug 9, 2026
Merged

Send track ids on the queue command, not track objects#124
jeffcrouse merged 1 commit into
mainfrom
fix/queue-command-track-ids

Conversation

@jeffcrouse

Copy link
Copy Markdown
Member

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.decode returns nil for a queue frame without track_ids, so queueing would have silently done nothing — the command arrives, is ignored, and the tool still reports delivered: 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-branch complained 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_ids explicitly, 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

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>
@jeffcrouse
jeffcrouse merged commit 52b78ba into main Aug 9, 2026
13 checks passed
@jeffcrouse
jeffcrouse deleted the fix/queue-command-track-ids branch August 17, 2026 13:16
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.

1 participant