[GH-ISSUE #998] [Issue]: LTM agent extraction fails for custom endpoints with trailing slash #520

Closed
opened 2026-10-20 17:28:16 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Sep 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/998

Originally assigned to: @Promansis on GitHub.

Summary

Long-Term Memory extraction fails when its configured agent connection uses a custom OpenAI-compatible base URL with a trailing slash. The host appends /chat/completions without normalizing that URL, producing an invalid endpoint and a 404 response.

Affected package

long-term-memory (agent-backed extraction)

Expected behavior

LTM agent extraction should use the configured custom endpoint regardless of whether the saved base URL ends with /.

Actual behavior

A URL such as https://api.example/v1/ is passed through to the LTM capability host and the OpenAI-compatible provider builds:

https://api.example/v1//chat/completions

The request fails with an HTTP 404. The equivalent URL without the trailing slash works, and LTM extraction works with the local sidecar connection.

Steps to reproduce

  1. Configure a custom OpenAI-compatible agent connection with a base URL ending in /, for example https://api.example/v1/.
  2. Configure Long-Term Memory extraction to use that agent connection.
  3. Run an LTM source extraction.
  4. Observe the provider error: Custom OpenAI-compatible endpoint error 404: Not Found.
  5. Remove the trailing slash from the connection URL and repeat; extraction succeeds.

Environment

  • Marinara Engine version: Not supplied; current source inspection confirms the behavior in the capability language-model host.
  • Package version: long-term-memory 1.3.6
  • Install type: Not supplied
  • OS + version: Not supplied
  • Browser or app shell: Not supplied

Logs, screenshots, or video

Reported log excerpt:

[ltm] LLM chat complete failed for evidence unit extraction
Custom OpenAI-compatible endpoint error 404: Not Found

Additional context

The LTM package resolves the selected connection through languageModels.resolveForRequest() and does not construct provider URLs itself. The host capability bridge passes connection.baseUrl directly into createLLMProvider, while normal agent generation strips trailing slashes before provider creation. The OpenAI-compatible provider appends /chat/completions to the stored base URL.

Temporary workaround: save the custom connection base URL without a trailing slash.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Sep 21, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/998 Originally assigned to: @Promansis on GitHub. ## Summary Long-Term Memory extraction fails when its configured agent connection uses a custom OpenAI-compatible base URL with a trailing slash. The host appends `/chat/completions` without normalizing that URL, producing an invalid endpoint and a 404 response. ## Affected package `long-term-memory` (agent-backed extraction) ## Expected behavior LTM agent extraction should use the configured custom endpoint regardless of whether the saved base URL ends with `/`. ## Actual behavior A URL such as `https://api.example/v1/` is passed through to the LTM capability host and the OpenAI-compatible provider builds: `https://api.example/v1//chat/completions` The request fails with an HTTP 404. The equivalent URL without the trailing slash works, and LTM extraction works with the local sidecar connection. ## Steps to reproduce 1. Configure a custom OpenAI-compatible agent connection with a base URL ending in `/`, for example `https://api.example/v1/`. 2. Configure Long-Term Memory extraction to use that agent connection. 3. Run an LTM source extraction. 4. Observe the provider error: `Custom OpenAI-compatible endpoint error 404: Not Found`. 5. Remove the trailing slash from the connection URL and repeat; extraction succeeds. ## Environment - Marinara Engine version: Not supplied; current source inspection confirms the behavior in the capability language-model host. - Package version: `long-term-memory` 1.3.6 - Install type: Not supplied - OS + version: Not supplied - Browser or app shell: Not supplied ## Logs, screenshots, or video Reported log excerpt: ```text [ltm] LLM chat complete failed for evidence unit extraction Custom OpenAI-compatible endpoint error 404: Not Found ``` ## Additional context The LTM package resolves the selected connection through `languageModels.resolveForRequest()` and does not construct provider URLs itself. The host capability bridge passes `connection.baseUrl` directly into `createLLMProvider`, while normal agent generation strips trailing slashes before provider creation. The OpenAI-compatible provider appends `/chat/completions` to the stored base URL. Temporary workaround: save the custom connection base URL without a trailing slash. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:28:16 +07:00
  • closed this issue
  • added the
    bug
    label
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#520
No description provided.