[GH-ISSUE #2451] [Issue]: 12-PROMPT-ERROR-invalid-empty-fallbacks: restore connection negative controls #1204

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

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

Originally assigned to: @Promansis on GitHub.

Summary

12-PROMPT-ERROR-invalid-empty-fallbacks: refactor generation connection resolution does not preserve legacy negative-control behavior for missing chat connections and random-pool connections.

Expected behavior

Legacy stops generation when no request/chat connection is configured, and connectionId: "random" selects from the random pool or errors with No connections are marked for the random pool.

Actual behavior

Refactor resolveGenerationConnection falls back to the default/first stored connection when no request/chat connection is set. It also treats "random" as a literal connection id, so random-pool generation fails as a missing chat connection instead of using the random pool.

Steps to reproduce

  1. In refactor, start generation for a chat with no request connectionId and no chat.connectionId, while at least one connection exists.
  2. Observe generation resolves the default/first connection instead of stopping.
  3. Start generation with connectionId: "random" or chat.connectionId: "random".
  4. Observe the resolver looks up a connection row named random instead of selecting from the random pool.

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: refactor
  • Run mode: static parityscan
  • OS + version: not relevant
  • Node + pnpm versions: not relevant
  • Rust version, if relevant: not relevant
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: LLM generation connection

Logs, screenshots, or video

Legacy proof:

  • main:packages/server/src/routes/generate.routes.ts:1844 handles connId === "random" by selecting from connections.listRandomPool().
  • main:packages/server/src/routes/generate.routes.ts:1847 returns No connections are marked for the random pool when the pool is empty.
  • main:packages/server/src/routes/generate.routes.ts:1855 returns No API connection configured for this chat when no request/chat connection is set.
  • main:packages/server/src/routes/generate.routes.ts:1877 returns API connection not found when the selected connection row is missing.

Refactor proof:

  • src/engine/generation/context.ts:62 reads the requested connection id and :63 looks it up directly.
  • src/engine/generation/context.ts:65 reads chat.connectionId and :66 looks it up directly.
  • src/engine/generation/context.ts:68 lists all connections and :70 picks the default or first connection when no chat/request id is set.
  • src/engine/generation/context.ts:72 only errors when no stored connections exist.

Regression notes

Tracked from upstream prompt assembly parity target #2442 under 12-PROMPT-ERROR-invalid-empty-fallbacks.

Additional context

Acceptance criteria:

  • Missing request/chat connection follows the intended legacy negative-control behavior or is documented as an intentional divergence in #2442.
  • "random" connection ids select from the random pool before provider send.
  • Empty random pools surface the legacy explicit random-pool error.
  • Missing concrete connection ids still surface explicit missing-connection errors.

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 @Promansis on GitHub (Jun 6, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2451 Originally assigned to: @Promansis on GitHub. ## Summary `12-PROMPT-ERROR-invalid-empty-fallbacks`: refactor generation connection resolution does not preserve legacy negative-control behavior for missing chat connections and random-pool connections. ## Expected behavior Legacy stops generation when no request/chat connection is configured, and `connectionId: "random"` selects from the random pool or errors with `No connections are marked for the random pool`. ## Actual behavior Refactor `resolveGenerationConnection` falls back to the default/first stored connection when no request/chat connection is set. It also treats `"random"` as a literal connection id, so random-pool generation fails as a missing chat connection instead of using the random pool. ## Steps to reproduce 1. In refactor, start generation for a chat with no request `connectionId` and no `chat.connectionId`, while at least one connection exists. 2. Observe generation resolves the default/first connection instead of stopping. 3. Start generation with `connectionId: "random"` or `chat.connectionId: "random"`. 4. Observe the resolver looks up a connection row named `random` instead of selecting from the random pool. ## Impact area - [ ] App shell, navigation, startup, or providers - [ ] Catalog resources - [ ] Chat mode - [ ] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [x] 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: `refactor` - Run mode: static parityscan - OS + version: not relevant - Node + pnpm versions: not relevant - Rust version, if relevant: not relevant - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: LLM generation connection ## Logs, screenshots, or video Legacy proof: - `main:packages/server/src/routes/generate.routes.ts:1844` handles `connId === "random"` by selecting from `connections.listRandomPool()`. - `main:packages/server/src/routes/generate.routes.ts:1847` returns `No connections are marked for the random pool` when the pool is empty. - `main:packages/server/src/routes/generate.routes.ts:1855` returns `No API connection configured for this chat` when no request/chat connection is set. - `main:packages/server/src/routes/generate.routes.ts:1877` returns `API connection not found` when the selected connection row is missing. Refactor proof: - `src/engine/generation/context.ts:62` reads the requested connection id and `:63` looks it up directly. - `src/engine/generation/context.ts:65` reads `chat.connectionId` and `:66` looks it up directly. - `src/engine/generation/context.ts:68` lists all connections and `:70` picks the default or first connection when no chat/request id is set. - `src/engine/generation/context.ts:72` only errors when no stored connections exist. ## Regression notes Tracked from upstream prompt assembly parity target #2442 under `12-PROMPT-ERROR-invalid-empty-fallbacks`. ## Additional context Acceptance criteria: - Missing request/chat connection follows the intended legacy negative-control behavior or is documented as an intentional divergence in #2442. - `"random"` connection ids select from the random pool before provider send. - Empty random pools surface the legacy explicit random-pool error. - Missing concrete connection ids still surface explicit missing-connection errors. ## 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.
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#1204
No description provided.