[PR #707] [MERGED] Fix random connection schedule generation #4737

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/707
Author: @cha1latte
Created: 5/11/2026
Status: ✅ Merged
Merged: 5/11/2026
Merged by: @cha1latte

Base: main ← Head: fix/issue-693-random-schedule


📝 Commits (1)

  • 78a8a3e Fix random connection schedule generation

📊 Changes

1 file changed (+21 additions, -5 deletions)

View changed files

📝 packages/server/src/routes/conversation.routes.ts (+21 -5)

📄 Description

Linked issue

Closes #693

Why this change

  • Conversation schedule generation treated the saved random connection sentinel ("random") as a real API connection id, so chats configured for random connections returned 400 No connection configured instead of selecting from the random pool.

What changed

  • Added random-pool connection resolution to the conversation schedule generation route.
  • Preserved the existing fixed-connection and default-connection fallback behavior.
  • Return a clearer 400 when the chat is set to random but no connections are marked for the random pool.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Codex reproduced the original route failure before the fix with a conversation chat whose connectionId was "random": /api/conversation/schedule/generate returned 400 with No connection configured, and the stub provider received 0 calls.
  • Codex reran the same route-level repro after the fix: random-pool schedule generation returned 200, produced a generated weekly schedule, and the stub provider received 1 call.
  • Codex also exercised edge cases with the same scratch route harness:
    • Empty random pool: returned 400 No connections marked for the random pool, provider calls stayed at 0.
    • Fixed connection: returned 200, generated a schedule, provider calls = 1.
    • Default connection fallback: returned 200, generated a schedule, provider calls = 1.
  • Codex ran pnpm check; Impeccable context check, lint, and shared/server/client builds passed.
  • Scratch proof was recorded locally in scratch/bugfix-verification.json and scratch/issue-693-after-random.json.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

No docs or version/release file changes are needed; this is a narrow server route bug fix.

UI evidence (if applicable)

N/A - backend route behavior only. The bug was verified with a route-level scratch harness against the real server route.


🔄 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/707 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/11/2026 **Status:** ✅ Merged **Merged:** 5/11/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `main` ← **Head:** `fix/issue-693-random-schedule` --- ### 📝 Commits (1) - [`78a8a3e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/78a8a3eb14aec5e4a2df64641ef8f6b9728d906a) Fix random connection schedule generation ### 📊 Changes **1 file changed** (+21 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/routes/conversation.routes.ts` (+21 -5) </details> ### 📄 Description ## Linked issue <!-- Every PR should reference a feature request or issue report. If there isn't one yet, open one first to gather opinions: --> <!-- https://github.com/Pasta-Devs/Marinara-Engine/issues/new/choose --> Closes #693 ## Why this change <!-- What user problem, bug, or goal does this solve? --> - Conversation schedule generation treated the saved random connection sentinel (`"random"`) as a real API connection id, so chats configured for random connections returned `400 No connection configured` instead of selecting from the random pool. ## What changed <!-- List the key changes in this PR --> - Added random-pool connection resolution to the conversation schedule generation route. - Preserved the existing fixed-connection and default-connection fallback behavior. - Return a clearer 400 when the chat is set to random but no connections are marked for the random pool. ## Validation <!-- Required: include commands run and/or manual checks performed --> - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes <!-- Describe exactly what you tested in a real browser/app, step by step. --> <!-- ⚠️ If an AI agent filled out or ticked these boxes for you, treat them --> <!-- as a TO-DO LIST, not as proof the work is done. Verify each item yourself --> <!-- before submitting. If you haven't verified it, untick the box. --> - Codex reproduced the original route failure before the fix with a conversation chat whose `connectionId` was `"random"`: `/api/conversation/schedule/generate` returned `400` with `No connection configured`, and the stub provider received 0 calls. - Codex reran the same route-level repro after the fix: random-pool schedule generation returned `200`, produced a generated weekly schedule, and the stub provider received 1 call. - Codex also exercised edge cases with the same scratch route harness: - Empty random pool: returned `400 No connections marked for the random pool`, provider calls stayed at 0. - Fixed connection: returned `200`, generated a schedule, provider calls = 1. - Default connection fallback: returned `200`, generated a schedule, provider calls = 1. - Codex ran `pnpm check`; Impeccable context check, lint, and shared/server/client builds passed. - Scratch proof was recorded locally in `scratch/bugfix-verification.json` and `scratch/issue-693-after-random.json`. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) No docs or version/release file changes are needed; this is a narrow server route bug fix. ## UI evidence (if applicable) N/A - backend route behavior only. The bug was verified with a route-level scratch harness against the real server route. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:10:14 +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#4737
No description provided.