[PR #8674] [MERGED] fix(connections): keep NanoGPT rows with an api.nano-gpt.com embedding endpoint in their account #8740

Closed
opened 2026-11-07 17:39:21 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8674
Author: @Gunterlie
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @Gunterlie

Base: staging ← Head: fix/nanogpt-embedding-subdomain-account


📝 Commits (2)

  • 2ed21bf fix(connections): keep NanoGPT rows with an api.nano-gpt.com embedding endpoint in their account
  • 69d21d7 docs(connections): describe the subdomain rule on the embedding host checks

📊 Changes

2 files changed (+49 additions, -4 deletions)

View changed files

📝 packages/server/src/services/storage/connection-accounts.storage.ts (+24 -4)
📝 scripts/regressions/connection-accounts-write-through.regression.ts (+25 -0)

📄 Description

Important

Contributions target staging.

Linked issue

No GitHub issue. Reported by a tester on Discord (#me-bugs-features-feedback: "NanoGPT connections are excluded from account migration because of their embedding endpoint").

Why this change

After #8456, existing NanoGPT connections stay standalone (accountId: null). NanoGPT chat runs on nano-gpt.com, embeddings on api.nano-gpt.com. hasForeignEmbeddingHost() compared full origins, saw two hosts, and kept these rows out of the account so their key would never reach "another host". As standalone rows they also lose the account's model catalog, so the new picker shows NanoGPT without any models.

A subdomain of the key's own host belongs to the same vendor, so it should not block account linking.

What changed

  • New isForeignEmbeddingUrl() in connection-accounts.storage.ts: an embedding URL on the same origin, or on a subdomain of the key's host with the same scheme and port, is not foreign.
  • Both checks use it: account linking at startup (hasForeignEmbeddingHost) and the key write-through on account edit.
  • Look-alike hosts (nano-gpt.com.evil.example) and scheme changes (http://api.nano-gpt.com) stay foreign, so the key-leak guard is unchanged for them.
  • Existing standalone NanoGPT rows join their account on the next start (the linking pass is idempotent and runs at startup).

Validation

  • connection-accounts-* regressions: 4/4 pass. The new NanoGPT case in connection-accounts-write-through.regression.ts fails without the fix.

  • tsc --noEmit on packages/server passes. Full pnpm check left to CI.

  • pnpm check passes locally

  • Container (Docker / Podman) built and ran without issue

  • Ran the app, clicked through the changes manually

  • Checked edge cases

  • Above manual verification completed

  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Manually verify: an install with a pre-#8456 NanoGPT connection whose embedding URL is https://api.nano-gpt.com/... shows that connection under a NanoGPT account after restart.
  • Manually verify: the NanoGPT account lists its models in the chat model picker.
  • Not covered: the tester also reports broken Gemini connections; cause not found yet.

Docs and release impact

  • No docs changes needed

🔄 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/8674 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `fix/nanogpt-embedding-subdomain-account` --- ### 📝 Commits (2) - [`2ed21bf`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2ed21bf4ce81c8fa3d52a1af9ea87f757cad4a25) fix(connections): keep NanoGPT rows with an api.nano-gpt.com embedding endpoint in their account - [`69d21d7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/69d21d7fab8cb32e3f7e8ee06285a3872ad2b509) docs(connections): describe the subdomain rule on the embedding host checks ### 📊 Changes **2 files changed** (+49 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/storage/connection-accounts.storage.ts` (+24 -4) 📝 `scripts/regressions/connection-accounts-write-through.regression.ts` (+25 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. ## Linked issue No GitHub issue. Reported by a tester on Discord (#me-bugs-features-feedback: "NanoGPT connections are excluded from account migration because of their embedding endpoint"). ## Why this change After #8456, existing NanoGPT connections stay standalone (`accountId: null`). NanoGPT chat runs on `nano-gpt.com`, embeddings on `api.nano-gpt.com`. `hasForeignEmbeddingHost()` compared full origins, saw two hosts, and kept these rows out of the account so their key would never reach "another host". As standalone rows they also lose the account's model catalog, so the new picker shows NanoGPT without any models. A subdomain of the key's own host belongs to the same vendor, so it should not block account linking. ## What changed - New `isForeignEmbeddingUrl()` in `connection-accounts.storage.ts`: an embedding URL on the same origin, or on a subdomain of the key's host with the same scheme and port, is not foreign. - Both checks use it: account linking at startup (`hasForeignEmbeddingHost`) and the key write-through on account edit. - Look-alike hosts (`nano-gpt.com.evil.example`) and scheme changes (`http://api.nano-gpt.com`) stay foreign, so the key-leak guard is unchanged for them. - Existing standalone NanoGPT rows join their account on the next start (the linking pass is idempotent and runs at startup). ## Validation - `connection-accounts-*` regressions: 4/4 pass. The new NanoGPT case in `connection-accounts-write-through.regression.ts` fails without the fix. - `tsc --noEmit` on `packages/server` passes. Full `pnpm check` left to CI. - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases - [ ] Above manual verification completed - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Manually verify: an install with a pre-#8456 NanoGPT connection whose embedding URL is `https://api.nano-gpt.com/...` shows that connection under a NanoGPT account after restart. - Manually verify: the NanoGPT account lists its models in the chat model picker. - Not covered: the tester also reports broken Gemini connections; cause not found yet. ## Docs and release impact - [ ] No docs changes needed --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 17:39:21 +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#8740
No description provided.