[GH-ISSUE #2170] [Issue]: Bare-string context injections are silently dropped by the engine normalizer (legacy-format migration lost) #1077

Closed
opened 2026-10-21 05:26:24 +07:00 by bsakaguchi · 0 comments
Owner

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

Originally assigned to: @cha1latte on GitHub.

Summary

The legacy app's normalizeContextInjections migrated loose string-form injection entries into a prose-guardian-typed object. The refactor's engine-side normalizer drops any non-record entry, so a bare-string contextInjection (the legacy persisted shape) is silently discarded instead of migrated.

Expected behavior

A request/persisted contextInjection given as a plain string is preserved and treated as a prose-guardian injection.

Actual behavior

The engine-side normalizeContextInjections does if (!isRecord(entry)) continue;, so bare-string entries from existingExtra.contextInjections are skipped. The refactor's client display normalizer still handles strings, which is what flagged the engine-side gap.

Steps to reproduce

  1. Have a persisted extra.contextInjections array that contains bare strings (legacy cache shape) and regenerate/retry over it.
  2. The string entries are dropped from the engine generation path rather than migrated.

Impact area

  • React-free engine behavior, contracts, agents, or capability ports

Environment

  • Branch or commit: refactor @ 93555d4b
  • Run mode: Tauri desktop
  • OS + version: Windows 11
  • Node + pnpm versions: n/a (static parity audit, main vs refactor)
  • Rust version, if relevant: n/a
  • Remote Runtime URL configured? not relevant

Regression notes

Worked in legacy (main @ c49f1d95). main: packages/server/src/routes/generate/agent-normalizers.ts:9-12 (maps bare string -> { agentType: "prose-guardian", text }), exercised over persisted message extra at generate.routes.ts:6623 and retry-agents-route.ts:1467. refactor @ 93555d4b: src/engine/generation/start-generation.ts:1792-1804 drops non-record entries; partial survivor (client display only) at src/features/modes/roleplay/components/ContextInjectionPanel.tsx:52-69. Low real-world exposure since the refactor only ever writes object-shaped injections, but the defensive legacy-compat migration is gone.

Originally created by @Romuromylus on GitHub (Jun 4, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2170 Originally assigned to: @cha1latte on GitHub. ## Summary The legacy app's `normalizeContextInjections` migrated loose string-form injection entries into a prose-guardian-typed object. The refactor's engine-side normalizer drops any non-record entry, so a bare-string `contextInjection` (the legacy persisted shape) is silently discarded instead of migrated. ## Expected behavior A request/persisted `contextInjection` given as a plain string is preserved and treated as a prose-guardian injection. ## Actual behavior The engine-side `normalizeContextInjections` does `if (!isRecord(entry)) continue;`, so bare-string entries from `existingExtra.contextInjections` are skipped. The refactor's client display normalizer still handles strings, which is what flagged the engine-side gap. ## Steps to reproduce 1. Have a persisted `extra.contextInjections` array that contains bare strings (legacy cache shape) and regenerate/retry over it. 2. The string entries are dropped from the engine generation path rather than migrated. ## Impact area - [x] React-free engine behavior, contracts, agents, or capability ports ## Environment - Branch or commit: refactor @ 93555d4b - Run mode: Tauri desktop - OS + version: Windows 11 - Node + pnpm versions: n/a (static parity audit, main vs refactor) - Rust version, if relevant: n/a - Remote Runtime URL configured? not relevant ## Regression notes Worked in legacy (main @ c49f1d95). main: `packages/server/src/routes/generate/agent-normalizers.ts:9-12` (maps bare string -> `{ agentType: "prose-guardian", text }`), exercised over persisted message extra at `generate.routes.ts:6623` and `retry-agents-route.ts:1467`. refactor @ 93555d4b: `src/engine/generation/start-generation.ts:1792-1804` drops non-record entries; partial survivor (client display only) at `src/features/modes/roleplay/components/ContextInjectionPanel.tsx:52-69`. Low real-world exposure since the refactor only ever writes object-shaped injections, but the defensive legacy-compat migration is gone.
bsakaguchi 2026-10-21 05:26:24 +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#1077
No description provided.