[GH-ISSUE #2458] [Issue]: Refactor NovelAI image outputs omit legacy request metadata #1206

Closed
opened 2026-10-21 05:29:03 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Xelvanis on GitHub (Jun 6, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2458

Originally assigned to: @SpicyMarinara on GitHub.

Summary

The refactor NovelAI image transport normalizes returned image bytes, MIME type, and extension, but static trace found no equivalent to the legacy marinara_novelai_request PNG metadata injection. This leaves NovelAI-generated PNG assets without the request metadata legacy wrote before storage callers saved the output.

Related parity tracker: #2410.
Related fixed normalization issue: #2437.

Expected behavior

NovelAI zip or direct PNG responses should preserve the legacy embedded PNG metadata behavior when the output is a PNG.

Legacy behavior in packages/server/src/services/image/image-generation.ts:

  • generateNovelAI extracted NovelAI zip/direct PNG bytes.
  • It called appendNovelAiGenerationMetadata before returning { base64, mimeType: "image/png", ext: "png" }.
  • appendNovelAiGenerationMetadata wrote a marinara_novelai_request PNG text chunk containing provider/request metadata.

Actual behavior

Current refactor behavior in src-tauri/src/commands/storage/images/providers.rs:

  • parse_novelai_image_response accepts NovelAI zip/direct image/JSON responses.
  • It returns normalized image bytes via normalized_image_bytes.
  • Static trace found no replacement for appendNovelAiGenerationMetadata or marinara_novelai_request before storage callers receive the generated asset.

The refactor normalization work from #2437 appears fixed for ext/base64 shape, but this residual metadata parity gap remains unless the metadata was intentionally retired.

Steps to reproduce

  1. Inspect src-tauri/src/commands/storage/images/providers.rs on origin/refactor@1a18f83d.
  2. Trace parse_novelai_image_response for zip and direct PNG responses.
  3. Compare against legacy packages/server/src/services/image/image-generation.ts, where generateNovelAI calls appendNovelAiGenerationMetadata for zip and direct PNG outputs.
  4. Search the refactor tree for marinara_novelai_request or an equivalent NovelAI metadata writer.

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: origin/refactor@1a18f83d static parity trace
  • Run mode: static code trace only
  • OS + version: not relevant
  • Node + pnpm versions: not relevant
  • Rust version, if relevant: not run
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: NovelAI image generation

Logs, screenshots, or video

No live provider call was run. Evidence is static trace from #2410.

Regression notes

Legacy behavior existed in packages/server/src/services/image/image-generation.ts through appendNovelAiGenerationMetadata and the marinara_novelai_request PNG text chunk.

Additional context

If preserving this metadata is no longer desired, classify it as an intentional divergence and update #2410 instead of restoring it.

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 @Xelvanis on GitHub (Jun 6, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2458 Originally assigned to: @SpicyMarinara on GitHub. ## Summary The refactor NovelAI image transport normalizes returned image bytes, MIME type, and extension, but static trace found no equivalent to the legacy `marinara_novelai_request` PNG metadata injection. This leaves NovelAI-generated PNG assets without the request metadata legacy wrote before storage callers saved the output. Related parity tracker: #2410. Related fixed normalization issue: #2437. ## Expected behavior NovelAI zip or direct PNG responses should preserve the legacy embedded PNG metadata behavior when the output is a PNG. Legacy behavior in `packages/server/src/services/image/image-generation.ts`: - `generateNovelAI` extracted NovelAI zip/direct PNG bytes. - It called `appendNovelAiGenerationMetadata` before returning `{ base64, mimeType: "image/png", ext: "png" }`. - `appendNovelAiGenerationMetadata` wrote a `marinara_novelai_request` PNG text chunk containing provider/request metadata. ## Actual behavior Current refactor behavior in `src-tauri/src/commands/storage/images/providers.rs`: - `parse_novelai_image_response` accepts NovelAI zip/direct image/JSON responses. - It returns normalized image bytes via `normalized_image_bytes`. - Static trace found no replacement for `appendNovelAiGenerationMetadata` or `marinara_novelai_request` before storage callers receive the generated asset. The refactor normalization work from #2437 appears fixed for ext/base64 shape, but this residual metadata parity gap remains unless the metadata was intentionally retired. ## Steps to reproduce 1. Inspect `src-tauri/src/commands/storage/images/providers.rs` on `origin/refactor@1a18f83d`. 2. Trace `parse_novelai_image_response` for zip and direct PNG responses. 3. Compare against legacy `packages/server/src/services/image/image-generation.ts`, where `generateNovelAI` calls `appendNovelAiGenerationMetadata` for zip and direct PNG outputs. 4. Search the refactor tree for `marinara_novelai_request` or an equivalent NovelAI metadata writer. ## 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 - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: `origin/refactor@1a18f83d` static parity trace - Run mode: static code trace only - OS + version: not relevant - Node + pnpm versions: not relevant - Rust version, if relevant: not run - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: NovelAI image generation ## Logs, screenshots, or video No live provider call was run. Evidence is static trace from #2410. ## Regression notes Legacy behavior existed in `packages/server/src/services/image/image-generation.ts` through `appendNovelAiGenerationMetadata` and the `marinara_novelai_request` PNG text chunk. ## Additional context If preserving this metadata is no longer desired, classify it as an intentional divergence and update #2410 instead of restoring it. ## 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-21 05:29:03 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Jun 6, 2026):

Fixed on refactor in a68177b5.

  • NovelAI direct PNG and zipped PNG outputs now receive a marinara_novelai_request PNG iTXt metadata chunk before normalization.
  • The metadata preserves the generated NovelAI request payload for saved output inspection.

Verification:

  • cargo test --manifest-path src-tauri/Cargo.toml novelai_png_outputs_include_request_metadata_chunk -- --nocapture
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace
  • pnpm check:architecture
<!-- gh-comment-id:4638447625 --> @SpicyMarinara commented on GitHub (Jun 6, 2026): Fixed on `refactor` in `a68177b5`. - NovelAI direct PNG and zipped PNG outputs now receive a `marinara_novelai_request` PNG `iTXt` metadata chunk before normalization. - The metadata preserves the generated NovelAI request payload for saved output inspection. Verification: - `cargo test --manifest-path src-tauri/Cargo.toml novelai_png_outputs_include_request_metadata_chunk -- --nocapture` - `cargo check --manifest-path src-tauri/Cargo.toml --workspace` - `pnpm check:architecture`
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#1206
No description provided.