[GH-ISSUE #6694] [Feature]: Generation jobs that survive a closed tab, and an optional Windows console tray icon #3749

Closed
opened 2026-10-21 06:06:47 +07:00 by bsakaguchi · 1 comment
Owner

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

Originally assigned to: @SpicyMarinara on GitHub.

Part of the contribution roadmap in #6624 (package G).

What problem does this solve?

  • Closing or reloading the tab ends a long avatar, sprite or video generation, and there is no record of what happened or whether it finished.
  • On Windows the server console sits in the taskbar the whole time the server runs, and closing it is the only obvious way to stop the server.

Proposed solution

Keep generating when the tab is closed (generationJobTracking):

  • Gallery images, selfies, scene videos and backgrounds, character avatar and sheet drafts, sprite sheets and animated expression sprites run through the existing generation entry points, wrapped in one server-side job runner with its own timeout and cancel.
  • Each job keeps a small record (status, timings, result link, a stable error code and a short trail of ids and timings, never prompts). A restart marks running jobs as interrupted and never re-runs them. Records go with their chat and follow retention limits.
  • A jobs viewer lists recent jobs with status, error code, result preview and Stop, and one toast after a reload announces jobs that finished while the user was away.

Minimize the console to the system tray (consoleTray, Windows only):

  • A small hidden PowerShell helper (no native modules) shows a tray icon with Open, Show or hide console, and Quit, which runs the normal graceful shutdown. Under Windows Terminal the icon is shown but the console is never hidden.

How it's switched: both are off by default in Settings > Advanced > Features. With job tracking off, each route runs its work exactly as today, every new route answers 404, and no folder, table row, timer or log line is created. With the tray off, nothing starts. MARINARA_CONSOLE_TRAY can also set the tray.

  • Areas touched (for spotting overlap):
    • packages/server/src/routes: gallery, backgrounds, sprites, characters, admin (chat wipe), and a new generation-jobs route
    • packages/server/src/services/generation: new job runner and tracker
    • packages/server/src/db/schema and services/storage: a new generation_job_records table and its storage
    • packages/server/src/services/console-tray and assets/console-tray.ps1 (new)
    • Client: a new generation-jobs component folder, GenerationJobsModal, AppShell and ModalRenderer hooks, Features settings, en.json
    • Docs: docs/development/generation-jobs.md, docs/configuration
  • Size: about 35 files, about 4,100 added lines, including regressions.
  • Status: implemented and tested in a fork, on Windows and on Linux (WSL, the CI-equivalent run).

Alternatives considered

  • Retrying interrupted jobs after a restart: rejected, because it could spend paid image or video calls without the user asking.
  • A native tray module: rejected to keep the install free of native builds; the PowerShell helper is enough for a menu and an icon.

Additional context

  • Package D also touches the gallery, backgrounds and sprites routes, and package E the characters route. Whichever merges second will rebase; no behaviour conflicts are expected.
  • A command for opening the jobs viewer could be offered to the Omnibar work later, once both are in.
  • Implementation depends on #6647 (foundations); PRs will follow once it merges, one package at a time.
  • If you're working in any of these areas, please comment so we can coordinate before a PR.

Screenshots

Taken from the fork build with invented demo data (characters, lorebooks and a campaign made up for these shots). Model replies and token counts come from a local test stub, so no real model was called.

Jobs viewer: a running job with Stop, a completed avatar draft with its result, a finished gallery image and a failed one with its error.

Jobs viewer

The activity dot on the jobs button while a tracked job runs.

The activity dot on the jobs button while a tracked job runs

The toast after a reload, for a job that finished while the tab was closed.

The toast after a reload, for a job that finished while the tab was closed

Both switches in Settings > Advanced > Features.

Both switches in Settings > Advanced > Features

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @SirAdoni on GitHub (Sep 26, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6694 Originally assigned to: @SpicyMarinara on GitHub. <!-- roadmap issue G, draft v1.0 --> Part of the contribution roadmap in #6624 (package G). ## What problem does this solve? - Closing or reloading the tab ends a long avatar, sprite or video generation, and there is no record of what happened or whether it finished. - On Windows the server console sits in the taskbar the whole time the server runs, and closing it is the only obvious way to stop the server. ## Proposed solution **Keep generating when the tab is closed** (`generationJobTracking`): - Gallery images, selfies, scene videos and backgrounds, character avatar and sheet drafts, sprite sheets and animated expression sprites run through the existing generation entry points, wrapped in one server-side job runner with its own timeout and cancel. - Each job keeps a small record (status, timings, result link, a stable error code and a short trail of ids and timings, never prompts). A restart marks running jobs as interrupted and never re-runs them. Records go with their chat and follow retention limits. - A jobs viewer lists recent jobs with status, error code, result preview and Stop, and one toast after a reload announces jobs that finished while the user was away. **Minimize the console to the system tray** (`consoleTray`, Windows only): - A small hidden PowerShell helper (no native modules) shows a tray icon with Open, Show or hide console, and Quit, which runs the normal graceful shutdown. Under Windows Terminal the icon is shown but the console is never hidden. **How it's switched:** both are off by default in Settings > Advanced > Features. With job tracking off, each route runs its work exactly as today, every new route answers 404, and no folder, table row, timer or log line is created. With the tray off, nothing starts. `MARINARA_CONSOLE_TRAY` can also set the tray. - **Areas touched (for spotting overlap):** - `packages/server/src/routes`: gallery, backgrounds, sprites, characters, admin (chat wipe), and a new `generation-jobs` route - `packages/server/src/services/generation`: new job runner and tracker - `packages/server/src/db/schema` and `services/storage`: a new `generation_job_records` table and its storage - `packages/server/src/services/console-tray` and `assets/console-tray.ps1` (new) - Client: a new `generation-jobs` component folder, `GenerationJobsModal`, `AppShell` and `ModalRenderer` hooks, Features settings, `en.json` - Docs: `docs/development/generation-jobs.md`, `docs/configuration` - **Size:** about 35 files, about 4,100 added lines, including regressions. - **Status:** implemented and tested in a fork, on Windows and on Linux (WSL, the CI-equivalent run). ## Alternatives considered - **Retrying interrupted jobs after a restart:** rejected, because it could spend paid image or video calls without the user asking. - **A native tray module:** rejected to keep the install free of native builds; the PowerShell helper is enough for a menu and an icon. ## Additional context - Package D also touches the gallery, backgrounds and sprites routes, and package E the characters route. Whichever merges second will rebase; no behaviour conflicts are expected. - A command for opening the jobs viewer could be offered to the Omnibar work later, once both are in. - Implementation depends on #6647 (foundations); PRs will follow once it merges, one package at a time. - If you're working in any of these areas, please comment so we can coordinate before a PR. ## Screenshots Taken from the fork build with invented demo data (characters, lorebooks and a campaign made up for these shots). Model replies and token counts come from a local test stub, so no real model was called. **Jobs viewer: a running job with Stop, a completed avatar draft with its result, a finished gallery image and a failed one with its error.** ![Jobs viewer](https://raw.githubusercontent.com/SirAdoni/Marinara-Engine-contrib/e98c448478676a9b4a6fad4bed1b6c29c046e9a4/roadmap/G-1-jobs-viewer.png) **The activity dot on the jobs button while a tracked job runs.** ![The activity dot on the jobs button while a tracked job runs](https://raw.githubusercontent.com/SirAdoni/Marinara-Engine-contrib/e98c448478676a9b4a6fad4bed1b6c29c046e9a4/roadmap/G-2-activity-dot.png) **The toast after a reload, for a job that finished while the tab was closed.** ![The toast after a reload, for a job that finished while the tab was closed](https://raw.githubusercontent.com/SirAdoni/Marinara-Engine-contrib/e98c448478676a9b4a6fad4bed1b6c29c046e9a4/roadmap/G-3-recovery-toast.png) **Both switches in Settings > Advanced > Features.** ![Both switches in Settings > Advanced > Features](https://raw.githubusercontent.com/SirAdoni/Marinara-Engine-contrib/e98c448478676a9b4a6fad4bed1b6c29c046e9a4/roadmap/G-4-feature-switches.png) ## Template check - [ ] I DID NOT read this template and provide the requested details.
Author
Owner

@SpicyMarinara commented on GitHub (Sep 26, 2026):

Ensure they're off by default, and then we're good. Awaiting PR.

<!-- gh-comment-id:5848661420 --> @SpicyMarinara commented on GitHub (Sep 26, 2026): Ensure they're off by default, and then we're good. Awaiting PR.
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#3749
No description provided.