[PR #1017] [MERGED] fix(llm): trim trailing slash in OpenAI-compatible base URLs (#998) #1249

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1017
Author: @Promansis
Created: 9/21/2026
Status: ✅ Merged
Merged: 9/21/2026
Merged by: @Promansis

Base: staging ← Head: fix/ltm-extraction-code-899


📝 Commits (2)

  • 508bef4 fix(llm): trim trailing slash in OpenAI-compatible base URLs (#998)
  • c3c25c2 Merge branch 'staging' into fix/ltm-extraction-code-899

📊 Changes

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

View changed files

📝 sources/engine/packages/server/src/services/llm/providers/openai.provider.ts (+1 -1)

📄 Description

Pull request

Important

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

Linked issue

Closes #998

Why this change

  • An OpenAI-compatible connection whose baseUrl ends with / produced requests to .../v1//chat/completions (double slash / empty path segment). That path never matched the expected /chat/completions endpoint, so LTM extraction and any generation routed through that connection failed.

What changed

  • sources/engine/packages/server/src/services/llm/providers/openai.provider.ts: the OpenAIProvider constructor now trims trailing slashes from baseUrl before /chat/completions, /responses, and /embeddings are appended. This is a shared Engine source change; no package payloads, artifacts, or catalog entries were regenerated.

Package and security impact

  • Affected package IDs: none (shared Engine source, not a package payload)
  • Engine compatibility impact: none — URL normalization only, no API/contract change
  • New or changed permissions/entrypoints: none
  • Restart, storage, update, or uninstall impact: none

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Reproduced the bug against the pre-fix source (git HEAD): constructing OpenAIProvider("http://127.0.0.1:9999/v1/", key) and calling chatComplete() produced the wire URL http://127.0.0.1:9999/v1//chat/completions.
  • With this fix the same harness produced http://127.0.0.1:9999/v1/chat/completions (single slash).
  • Method: stubbed the global fetch and ran the captured provider under tsx with engine deps (pino, undici, and @marinara-engine/shared via tests/tsconfig.regressions.json). Both /chat/completions transport sites share the trimmed this.baseUrl.

Documentation impact

  • No documentation changes needed
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

UI evidence (if applicable)

  • N/A — server-only URL normalization, no UI.

🔄 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-Agents/pull/1017 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 9/21/2026 **Status:** ✅ Merged **Merged:** 9/21/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `fix/ltm-extraction-code-899` --- ### 📝 Commits (2) - [`508bef4`](https://github.com/Pasta-Devs/Marinara-Agents/commit/508bef47a16d54aeefbb5ce816ebfee37971f273) fix(llm): trim trailing slash in OpenAI-compatible base URLs (#998) - [`c3c25c2`](https://github.com/Pasta-Devs/Marinara-Agents/commit/c3c25c2b5571eec07577cceffca1c2aad9291575) Merge branch 'staging' into fix/ltm-extraction-code-899 ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `sources/engine/packages/server/src/services/llm/providers/openai.provider.ts` (+1 -1) </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #998 ## Why this change - An OpenAI-compatible connection whose `baseUrl` ends with `/` produced requests to `.../v1//chat/completions` (double slash / empty path segment). That path never matched the expected `/chat/completions` endpoint, so LTM extraction and any generation routed through that connection failed. ## What changed - `sources/engine/packages/server/src/services/llm/providers/openai.provider.ts`: the `OpenAIProvider` constructor now trims trailing slashes from `baseUrl` before `/chat/completions`, `/responses`, and `/embeddings` are appended. This is a shared Engine source change; no package payloads, artifacts, or catalog entries were regenerated. ## Package and security impact - Affected package IDs: none (shared Engine source, not a package payload) - Engine compatibility impact: none — URL normalization only, no API/contract change - New or changed permissions/entrypoints: none - Restart, storage, update, or uninstall impact: none ## Validation - [ ] `node scripts/validate-catalog.mjs` passes locally - [ ] `git diff --check` passes locally - [ ] Rebuilt every affected manifest, payload, artifact, and catalog entry - [ ] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Reproduced the bug against the pre-fix source (`git HEAD`): constructing `OpenAIProvider("http://127.0.0.1:9999/v1/", key)` and calling `chatComplete()` produced the wire URL `http://127.0.0.1:9999/v1//chat/completions`. - With this fix the same harness produced `http://127.0.0.1:9999/v1/chat/completions` (single slash). - Method: stubbed the global `fetch` and ran the captured provider under `tsx` with engine deps (`pino`, `undici`, and `@marinara-engine/shared` via `tests/tsconfig.regressions.json`). Both `/chat/completions` transport sites share the trimmed `this.baseUrl`. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) - N/A — server-only URL normalization, no UI. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-21 05:06:48 +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-Agents#1249
No description provided.