mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #4615] [Issue]: Avoid repeated full-context LLM requests in Spotify Music DJ tool rounds #2521
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#2521
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 4, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4615
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Spotify Music DJ tool use can make multiple sequential LLM requests for one agent run, resending the large agent prompt plus an increasingly long tool transcript on every round. One observed run made four real provider calls and consumed 78,934 total tokens, rather than performing one extraction/planning request followed by bounded server-side Spotify work.
Expected behavior
Music DJ selection should avoid repeatedly sending the full agent context to the model. Prefer one planning/extraction request with deterministic server-side Spotify tool execution where possible. One returned JSON list with songs.
If a follow-up model round is genuinely required, it should be tightly bounded, minimize repeated context and tool payloads, and make the resulting request count and token cost clear in debug output.
Actual behavior
executeAgentWithToolscallsprovider.chatComplete(loopMessages, ...)once per tool round. When the model returns tool calls, the Engine executes them, appends the assistant tool-call message and tool results toloopMessages, then sends the entire growing message list again.The observed Music DJ run issued four sequential requests with prompt sizes of 17,531, 17,706, 21,290, and 21,689 tokens. The configured global tool-loop default permits up to 100 rounds.
Steps to reproduce
request round N/response round Npairs for the same Music DJ run, with the prompt token count repeated and growing each round.Environment
Logs, screenshots, or video
Across the four calls:
Additional context
This is Marinara Engine host-orchestration behavior: the Engine owns the tool loop, request construction, context replay, and compatibility handling even though Music DJ is a downloadable agent.
The current debug
durationMsfor each round is cumulative from the beginning of the agent run, not the duration of that individual request. Preserve a clear end-to-end measurement while making per-round request cost understandable.Add regression coverage that records the provider call count and verifies the prompt/context passed to any necessary follow-up round.
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: