[PR #7137] [MERGED] fix(decision): let a TypeSafe address follow the same rules as any Base URL (#7134) #7491

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7137
Author: @SpicyMarinara
Created: 10/5/2026
Status: ✅ Merged
Merged: 10/5/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/typesafe-local-names-7134


📝 Commits (2)

  • 58d4155 fix(decision): let a TypeSafe address follow the same rules as any Base URL (#7134)
  • 74e196e Merge branch 'staging' into fix/typesafe-local-names-7134

📊 Changes

6 files changed (+15 additions, -37 deletions)

View changed files

📝 CHANGELOG.md (+1 -1)
📝 docs/connections/decision-models.md (+1 -1)
📝 packages/client/src/localization/locales/en.json (+0 -1)
📝 packages/server/src/services/decision/decision-connection.ts (+1 -6)
📝 packages/server/src/utils/security.ts (+1 -10)
📝 scripts/regressions/decision-typesafe-address.regression.ts (+11 -18)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7134

Why this change

  • #7088 let a TypeSafe Decision connection use another address, but added a TypeSafe-only rule: plain http:// was refused unless the address was localhost or a private IP literal.
  • Every other connection (OpenAI, Anthropic, Custom System One, and so on) lets you point its Base URL anywhere. That made TypeSafe the odd one out, and it blocked normal setups such as a server reached through host.docker.internal from Docker.
  • The maintainer decided to drop the extra rule so TypeSafe behaves like every other connection.

What changed

  • decision-connection.ts: removed the needs_https check and error. A TypeSafe address now goes through the same URL checks (http/https only; no credentials, query or hash) and network policy (PROVIDER_LOCAL_URLS_ENABLED for other machines on the local network) as a Custom System One address.
  • security.ts: removed isLocalAddressHostname, which only that rule used.
  • en.json: removed connections.decision.errors.needs_https.
  • decision-typesafe-address.regression.ts: remote http, local names (jev.local, host.docker.internal), https, localhost, [::1] and private IPs all resolve for TypeSafe, with the same verdict as Custom. This fails with the old rule (http://decisions.example.com: needs_https).
  • docs/connections/decision-models.md and the unreleased CHANGELOG bullet no longer describe the https rule.

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

Agent-run checks: pnpm check passes; all 14 Decision regressions pass (--filter decision); the updated TypeSafe regression fails against the old rule.

Manual verification notes

  • Manually verify a TypeSafe connection with Base URL http://host.docker.internal:<port> (from Docker) passes Test against a local server that runs TypeSafe's API.
  • Manually verify a TypeSafe connection pointed at another machine on the LAN works with PROVIDER_LOCAL_URLS_ENABLED, as for Custom.
  • Manually verify a blank or default Base URL still uses https://api.typesafe.ai.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

Changed: docs/connections/decision-models.md, CHANGELOG.md. Translations follow in a docs-i18n PR.

Summary by CodeRabbit

  • Behavior Changes

    • TypeSafe Decision connections now follow the same Base URL rules as other connections, including allowing remote HTTP addresses. URLs must still use HTTP or HTTPS and meet shared validation requirements.
    • API-key and local-network provider requirements remain unchanged.
  • Documentation

    • Updated setup instructions and changelog wording to reflect the shared Base URL rules.

🔄 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/7137 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/5/2026 **Status:** ✅ Merged **Merged:** 10/5/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/typesafe-local-names-7134` --- ### 📝 Commits (2) - [`58d4155`](https://github.com/Pasta-Devs/Marinara-Engine/commit/58d415548d9955126afd0f240b0cdc2323628904) fix(decision): let a TypeSafe address follow the same rules as any Base URL (#7134) - [`74e196e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/74e196e44be79913d1db59a68a1634ddc95ccadb) Merge branch 'staging' into fix/typesafe-local-names-7134 ### 📊 Changes **6 files changed** (+15 additions, -37 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -1) 📝 `docs/connections/decision-models.md` (+1 -1) 📝 `packages/client/src/localization/locales/en.json` (+0 -1) 📝 `packages/server/src/services/decision/decision-connection.ts` (+1 -6) 📝 `packages/server/src/utils/security.ts` (+1 -10) 📝 `scripts/regressions/decision-typesafe-address.regression.ts` (+11 -18) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #7134 ## Why this change - #7088 let a TypeSafe Decision connection use another address, but added a TypeSafe-only rule: plain `http://` was refused unless the address was `localhost` or a private IP literal. - Every other connection (OpenAI, Anthropic, Custom System One, and so on) lets you point its Base URL anywhere. That made TypeSafe the odd one out, and it blocked normal setups such as a server reached through `host.docker.internal` from Docker. - The maintainer decided to drop the extra rule so TypeSafe behaves like every other connection. ## What changed - `decision-connection.ts`: removed the `needs_https` check and error. A TypeSafe address now goes through the same URL checks (http/https only; no credentials, query or hash) and network policy (`PROVIDER_LOCAL_URLS_ENABLED` for other machines on the local network) as a Custom System One address. - `security.ts`: removed `isLocalAddressHostname`, which only that rule used. - `en.json`: removed `connections.decision.errors.needs_https`. - `decision-typesafe-address.regression.ts`: remote http, local names (`jev.local`, `host.docker.internal`), https, localhost, `[::1]` and private IPs all resolve for TypeSafe, with the same verdict as Custom. This fails with the old rule (`http://decisions.example.com: needs_https`). - `docs/connections/decision-models.md` and the unreleased CHANGELOG bullet no longer describe the https rule. ## 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` Agent-run checks: `pnpm check` passes; all 14 Decision regressions pass (`--filter decision`); the updated TypeSafe regression fails against the old rule. ### Manual verification notes - [ ] Manually verify a TypeSafe connection with Base URL `http://host.docker.internal:<port>` (from Docker) passes **Test** against a local server that runs TypeSafe's API. - [ ] Manually verify a TypeSafe connection pointed at another machine on the LAN works with `PROVIDER_LOCAL_URLS_ENABLED`, as for Custom. - [ ] Manually verify a blank or default Base URL still uses `https://api.typesafe.ai`. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) Changed: `docs/connections/decision-models.md`, `CHANGELOG.md`. Translations follow in a `docs-i18n` PR. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Behavior Changes** * TypeSafe Decision connections now follow the same Base URL rules as other connections, including allowing remote HTTP addresses. URLs must still use HTTP or HTTPS and meet shared validation requirements. * API-key and local-network provider requirements remain unchanged. * **Documentation** * Updated setup instructions and changelog wording to reflect the shared Base URL rules. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:20:20 +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#7491
No description provided.