[PR #2461] [MERGED] Restore generation connection negative controls #5617

Closed
opened 2026-10-22 04:17:51 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2461
Author: @Promansis
Created: 6/6/2026
Status: ✅ Merged
Merged: 6/6/2026
Merged by: @Promansis

Base: refactor ← Head: fix/issue-2451-connection-negative-controls


📝 Commits (2)

  • 011a3ee Restore generation connection negative controls
  • e57769d Preserve blank chat connection fallback

📊 Changes

1 file changed (+11 additions, -1 deletions)

View changed files

📝 src/engine/generation/context.ts (+11 -1)

📄 Description

Linked issue

Closes Pasta-Devs/Marinara-Engine#2451

Why this change

  • Restores legacy generation connection negative controls so chats without a request or chat connection do not silently use a default or first stored connection.
  • Restores random-pool behavior for connectionId: "random" before provider send.

What changed

  • resolveGenerationConnection now selects from connections marked useForRandom when the request or chat connection id is "random".
  • Empty random pools now surface No connections are marked for the random pool.
  • Missing request/chat connection now surfaces No API connection configured for this chat instead of falling back to a stored connection.
  • Missing concrete connection ids still surface explicit missing-record errors.

Refactor impact

Primary owner:

engine generation

Impact areas reviewed:

  • Runtime generation connection resolution
  • Prompt preview and start-generation callers
  • Agent retry path that uses the shared generation resolver

Boundary notes:

  • Engine-only change in src/engine/generation/context.ts.
  • No React feature, shared API, Tauri/Rust, storage schema, or remote-runtime boundary changes.

Pressure points touched:

  • None. No ModeSurface, GameSurface, shared mode UI, src-tauri/src/lib.rs, or import module changes.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • pnpm exec vitest run src/engine/generation/context.test.ts with a temporary local harness: 5 passed. The harness covered request-level "random", chat-level "random", empty random pool, missing request/chat connection, and missing concrete connection id. It was not committed because repo ignore rules exclude *.test.ts.
  • pnpm typecheck: passed.
  • pnpm check: passed.
  • git diff --check: passed.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • This restores existing generation connection behavior and does not add a new discoverable feature.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

No UI evidence needed; engine-only generation connection resolver fix.


🔄 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/2461 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 6/6/2026 **Status:** ✅ Merged **Merged:** 6/6/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `refactor` ← **Head:** `fix/issue-2451-connection-negative-controls` --- ### 📝 Commits (2) - [`011a3ee`](https://github.com/Pasta-Devs/Marinara-Engine/commit/011a3ee62572038cdfa73572bab46880d0b87820) Restore generation connection negative controls - [`e57769d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e57769dfbc895da85729274fc236c8caf617ff86) Preserve blank chat connection fallback ### 📊 Changes **1 file changed** (+11 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/engine/generation/context.ts` (+11 -1) </details> ### 📄 Description ## Linked issue Closes Pasta-Devs/Marinara-Engine#2451 ## Why this change - Restores legacy generation connection negative controls so chats without a request or chat connection do not silently use a default or first stored connection. - Restores random-pool behavior for `connectionId: "random"` before provider send. ## What changed - `resolveGenerationConnection` now selects from connections marked `useForRandom` when the request or chat connection id is `"random"`. - Empty random pools now surface `No connections are marked for the random pool`. - Missing request/chat connection now surfaces `No API connection configured for this chat` instead of falling back to a stored connection. - Missing concrete connection ids still surface explicit missing-record errors. ## Refactor impact Primary owner: engine generation Impact areas reviewed: - Runtime generation connection resolution - Prompt preview and start-generation callers - Agent retry path that uses the shared generation resolver Boundary notes: - Engine-only change in `src/engine/generation/context.ts`. - No React feature, shared API, Tauri/Rust, storage schema, or remote-runtime boundary changes. Pressure points touched: - None. No ModeSurface, GameSurface, shared mode UI, `src-tauri/src/lib.rs`, or import module changes. ## Validation - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `pnpm exec vitest run src/engine/generation/context.test.ts` with a temporary local harness: 5 passed. The harness covered request-level `"random"`, chat-level `"random"`, empty random pool, missing request/chat connection, and missing concrete connection id. It was not committed because repo ignore rules exclude `*.test.ts`. - `pnpm typecheck`: passed. - `pnpm check`: passed. - `git diff --check`: passed. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - This restores existing generation connection behavior and does not add a new discoverable feature. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence No UI evidence needed; engine-only generation connection resolver fix. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:17:51 +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#5617
No description provided.