[PR #8484] [MERGED] fix(llm): fall back from explicit unsupported-image HTTP 500 #8627

Closed
opened 2026-11-07 16:46:04 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8484
Author: @SpicyMarinara
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/8470-lorebook-image-500-fallback


📝 Commits (2)

  • c1c5ec1 test(llm): reproduce explicit image incompatibility 500
  • af75d49 fix(llm): retry explicit unsupported image HTTP 500 as text

📊 Changes

2 files changed (+118 additions, -2 deletions)

View changed files

📝 packages/server/src/services/llm/lorebook-image-provider.ts (+1 -1)
📝 scripts/regressions/lorebook-image-prompt.regression.ts (+117 -1)

📄 Description

Linked issue

Closes #8470

Why this change

Text-only llama.cpp endpoints can report “image input is not supported” as HTTP 500. Lorebook reference images then abort the whole reply instead of using the existing text-only fallback.

What changed

  • Allow HTTP 500 through the existing explicit unsupported-image classifier. The error still needs image/vision language and an unsupported-input explanation.
  • Preserve lorebook text, captions, unrelated chat attachments, and the existing skipped-image notice.
  • Keep generic server errors, HTTP 503, authentication/rate-limit failures, network errors, cancellation, delivered output, and protected attachments outside this retry. A failed text retry is not repeated.

Validation

Final head: af75d497170fa46dedc8b53be8887e4df425f16c.

  • pnpm check: passed, including localization, formatting, workspace lint/types, E2E types, token-estimation types, and production builds. One existing Hook dependency warning remains in the unchanged HomeProfessorMariChat.
  • node scripts/run-regressions.mjs --filter scripts/regressions/lorebook-image-prompt.regression.ts: passed. The same real-wrapper regression first reproduced the reported 500 on staging; the repaired stream/nonstream cases and boundary controls pass.
  • pnpm regression:prompt: all three regression scripts passed.
  • Local CodeRabbit reviewed both changed files against origin/staging at this committed head and completed with zero findings.

The provider errors are controlled fixtures through the actual compatibility wrapper. No live llama.cpp/provider, container, or browser run is claimed.

  • 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

Manual verification notes

  • Manually verify a text-only llama.cpp connection continues a reply with lorebook text/captions and the existing skipped-image notice.
  • Manually verify an unrelated provider failure remains visible.

Docs and release impact

No UI labels, provider settings, prompt content, release files, or documentation change. This restores the existing compatibility policy for another explicit endpoint error status.

  • No docs changes needed
  • Updated docs as needed
  • Translated docs updated or follow-up issue opened
  • Version/release files updated

UI evidence (if applicable)

No UI change.


🔄 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/8484 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/8470-lorebook-image-500-fallback` --- ### 📝 Commits (2) - [`c1c5ec1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c1c5ec17adf8fb5eb826d836a77e5b0384f1be6b) test(llm): reproduce explicit image incompatibility 500 - [`af75d49`](https://github.com/Pasta-Devs/Marinara-Engine/commit/af75d497170fa46dedc8b53be8887e4df425f16c) fix(llm): retry explicit unsupported image HTTP 500 as text ### 📊 Changes **2 files changed** (+118 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/llm/lorebook-image-provider.ts` (+1 -1) 📝 `scripts/regressions/lorebook-image-prompt.regression.ts` (+117 -1) </details> ### 📄 Description ## Linked issue Closes #8470 ## Why this change Text-only llama.cpp endpoints can report “image input is not supported” as HTTP 500. Lorebook reference images then abort the whole reply instead of using the existing text-only fallback. ## What changed - Allow HTTP 500 through the existing explicit unsupported-image classifier. The error still needs image/vision language and an unsupported-input explanation. - Preserve lorebook text, captions, unrelated chat attachments, and the existing skipped-image notice. - Keep generic server errors, HTTP 503, authentication/rate-limit failures, network errors, cancellation, delivered output, and protected attachments outside this retry. A failed text retry is not repeated. ## Validation Final head: `af75d497170fa46dedc8b53be8887e4df425f16c`. - `pnpm check`: passed, including localization, formatting, workspace lint/types, E2E types, token-estimation types, and production builds. One existing Hook dependency warning remains in the unchanged HomeProfessorMariChat. - `node scripts/run-regressions.mjs --filter scripts/regressions/lorebook-image-prompt.regression.ts`: passed. The same real-wrapper regression first reproduced the reported 500 on staging; the repaired stream/nonstream cases and boundary controls pass. - `pnpm regression:prompt`: all three regression scripts passed. - Local CodeRabbit reviewed both changed files against `origin/staging` at this committed head and completed with zero findings. The provider errors are controlled fixtures through the actual compatibility wrapper. No live llama.cpp/provider, container, or browser run is claimed. - [ ] `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` ### Manual verification notes - Manually verify a text-only llama.cpp connection continues a reply with lorebook text/captions and the existing skipped-image notice. - Manually verify an unrelated provider failure remains visible. ## Docs and release impact No UI labels, provider settings, prompt content, release files, or documentation change. This restores the existing compatibility policy for another explicit endpoint error status. - [ ] No docs changes needed - [ ] Updated docs as needed - [ ] Translated docs updated or follow-up issue opened - [ ] Version/release files updated ## UI evidence (if applicable) No UI change. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:46:04 +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#8627
No description provided.