mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6971] [MERGED] fix(llm): let slow local models take more than two minutes for the first token #7411
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#7411
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6971
Author: @SpicyMarinara
Created: 10/2/2026
Status: ✅ Merged
Merged: 10/2/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/mari-first-token-timeout📝 Commits (2)
d145ab2fix(llm): wait for the first token as long as the text timeout allowsce9ffa0test: use fixed routes in the first-chunk timeout regression📊 Changes
4 files changed (+44 additions, -7 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
docs/CONFIGURATION.md(+1 -1)📝
packages/server/src/services/llm/base-provider.ts(+10 -6)➕
scripts/regressions/llm-first-chunk-timeout.regression.ts(+32 -0)📄 Description
Linked issue
Closes #6970
Why this change
Professor Mari on a slow local model gave up if the first token took more than two minutes, and that limit wasn't documented or adjustable.
The limit was a fixed 2-minute wait between streamed chunks (
LLM_BODY_TIMEOUTinbase-provider.ts), used by every call without a timeout of its own. A local server like llama.cpp or KoboldCPP usually sends its response headers right away and then spends minutes reading a long prompt, and Mari's prompts are long. So the wait for the first token was capped at two minutes. Chats didn't have this problem, because their calls already use the configurable chat timeout.What changed
base-provider.ts: the shared wait between chunks, including the wait for the first token, now followsCHAT_GENERATION_TIMEOUT_MS, the same setting that already decided the headers wait. In the app, that's Settings → Request timeouts → Text generation, 5 minutes by default and adjustable from 10 seconds to 1 hour. It stays finite, so half-open streams still can't hang forever.docs/CONFIGURATION.md: says the setting covers Professor Mari and other background calls, for both the first token and the gap between chunks.llm-first-chunk-timeout.regression.ts: a test server sends headers at once and the first chunk later. With the setting at 10 seconds, a 3-second first chunk arrives and a 12-second one is cut off. The old fixed two minutes let the 12-second one through, so the test fails without the fix.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
What I ran (not a replacement for the checklist):
Checks:
pnpm checkpasses.New regression: passes, and fails without the fix.
Existing regressions:
request-timeoutsandshutdown-deadlinepass.Local CodeRabbit: 0 findings.
To check by hand:
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)docs/CONFIGURATION.mdhas one updated row. The translated packs will follow in adocs-i18nPR.UI evidence (if applicable)
Server-side only; the existing Text generation setting now covers this.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.