mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5163] [Issue]: Spotify search sends invalid limit values #2858
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#2858
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SpicyMarinara on GitHub (Aug 16, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5163
Originally assigned to: @SpicyMarinara, @kolacheee on GitHub.
Summary
Music DJ can send Spotify search limits above Spotify's maximum of 10, causing HTTP 400 errors. The standard Spotify search path permits up to 20, while artist and generic Spotify searches in Game mode can default to 50.
Expected behavior
Marinara should limit Spotify GET /search requests to 10 results per request and use offset-based pagination when more results are needed. The spotify_search tool schema should expose the maximum allowed value.
Actual behavior
The standard spotify_search path forwards limits from 1 through 20 directly to Spotify. In Game mode, artist and generic Spotify search paths can forward a default limit of 50, resulting in a Spotify API 400 "Invalid limit" response.
Steps to reproduce
Environment
Logs, screenshots, or video
Reported error:
Spotify API error (400): {"error": {"status": 400, "message": "Invalid limit" } }. No screenshots or video provided.Additional context
In
packages/server/src/services/tools/tool-executor.ts,spotifySearch()clamps the limit to 1–20 and forwards it unchanged. Thespotify_searchtool definition has no maximum forlimit. Ingame-spotify-music.service.ts, the limit defaults to 50 and is passed tosearchSpotifyTracks()for artist and generic Spotify search sources. According to the report, Spotify reduced the GET /search maximum to 10 in February 2026; requests requiring more results must paginate withoffset.Discord thread: Spotify returning 400 invalid limit
Discord thread link: https://discord.com/channels/1417099416812392641/1538648188225986580
Requested by: kolache (k0lache, Discord ID 220320261780668416)
Discord thread transcript (4 messages)
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@kolacheee commented on GitHub (Aug 16, 2026):
I am handling the Game Mode side of this issue in https://github.com/Pasta-Devs/Marinara-Engine/pull/5162
@SpicyMarinara commented on GitHub (Aug 16, 2026):
I'll take care of the RP one.
@kolacheee commented on GitHub (Aug 16, 2026):
The Game-mode half of this (the
game-spotify-music.service.tspath — artist and generic-search sources passing the candidate pool's default of 50 straight intoGET /search, deterministic 400 since Spotify's February 2026 cap of 10) is fixed in PR #5162:searchSpotifyTracksnow paginates in pages of 10 withoffsetup to the requested pool size, so the up-to-50 candidate semantics are preserved.The Roleplay half (
tool-executor.tsspotifySearchclamping 1–20 and forwarding unchanged, plus the tool definition's missingmaximum) remains open on this issue for its own fix.@kolacheee commented on GitHub (Aug 16, 2026):
Game mode half complete