[PR #3912] [MERGED] Background Illustrator generation without locking chat input #6155

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

📋 Pull Request Information

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

Base: staging ← Head: agent/background-illustrator-generation


📝 Commits (3)

  • d5b73c7 feat: background Illustrator image generation
  • e334c70 Align background illustration input feedback
  • ee4d017 Merge remote-tracking branch 'origin/staging' into codex/review-3912

📊 Changes

10 files changed (+238 additions, -139 deletions)

View changed files

📝 packages/client/src/components/chat/ChatInput.tsx (+17 -41)
📝 packages/client/src/components/chat/ConversationInput.tsx (+43 -84)
📝 packages/client/src/components/game/GameInput.tsx (+9 -7)
📝 packages/client/src/components/game/GameSurface.tsx (+17 -4)
📝 packages/client/src/hooks/use-generate.ts (+37 -3)
📝 packages/client/src/lib/generation-stream-policy.ts (+22 -0)
📝 packages/client/src/stores/chat.store.ts (+12 -0)
📝 packages/server/src/routes/generate.routes.ts (+4 -0)
📝 packages/server/src/routes/generate/retry-agents-route.ts (+4 -0)
📝 scripts/regressions/roleplay-streaming.regression.ts (+73 -0)

📄 Description

Linked issue

Closes #3911

Why this change

Chat composers should let users prepare their next response while agents work. Illustrator image generation is also independent after the assistant reply is complete, so it should not keep the composer or same-chat generation lock occupied while the image provider finishes.

What changed

  • Keep Conversation, Roleplay, and Game draft fields editable during ordinary generation and agent processing while Send and Enter-to-send remain guarded.
  • Mark automatic and Illustrator-only retry image work as a background tail once other reply work is complete.
  • Allow a new same-chat text generation to take ownership while the older Illustrator stream continues listening for completion.
  • Preserve the existing exact message/swipe attachment path and invalidate both messages and the chat Gallery when the image arrives.
  • Guard overlapping cleanup by AbortController identity so an older Illustrator task cannot clear a newer generation.
  • Add regression coverage for normal exclusivity, agent-only send blocking, editable draft fields, and Illustrator-tail overlap.

Validation

Automated evidence:

  • pnpm check — passed
  • pnpm regression:roleplay — passed
  • pnpm --filter @marinara-engine/server lint — passed serially

Human checklist (intentionally left unchecked):

  • 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

Not performed in a live provider session. Please manually verify:

  • Start an Illustrator-enabled reply, type while other agents are processing, and confirm Enter/Send does not submit yet.
  • Once only the image generation remains, send the prepared draft and confirm the next reply begins.
  • Confirm the completed image appears under the original assistant message and in Gallery, including after switching swipes.
  • Repeat with an Illustrator-only retry and in Conversation, Roleplay, and Game composers.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

No install, update, release, or configuration behavior changed.

UI evidence

No screenshots attached. This changes composer interaction state without introducing new visual UI.

Risk boundary

  • Risk type: generation ownership and agent-result delivery.
  • Entrypoints: main /generate stream and Illustrator-only retry stream.
  • Positive proof: policy regressions cover background-tail send/start allowance and editable Roleplay/Game draft fields.
  • Negative controls: normal active generations and agent-only retries remain send-blocking and same-chat exclusive.
  • Proof gap: no live image provider, network disconnect, or browser interaction was exercised in this worktree.

Summary by CodeRabbit

  • New Features

    • Improved generation status handling across chat and game inputs.
    • Added support for continuing to draft messages while background illustrations finish.
    • Added clearer input states and messaging, including “Prepare your next move...”.
    • Illustration progress is now reflected immediately in the interface.
  • Bug Fixes

    • Prevented conflicting submissions while agents or illustration generation are still processing.
    • Improved cleanup of illustration-processing states after completion or retry.

🔄 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/3912 **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/background-illustrator-generation` --- ### 📝 Commits (3) - [`d5b73c7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d5b73c706aee4c7e90ab418d3f98eaf9d6de11f9) feat: background Illustrator image generation - [`e334c70`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e334c709feedb8533ca9487783a4c7c61586d303) Align background illustration input feedback - [`ee4d017`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ee4d01753095bca924751e9cad3b1ab043277a7e) Merge remote-tracking branch 'origin/staging' into codex/review-3912 ### 📊 Changes **10 files changed** (+238 additions, -139 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatInput.tsx` (+17 -41) 📝 `packages/client/src/components/chat/ConversationInput.tsx` (+43 -84) 📝 `packages/client/src/components/game/GameInput.tsx` (+9 -7) 📝 `packages/client/src/components/game/GameSurface.tsx` (+17 -4) 📝 `packages/client/src/hooks/use-generate.ts` (+37 -3) 📝 `packages/client/src/lib/generation-stream-policy.ts` (+22 -0) 📝 `packages/client/src/stores/chat.store.ts` (+12 -0) 📝 `packages/server/src/routes/generate.routes.ts` (+4 -0) 📝 `packages/server/src/routes/generate/retry-agents-route.ts` (+4 -0) 📝 `scripts/regressions/roleplay-streaming.regression.ts` (+73 -0) </details> ### 📄 Description ## Linked issue Closes #3911 ## Why this change Chat composers should let users prepare their next response while agents work. Illustrator image generation is also independent after the assistant reply is complete, so it should not keep the composer or same-chat generation lock occupied while the image provider finishes. ## What changed - Keep Conversation, Roleplay, and Game draft fields editable during ordinary generation and agent processing while Send and Enter-to-send remain guarded. - Mark automatic and Illustrator-only retry image work as a background tail once other reply work is complete. - Allow a new same-chat text generation to take ownership while the older Illustrator stream continues listening for completion. - Preserve the existing exact message/swipe attachment path and invalidate both messages and the chat Gallery when the image arrives. - Guard overlapping cleanup by AbortController identity so an older Illustrator task cannot clear a newer generation. - Add regression coverage for normal exclusivity, agent-only send blocking, editable draft fields, and Illustrator-tail overlap. ## Validation Automated evidence: - `pnpm check` — passed - `pnpm regression:roleplay` — passed - `pnpm --filter @marinara-engine/server lint` — passed serially Human checklist (intentionally left unchecked): - [ ] `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 Not performed in a live provider session. Please manually verify: - Start an Illustrator-enabled reply, type while other agents are processing, and confirm Enter/Send does not submit yet. - Once only the image generation remains, send the prepared draft and confirm the next reply begins. - Confirm the completed image appears under the original assistant message and in Gallery, including after switching swipes. - Repeat with an Illustrator-only retry and in Conversation, Roleplay, and Game composers. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) No install, update, release, or configuration behavior changed. ## UI evidence No screenshots attached. This changes composer interaction state without introducing new visual UI. ## Risk boundary - Risk type: generation ownership and agent-result delivery. - Entrypoints: main `/generate` stream and Illustrator-only retry stream. - Positive proof: policy regressions cover background-tail send/start allowance and editable Roleplay/Game draft fields. - Negative controls: normal active generations and agent-only retries remain send-blocking and same-chat exclusive. - Proof gap: no live image provider, network disconnect, or browser interaction was exercised in this worktree. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Improved generation status handling across chat and game inputs. - Added support for continuing to draft messages while background illustrations finish. - Added clearer input states and messaging, including “Prepare your next move...”. - Illustration progress is now reflected immediately in the interface. - **Bug Fixes** - Prevented conflicting submissions while agents or illustration generation are still processing. - Improved cleanup of illustration-processing states after completion or retry. <!-- 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:36 +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#6155
No description provided.