mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #4647] [MERGED] fix(noodle): stop image captioning from blocking its own background refresh #6454
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#6454
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/4647
Author: @Gunterlie
Created: 8/5/2026
Status: ✅ Merged
Merged: 8/5/2026
Merged by: @Gunterlie
Base:
staging← Head:fix/4642-noodle-background-captioning📝 Commits (4)
1ee22ebfix(noodle): stop image captioning from blocking its own background refresh9b04da7Merge branch 'staging' into fix/4642-noodle-background-captioning2e47b6afix(generation): restore the unaccounted admission mode and scope the captioning exemption318ee9cMerge remote-tracking branch 'origin/fix/4642-noodle-background-captioning' into fix/4642-noodle-background-captioning📊 Changes
4 files changed (+108 additions, -2 deletions)
View changed files
📝
packages/server/src/routes/noodle.routes.ts(+1 -0)📝
packages/server/src/services/generation/connection-admission.ts(+9 -2)📝
packages/server/src/services/generation/image-captioning-runtime.ts(+13 -0)📝
scripts/regressions/provider-compat.regression.ts(+85 -0)📄 Description
Linked issue
Closes #4642
Why this change
Scheduled Noodle refreshes have been failing since 2.4.1 with
Connection <id> is not available for background generation, while manual refreshes keep working. The reporter's schedule sat at 0/6 slots indefinitely, and recreating connections only produced a new id with the same failure.The message is misleading: it means "busy", not "missing", so the reported hunt for an absent
data/connectionsfolder was a red herring.A refresh captions the images already on the timeline before generating new posts (
noodle-public-prompt.service.ts:491, inside the prompt built atnoodle-public-generation.service.ts:246, before the generation call at :302). The captioning provider was built with no admission mode, sowithConnectionFallbackProviderdefaulted it to{kind:"foreground"}. With the default "Use Noodle generation connection" captioning setting, that books a foreground slot on the exact connection the refresh is about to generate with. Releasing a foreground slot stampslastForegroundFinishedAt, and background admission refuses forBACKGROUND_CONNECTION_IDLE_MS(30s) afterwards — so the refresh is refused by its own captioning pass, every scheduled run. Manual refreshes are foreground end to end and never reach that gate; the scheduler's 409 retry reproduces the same self-collision a minute later, forever.Confirmed with the reporter: disabling image captioning makes scheduled refreshes fire again.
What changed
resolveImageCaptioningRuntimetakes the caller's admission mode; underbackgroundthe captioning provider books nothing ({kind:"none"}). Captioning is a step inside the caller's attempt, not a separate attempt, and the caller's own admission already gates it. Foreground behavior is unchanged, so chat captioning (generate.routes.ts:1098) is unaffected.admissionModeForRequest(req.headers)into the captioning runtime.provider-compat.regression.ts: captioning under background admission must leave the connection's background slot free; under foreground it must still take it.Swept the rest of the scheduled path for other foreground-booking calls on the same connection — ambient profile generation is route-only, NoodleR services are not on this path, lorebook context is
previewOnly. Captioning was the only one.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Nothing in this PR has been executed.
pnpm checkandpnpm regression:providershave not been run, and the new regression case has never been run even once — it is unverified in both directions. Needed before merge:pnpm check.pnpm regression:providerson this branch, and onstagingto confirm the new case actually fails without the fix.Note the current regression covers the captioning seam (does captioning book a foreground slot), not the reported symptom (does a scheduled refresh complete). A refresh-level case using the
noodle-refresh-transaction/noodle-schedulerharness would be the stronger test and is not included here.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Summary by CodeRabbit
Bug Fixes
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.