[PR #3930] [MERGED] Fix scoped Illustrator retries and empty-response fallback #6161

Closed
opened 2026-10-23 04:07:41 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3930
Author: @SpicyMarinara
Created: 7/21/2026
Status: ✅ Merged
Merged: 7/21/2026
Merged by: @SpicyMarinara

Base: staging ← Head: agent/fix-illustrator-retry-empty-fallback


📝 Commits (3)

  • 5fe831e Scope Illustrator visual retries
  • a2c36e7 Use fallback for empty model responses
  • 0e68de6 Address CodeRabbit review feedback

📊 Changes

12 files changed (+274 additions, -24 deletions)

View changed files

📝 package.json (+1 -1)
📝 packages/client/src/components/chat/ChatArea.tsx (+12 -1)
📝 packages/client/src/components/chat/RoleplayHUDActionsMenu.tsx (+1 -1)
📝 packages/client/src/hooks/use-generate.ts (+61 -10)
📝 packages/client/src/lib/agent-failures.ts (+32 -0)
📝 packages/client/src/stores/agent.store.ts (+2 -1)
📝 packages/server/src/routes/generate.routes.ts (+3 -0)
📝 packages/server/src/routes/generate/retry-agents-route.ts (+29 -1)
➕ packages/server/src/services/generation/illustrator-retry-targets.ts (+22 -0)
📝 packages/server/src/services/llm/connection-fallback-provider.ts (+12 -9)
➕ scripts/regressions/illustrator-visual-retry.regression.ts (+62 -0)
📝 scripts/regressions/provider-compat.regression.ts (+37 -0)

📄 Description

Why

Two generation failure paths currently do more work than users expect:

  • Retrying one failed Illustrator visual reruns both the roleplay illustration and automatic background.
  • A primary model can return an empty response after filtering without activating its configured fallback model.

The first behavior wastes an already successful image generation. The second can leave a turn without usable output despite a configured fallback.

Fixes #3929.

What changed

  • Preserve whether the Illustrator illustration or background generation failed and retry only the failed visual job.
  • Keep legacy unscoped Illustrator failures on the full retry path.
  • Activate the configured fallback for empty or whitespace-only successful streaming and non-streaming responses.
  • Preserve existing behavior for visible partial output, tool-call output, and user cancellation.
  • Add regressions for scoped Illustrator retries and empty-response fallback activation.

Validation performed

  • pnpm check
  • pnpm regression:providers
  • pnpm regression:roleplay

Test plan

  • Manually verify a failed Roleplay background retry does not create a second scene illustration.
  • Manually verify a failed Roleplay illustration retry does not regenerate the background.
  • Manually verify an empty primary response invokes the configured fallback model.
  • Manually verify a visible partial primary response is not replaced by fallback output.

Summary by CodeRabbit

  • New Features

    • Retry Illustrator failures for specific targets, including illustrations and scene backgrounds.
    • Added validation and clearer reporting for targeted retry requests.
    • Providers now fall back when responses are empty or contain only whitespace.
  • Bug Fixes

    • Improved preservation and deduplication of failure details across retries.
    • Corrected failure-item handling when multiple retry targets share an agent type.
  • Tests

    • Added regression coverage for targeted Illustrator retries and empty provider responses.

🔄 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/3930 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/21/2026 **Status:** ✅ Merged **Merged:** 7/21/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `agent/fix-illustrator-retry-empty-fallback` --- ### 📝 Commits (3) - [`5fe831e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5fe831eb29f72e65503e2b8c9a3e5971032ab248) Scope Illustrator visual retries - [`a2c36e7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a2c36e74c9f08c383bf7e8fdf0404da04f184fbe) Use fallback for empty model responses - [`0e68de6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0e68de6ad8efb5071a3a2bf639b7def0d85507fa) Address CodeRabbit review feedback ### 📊 Changes **12 files changed** (+274 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `package.json` (+1 -1) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+12 -1) 📝 `packages/client/src/components/chat/RoleplayHUDActionsMenu.tsx` (+1 -1) 📝 `packages/client/src/hooks/use-generate.ts` (+61 -10) 📝 `packages/client/src/lib/agent-failures.ts` (+32 -0) 📝 `packages/client/src/stores/agent.store.ts` (+2 -1) 📝 `packages/server/src/routes/generate.routes.ts` (+3 -0) 📝 `packages/server/src/routes/generate/retry-agents-route.ts` (+29 -1) ➕ `packages/server/src/services/generation/illustrator-retry-targets.ts` (+22 -0) 📝 `packages/server/src/services/llm/connection-fallback-provider.ts` (+12 -9) ➕ `scripts/regressions/illustrator-visual-retry.regression.ts` (+62 -0) 📝 `scripts/regressions/provider-compat.regression.ts` (+37 -0) </details> ### 📄 Description ## Why Two generation failure paths currently do more work than users expect: - Retrying one failed Illustrator visual reruns both the roleplay illustration and automatic background. - A primary model can return an empty response after filtering without activating its configured fallback model. The first behavior wastes an already successful image generation. The second can leave a turn without usable output despite a configured fallback. Fixes #3929. ## What changed - Preserve whether the Illustrator illustration or background generation failed and retry only the failed visual job. - Keep legacy unscoped Illustrator failures on the full retry path. - Activate the configured fallback for empty or whitespace-only successful streaming and non-streaming responses. - Preserve existing behavior for visible partial output, tool-call output, and user cancellation. - Add regressions for scoped Illustrator retries and empty-response fallback activation. ## Validation performed - `pnpm check` - `pnpm regression:providers` - `pnpm regression:roleplay` ## Test plan - [ ] Manually verify a failed Roleplay background retry does not create a second scene illustration. - [ ] Manually verify a failed Roleplay illustration retry does not regenerate the background. - [ ] Manually verify an empty primary response invokes the configured fallback model. - [ ] Manually verify a visible partial primary response is not replaced by fallback output. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Retry Illustrator failures for specific targets, including illustrations and scene backgrounds. * Added validation and clearer reporting for targeted retry requests. * Providers now fall back when responses are empty or contain only whitespace. * **Bug Fixes** * Improved preservation and deduplication of failure details across retries. * Corrected failure-item handling when multiple retry targets share an agent type. * **Tests** * Added regression coverage for targeted Illustrator retries and empty provider responses. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:07:41 +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#6161
No description provided.