[GH-ISSUE #1293] [Issue]: Illustrate button fails persistently after long chats (NovelAI) — 500/generic error, only a new chat recovers; sprite gen mostly fails #641

Closed
opened 2026-10-20 17:31:08 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @GetBeholder on GitHub (May 26, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1293

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Pressing "Illustrate" (including from the gallery) after a chat has run for a
while fails: the button spins much longer than usual and then errors (previously
HTTP 500, now a generic error). Once a chat hits this, the Illustrate button stops
working for that chat entirely — sometimes it reports "agent retry completed" but
produces no image. Deleting messages to reduce context does not help; the only fix
is starting a wholly new roleplay or GM game. The automatic illustrator agent
still works (more consistently with reference images turned off). The same problem
affects GM mode (inconsistent), and sprite generation almost always fails.
Provider: NovelAI. Confirmed by a second reporter; the reporter notes it has
persisted across several versions.

Expected behavior

The Illustrate button (and sprite generation) should keep working for a chat
regardless of how long it has run. A single failed image generation should not
permanently disable illustration for that chat, and the underlying error should be
surfaced clearly rather than as a generic error.

Actual behavior

  • Illustrate button: spins, then errors (was 500, now generic). After the first
    failure it no longer works for that chat; "agent retry completed" sometimes
    appears with no output.
  • Deleting messages / reducing context does not recover it; only a new chat does.
  • The automatic illustrator agent still works, and more consistently with
    reference images off.
  • GM mode is affected; sprite generation almost always fails.

Steps to reproduce

  1. RP or GM chat using a NovelAI image connection.
  2. Continue the chat for a while (the reporter tested across many context sizes —
    see Environment).
  3. Press Illustrate (in-chat or from the gallery).
  4. Observe a long spin, then an error; subsequent Illustrate presses for that chat
    fail (sometimes "agent retry completed" with no output).
  5. Confirm deleting messages doesn't help; starting a new chat restores
    illustration.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: v1.6.1 (reporter: persisted across several versions)
  • Run mode: Docker install (Docker runtime)
  • OS + version: Fedora Linux 44
  • Node + pnpm versions: not provided
  • Rust version, if relevant: not provided
  • Remote Runtime URL configured? Docker runtime in use
  • Provider, model, or integration: NovelAI image gen (connection context limit reportedly 0 / none). Illustrator agent prompting model "DS 4" or Sonnet 4.6; agent context 128k (also tested 250k / 500k / 15k / 5k); agent message limit 5. Sidecar 8192 (also 16k; reporter unsure it is used; also tried disabling). Second reporter: error 500 with output tokens 4096 (default) or 512 — no difference.

Logs, screenshots, or video

No logs/screenshots were provided beyond the error description. Capturing the
actual provider response/status for a failing Illustrate (the underlying 500 body
from NovelAI) would help, since the current generic error hides it.

Regression notes

Has persisted for the last several versions (reporter). A second reporter
(Solsgriz) says the gallery Illustrate button "stopped working completely several
versions ago." Previously surfaced as HTTP 500; now a generic error.

Additional context

Source: forum thread by Vasht (2-Star), 5/24/26 5:03 AM, with follow-up config
details (6:02 PM) and confirmation from Solsgriz (1-Star). Maintainer Marinara
[MARI] asked about context size; the reporter's testing shows context size does
not change the outcome (5k–500k all fail), which argues against a simple
context-overflow cause.

Triage pointers (from a scan, not from the reporter):

  • The Illustrate button is implemented as an illustrator-agent retry:
    handleIllustrate → retryAgents(activeChatId, ["illustrator"]) in
    src/features/modes/shared/chat-ui/hooks/use-chat-timeline-actions.ts
    (~L396-398). Failed agent types are tracked in src/shared/stores/agent.store.ts
    (failedAgentTypes). The "stops working until a new chat" behavior suggests a
    stuck/failed illustrator-agent state that retry does not clear and that deleting
    messages does not reset — worth checking against the recent failed-agent
    surfacing/clearing work (surface-failed-agents, retryAgents failure-clear).
  • NovelAI image requests have strict limits:
    src-tauri/src/commands/storage/images/providers.rs defines
    NOVELAI_V4_PROMPT_HINT — "NovelAI V4/V4.5 prompts support roughly 512 T5 tokens
    and reject most Unicode prompt characters." A long or non-ASCII generated image
    prompt (or a large reference-image payload) could cause NovelAI to reject the
    request (historically a 500). The reporter's note that disabling reference images
    makes the illustrator agent more reliable points at the reference-image payload
    as a contributor (cf. reference-image handling in #1275).
  • Sprite generation failing almost always likely shares this NovelAI provider path.
  • The shift from "HTTP 500" to "generic error" suggests provider error detail is
    being masked; surfacing the underlying status/body would aid diagnosis.

This is mode-spanning (RP + GM) via the shared illustrate / agent / provider
pipeline rather than a single mode.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @GetBeholder on GitHub (May 26, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1293 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Pressing "Illustrate" (including from the gallery) after a chat has run for a while fails: the button spins much longer than usual and then errors (previously HTTP 500, now a generic error). Once a chat hits this, the Illustrate button stops working for that chat entirely — sometimes it reports "agent retry completed" but produces no image. Deleting messages to reduce context does not help; the only fix is starting a wholly new roleplay or GM game. The automatic illustrator agent still works (more consistently with reference images turned off). The same problem affects GM mode (inconsistent), and sprite generation almost always fails. Provider: NovelAI. Confirmed by a second reporter; the reporter notes it has persisted across several versions. ## Expected behavior The Illustrate button (and sprite generation) should keep working for a chat regardless of how long it has run. A single failed image generation should not permanently disable illustration for that chat, and the underlying error should be surfaced clearly rather than as a generic error. ## Actual behavior - Illustrate button: spins, then errors (was 500, now generic). After the first failure it no longer works for that chat; "agent retry completed" sometimes appears with no output. - Deleting messages / reducing context does not recover it; only a new chat does. - The automatic illustrator agent still works, and more consistently with reference images off. - GM mode is affected; sprite generation almost always fails. ## Steps to reproduce 1. RP or GM chat using a NovelAI image connection. 2. Continue the chat for a while (the reporter tested across many context sizes — see Environment). 3. Press Illustrate (in-chat or from the gallery). 4. Observe a long spin, then an error; subsequent Illustrate presses for that chat fail (sometimes "agent retry completed" with no output). 5. Confirm deleting messages doesn't help; starting a new chat restores illustration. ## Impact area - [ ] App shell, navigation, startup, or providers - [ ] Catalog resources - [ ] Chat mode - [ ] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [x] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: v1.6.1 (reporter: persisted across several versions) - Run mode: Docker install (Docker runtime) - OS + version: Fedora Linux 44 - Node + pnpm versions: not provided - Rust version, if relevant: not provided - Remote Runtime URL configured? Docker runtime in use - Provider, model, or integration: NovelAI image gen (connection context limit reportedly 0 / none). Illustrator agent prompting model "DS 4" or Sonnet 4.6; agent context 128k (also tested 250k / 500k / 15k / 5k); agent message limit 5. Sidecar 8192 (also 16k; reporter unsure it is used; also tried disabling). Second reporter: error 500 with output tokens 4096 (default) or 512 — no difference. ## Logs, screenshots, or video No logs/screenshots were provided beyond the error description. Capturing the actual provider response/status for a failing Illustrate (the underlying 500 body from NovelAI) would help, since the current generic error hides it. ## Regression notes Has persisted for the last several versions (reporter). A second reporter (Solsgriz) says the gallery Illustrate button "stopped working completely several versions ago." Previously surfaced as HTTP 500; now a generic error. ## Additional context Source: forum thread by Vasht (2-Star), 5/24/26 5:03 AM, with follow-up config details (6:02 PM) and confirmation from Solsgriz (1-Star). Maintainer Marinara [MARI] asked about context size; the reporter's testing shows context size does not change the outcome (5k–500k all fail), which argues against a simple context-overflow cause. Triage pointers (from a scan, not from the reporter): - The Illustrate button is implemented as an illustrator-agent retry: `handleIllustrate` → `retryAgents(activeChatId, ["illustrator"])` in `src/features/modes/shared/chat-ui/hooks/use-chat-timeline-actions.ts` (~L396-398). Failed agent types are tracked in `src/shared/stores/agent.store.ts` (`failedAgentTypes`). The "stops working until a new chat" behavior suggests a stuck/failed illustrator-agent state that retry does not clear and that deleting messages does not reset — worth checking against the recent failed-agent surfacing/clearing work (`surface-failed-agents`, `retryAgents` failure-clear). - NovelAI image requests have strict limits: `src-tauri/src/commands/storage/images/providers.rs` defines `NOVELAI_V4_PROMPT_HINT` — "NovelAI V4/V4.5 prompts support roughly 512 T5 tokens and reject most Unicode prompt characters." A long or non-ASCII generated image prompt (or a large reference-image payload) could cause NovelAI to reject the request (historically a 500). The reporter's note that disabling reference images makes the illustrator agent more reliable points at the reference-image payload as a contributor (cf. reference-image handling in #1275). - Sprite generation failing almost always likely shares this NovelAI provider path. - The shift from "HTTP 500" to "generic error" suggests provider error detail is being masked; surfacing the underlying status/body would aid diagnosis. This is mode-spanning (RP + GM) via the shared illustrate / agent / provider pipeline rather than a single mode. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:31:08 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (May 27, 2026):

Fixed on refactor in 8058f66dd4: NovelAI V4/V4.5 prompts are sanitized and capped before provider calls, provider JSON errors are surfaced instead of a generic parse failure, and the Illustrator prompt was tightened to avoid huge character-description leakage. Validated with pnpm check and targeted Rust tests.

<!-- gh-comment-id:4555717987 --> @SpicyMarinara commented on GitHub (May 27, 2026): Fixed on refactor in 8058f66dd4affb1e74e4bdbce3b7d4580554fb9b: NovelAI V4/V4.5 prompts are sanitized and capped before provider calls, provider JSON errors are surfaced instead of a generic parse failure, and the Illustrator prompt was tightened to avoid huge character-description leakage. Validated with pnpm check and targeted Rust tests.
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#641
No description provided.