Skip to content

Add preferred_language pref and route mood shifts to steer_session - #92

Merged
randileeharper merged 1 commit into
mainfrom
feat/preferred-language-pref
Jun 28, 2026
Merged

Add preferred_language pref and route mood shifts to steer_session#92
randileeharper merged 1 commit into
mainfrom
feat/preferred-language-pref

Conversation

@randileeharper

Copy link
Copy Markdown
Owner

Summary

Fixes #91.

Two related fixes for session-steering behavior and music language preference.

1. Music language preference (config + playlist selection)

Adds a preferred_language config setting (list[str] | None) that biases playlist selection toward the user's preferred language(s) without polluting the Apple Music search term.

  • preferred_language accepts a comma-separated string ("english, spanish") or a list; empty entries are dropped.
  • Surfaced in the playlist-selection Context only — the step where candidate playlist names/descriptions are visible. The session-planner search term stays clean of language qualifiers, which previously corrupted retrieval (e.g. "upbeat english-language maintanin contemporary pop for morning").
  • playlist_selection.txt prefers playlists matching preferred_languages, with an explicit per-request language override (e.g. "k-pop", "spanish pop") taking precedence over the default.

2. Steer on mood/energy shift (resolver prompt)

Tightened resolver.txt so that a mood/energy/direction shift on an active session routes to steer_session with search_update {"mode": "replace"} instead of play_session, which was causing the same queue to regenerate on repeated steering attempts (e.g. "switch to something upbeat" was starting a new session rather than steering).

Test commands run

.venv/bin/python -m compileall vesper tests
.venv/bin/python -m pytest -q

All 250 tests pass.

To activate

Add to your config file:

{ "preferred_language": ["english"] }

or export VESPER_PREFERRED_LANGUAGE="english", then restart the service.

- Add Settings.preferred_language (list[str] | None); accept comma-separated
  string or list, drop empties. Surface in sanitized() output.
- Surface preferred_languages in the playlist-selection Context only, where
  candidate playlist names/descriptions are visible. The session planner
  search term stays clean of language qualifiers to avoid polluting
  retrieval (which previously produced corrupted terms like 'maintanin').
- playlist_selection.txt: prefer playlists matching preferred_languages,
  with an explicit per-request language override (k-pop, spanish pop)
  taking precedence over the default.
- resolver.txt: broaden steer_session to cover mood/energy/direction shifts
  on an active session so a vibe change routes to steer_session with
  search_update mode replace instead of regenerating the queue via
  play_session.

Refs #91
@randileeharper
randileeharper merged commit e38e4d6 into main Jun 28, 2026
1 check passed
@randileeharper
randileeharper deleted the feat/preferred-language-pref branch June 28, 2026 15:17
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.

Resolvable music language preference leaks into search terms and playlist selection

1 participant