[PR #4961] [MERGED] Fix preset regex imports and Spotify fallback playback #6554

Closed
opened 2026-10-23 04:11:31 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4961
Author: @SpicyMarinara
Created: 8/12/2026
Status: ✅ Merged
Merged: 8/13/2026
Merged by: @SpicyMarinara

Base: staging ← Head: agent/fix-regex-import-spotify-fallback


📝 Commits (3)

  • 3d4a84b fix regex imports and Spotify fallback playback
  • 2064cf1 address CodeRabbit review feedback
  • 07eb90b strengthen regex import regression

📊 Changes

6 files changed (+161 additions, -11 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/client/src/components/panels/PresetsPanel.tsx (+19 -7)
📝 packages/client/src/localization/locales/en.json (+1 -0)
📝 packages/server/src/services/generation/spotify-agent-runtime.ts (+19 -3)
📝 scripts/regressions/agent-runtime.regression.ts (+81 -1)
📝 scripts/regressions/assigned-issue-sweep.regression.ts (+40 -0)

📄 Description

Linked issues

Closes #4959
Closes #4960

Related: #4922 is already handled by draft PR #4923, so this sweep deliberately does not duplicate it.

Why this change

Two assigned bug reports shared a small user-facing failure mode: valid work was discarded after one unsupported or unavailable choice.

  • Preset regex import rejected an entire regex entry when its SillyTavern placement array contained an unsupported value, even though the supported placements could still be normalized.
  • Music DJ stopped after Spotify accepted a selected track but continued reporting the previous URI, so a single unavailable or otherwise unstartable candidate ended the deterministic fallback.

What changed

  • Preserve preset regex entries with unsupported SillyTavern placement values, ignore only those values, and show a localized warning.
  • Keep malformed regex entries and actual API failures on the existing skipped-entry path.
  • Give Music DJ one bounded alternate-candidate attempt after a Spotify URI-verification failure.
  • Do not broaden retries for authentication, device, or repeat-mode failures.
  • Add focused regressions and an Unreleased changelog entry.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Commands run:

  • pnpm install --frozen-lockfile
  • pnpm check
  • pnpm localization:check
  • pnpm regression:agent-runtime
  • pnpm regression:prompt
  • pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/assigned-issue-sweep.regression.ts

Manual verification notes

Manual verification still required before marking this PR ready:

  1. Import a preset regex containing both supported and unsupported SillyTavern placement values; confirm the regex is created and the ignored placement warning appears.
  2. Trigger Music DJ with a first Spotify candidate that is accepted but does not become the active URI; confirm exactly one alternate selection is attempted.
  3. Confirm authentication, missing-device, and repeat-mode failures do not trigger candidate switching.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] <paths> follow-up issue opened
  • Version/release files updated

An Unreleased changelog entry and the canonical English localization key are included. No user-facing documentation pages or version files changed.

UI evidence

Not attached. The UI change is limited to the existing regex import status area.

Summary by CodeRabbit

  • Bug Fixes
    • Preset regex imports now retain entries with unsupported SillyTavern placements and show a localized warning.
    • Spotify playback now retries with the next available candidate when track verification fails, while preserving successful playback behavior.
  • Tests
    • Added regression coverage for preset import warnings, retained regex entries, and Spotify fallback playback scenarios.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/4961 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/12/2026 **Status:** ✅ Merged **Merged:** 8/13/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `agent/fix-regex-import-spotify-fallback` --- ### 📝 Commits (3) - [`3d4a84b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3d4a84b99d8fee19ecf1d82cc1b697263616e927) fix regex imports and Spotify fallback playback - [`2064cf1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2064cf1d49f2fb5f7956e22d1756d61ace7dd424) address CodeRabbit review feedback - [`07eb90b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/07eb90b80288a65042f8a1c6f412724e24c660b5) strengthen regex import regression ### 📊 Changes **6 files changed** (+161 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/client/src/components/panels/PresetsPanel.tsx` (+19 -7) 📝 `packages/client/src/localization/locales/en.json` (+1 -0) 📝 `packages/server/src/services/generation/spotify-agent-runtime.ts` (+19 -3) 📝 `scripts/regressions/agent-runtime.regression.ts` (+81 -1) 📝 `scripts/regressions/assigned-issue-sweep.regression.ts` (+40 -0) </details> ### 📄 Description ## Linked issues Closes #4959 Closes #4960 Related: #4922 is already handled by draft PR #4923, so this sweep deliberately does not duplicate it. ## Why this change Two assigned bug reports shared a small user-facing failure mode: valid work was discarded after one unsupported or unavailable choice. - Preset regex import rejected an entire regex entry when its SillyTavern placement array contained an unsupported value, even though the supported placements could still be normalized. - Music DJ stopped after Spotify accepted a selected track but continued reporting the previous URI, so a single unavailable or otherwise unstartable candidate ended the deterministic fallback. ## What changed - Preserve preset regex entries with unsupported SillyTavern placement values, ignore only those values, and show a localized warning. - Keep malformed regex entries and actual API failures on the existing skipped-entry path. - Give Music DJ one bounded alternate-candidate attempt after a Spotify URI-verification failure. - Do not broaden retries for authentication, device, or repeat-mode failures. - Add focused regressions and an Unreleased changelog entry. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Commands run: - `pnpm install --frozen-lockfile` - `pnpm check` - `pnpm localization:check` - `pnpm regression:agent-runtime` - `pnpm regression:prompt` - `pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/assigned-issue-sweep.regression.ts` ### Manual verification notes Manual verification still required before marking this PR ready: 1. Import a preset regex containing both supported and unsupported SillyTavern placement values; confirm the regex is created and the ignored placement warning appears. 2. Trigger Music DJ with a first Spotify candidate that is accepted but does not become the active URI; confirm exactly one alternate selection is attempted. 3. Confirm authentication, missing-device, and repeat-mode failures do not trigger candidate switching. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n] <paths>` follow-up issue opened - [ ] Version/release files updated An Unreleased changelog entry and the canonical English localization key are included. No user-facing documentation pages or version files changed. ## UI evidence Not attached. The UI change is limited to the existing regex import status area. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Preset regex imports now retain entries with unsupported SillyTavern placements and show a localized warning. * Spotify playback now retries with the next available candidate when track verification fails, while preserving successful playback behavior. * **Tests** * Added regression coverage for preset import warnings, retained regex entries, and Spotify fallback playback scenarios. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:11:31 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6554
No description provided.