Commit Graph
5 Commits
Author SHA1 Message Date
bhethermanandClaude Sonnet 5 d1b27ab7b8 Restore correct room ID mapping, fix select_source race in wait guard
Validate / Validate with HACS (push) Canceled after 0s
Validate / Validate with Hassfest (push) Canceled after 0s
Confirmed by direct hardware check: a334c8ba...=Bedroom, d0166d6f...=
Living Room -- the swap from two commits ago was right, my revert of
it was wrong.

The actual bug behind the last "Living Room played in Bedroom" report
was that the wait loop before play_media only checked supported_features
(is play_media possible at all), not whether select_source's target had
actually taken effect -- so if some other device was already active
from earlier testing, the feature-gate could pass immediately while
Spotify was still routing to that old device. Now the loop also waits
for the source attribute to match the requested room's ID before
proceeding.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-05 14:47:36 -04:00
bhethermanandClaude Sonnet 5 428579244a Revert room ID mapping swap -- original direction was correct
The prior swap (a334...=Bedroom, d0166...=Living Room) was based on a
misdiagnosis: pre-fix, the cold-start race meant play_media could fire
before select_source's device transfer had actually completed, so
playback landed on whatever device was already active rather than the
requested room -- that looked like "backwards IDs" but wasn't. Now
that the race is fixed, select_source reliably lands wherever it's
told, which is exactly what exposed the swap as wrong: a live test
asking for Living Room played in the Bedroom. Reverting to the
original mapping (a334...=Living Room, d0166...=Bedroom).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-05 14:33:51 -04:00
bhethermanandClaude Sonnet 5 291f526a84 Disambiguate play_music vs queue_music by verb, not content type
queue_music's tool description explains at length that playlists/
albums/artists auto-play instead of queueing, and the small model was
using that as a signal to route ANY playlist/genre request through
queue_music -- even ones that said "play". Verified: "play jazz in
the bedroom" called queue_music 0/5 reps before this change (and in
the opaque-ID room variant), 5/5 play_music after, with no
regressions across the rest of the suite (199/200, 39/40 reliable).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-05 14:01:44 -04:00
bhethermanandClaude Sonnet 5 2ed1ca1e99 Fix cold-start play_media failure and swap reversed room IDs
The Spotify integration only exposes the media_player.play_media
service once it has an active playback context, which doesn't exist
yet on a cold start; the fixed 2s delay after select_source wasn't
long enough in that case even though it always worked once something
had already played. Poll supported_features for the PLAY_MEDIA bit
(up to 8s) before calling play_media instead of guessing a fixed delay.

Also swap the Living Room/Bedroom source_list ID mapping in both the
prompt (for display) and the functions (for select_source) -- it was
backwards.

Adds a test-harness regression case exercising the opaque Spotify
Connect device IDs the source_list actually reports.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-05 13:40:40 -04:00
bhetherman 7249919006 Add tool-call disambiguation test harness for search_spotify/control_playback
Validate / Validate with HACS (push) Canceled after 0s
Validate / Validate with Hassfest (push) Canceled after 0s
Renders the Extended OpenAI Conversation prompt/function definitions and
checks the model's first tool-call choice against test phrases, bypassing
Home Assistant.
2026-08-31 00:46:53 -04:00