[GH-ISSUE #2651] [Issue]: Professor Mari workspace goes silent after tool call when using a custom-domain local LLM endpoint #1306

Closed
opened 2026-10-21 05:31:16 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @Gunterlie on GitHub (Jun 20, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2651

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Professor Mari workspace stops responding after executing a tool call when the LLM connection uses a custom domain name (e.g. https://api.myserver.home/v1) that resolves to a private/LAN IP. She also fails to continue on subsequent user messages in the same session. The failure is silent — no error is shown, Mari just stops.

Expected behavior

After Mari executes a workspace tool (bash, read, edit, etc.) she should follow up with a response using the tool output. If the LLM endpoint doesn't support native tool calling, the JSON tool protocol fallback should activate automatically.

Actual behavior

Mari responds to the first message, may begin a tool call, then produces no further output. Subsequent messages in the same session also receive no response.

Steps to reproduce

  1. Add a language connection using provider: Custom OpenAI-compatible with a base URL that is a custom domain name pointing to a private IP — e.g. https://llm.home.example.com/v1 (not a raw IP like http://192.168.1.10:11434).
  2. Open Professor Mari workspace and send a message that requires a tool call (e.g. "list the files in the current directory").
  3. Observe: Mari may produce an opening sentence, but after the tool executes she produces no follow-up response.
  4. Send a second message to Mari — also receives no response.

Root cause (for maintainers)

workspace-agent.service.ts uses isProbablyLocalEndpoint(baseUrl) to decide whether a custom connection needs the JSON tool protocol fallback. That function only matches raw private IPs (10.x, 192.168.x, etc.) and hostnames like localhost / *.local. A custom domain like llm.home.example.com — even when it resolves to 10.0.0.x — is not matched, so the connection is classified as a "hosted" endpoint.

Consequence: canFallbackToJsonToolProtocol = false for any self-hosted LLM reachable via a custom domain. When the second LLM call (sending tool results back) fails or returns an unexpected format, the error is swallowed silently if any text was already streamed from the first call. The session then stalls.

Proposed fix

Add a "Treat as local/custom endpoint" toggle to the connection settings UI. When enabled, it sets canFallbackToJsonToolProtocol = true and uses the guarded native tool attempt with JSON fallback — the same path already used for the built-in local sidecar. This gives users explicit control without relying on hostname heuristics and also helps users whose hosted provider advertises tool support but implements it poorly.

A secondary improvement would be extending isProbablyLocalEndpoint to resolve the hostname via DNS and check whether the result is a private IP, but that adds an async network call to the hot path and may be overly magical.

Environment

  • Marinara Engine version: 2.0.0 (staging)
  • Install type: docker
  • OS + version: Linux (container)
  • Browser or app shell: Web browser

Logs, screenshots, or video

No error is logged or shown to the user — the failure is the absence of output. Server-side, if verbose logging is enabled, the second [Professor Mari] provider call either errors or returns empty, but this is not surfaced to the client.

Additional context

Workaround until fixed: switch the Mari workspace connection to a model that reliably handles native tool calls (e.g. a Claude model via a gateway that proxies to Anthropic), or use a raw private IP as the base URL (http://10.0.0.x:port/v1) instead of a custom domain.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Gunterlie on GitHub (Jun 20, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2651 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Professor Mari workspace stops responding after executing a tool call when the LLM connection uses a custom domain name (e.g. `https://api.myserver.home/v1`) that resolves to a private/LAN IP. She also fails to continue on subsequent user messages in the same session. The failure is silent — no error is shown, Mari just stops. ## Expected behavior After Mari executes a workspace tool (bash, read, edit, etc.) she should follow up with a response using the tool output. If the LLM endpoint doesn't support native tool calling, the JSON tool protocol fallback should activate automatically. ## Actual behavior Mari responds to the first message, may begin a tool call, then produces no further output. Subsequent messages in the same session also receive no response. ## Steps to reproduce 1. Add a language connection using `provider: Custom OpenAI-compatible` with a base URL that is a **custom domain name pointing to a private IP** — e.g. `https://llm.home.example.com/v1` (not a raw IP like `http://192.168.1.10:11434`). 2. Open Professor Mari workspace and send a message that requires a tool call (e.g. "list the files in the current directory"). 3. Observe: Mari may produce an opening sentence, but after the tool executes she produces no follow-up response. 4. Send a second message to Mari — also receives no response. ## Root cause (for maintainers) `workspace-agent.service.ts` uses `isProbablyLocalEndpoint(baseUrl)` to decide whether a custom connection needs the JSON tool protocol fallback. That function only matches raw private IPs (`10.x`, `192.168.x`, etc.) and hostnames like `localhost` / `*.local`. A custom domain like `llm.home.example.com` — even when it resolves to `10.0.0.x` — is not matched, so the connection is classified as a "hosted" endpoint. Consequence: `canFallbackToJsonToolProtocol = false` for any self-hosted LLM reachable via a custom domain. When the second LLM call (sending tool results back) fails or returns an unexpected format, the error is swallowed silently if any text was already streamed from the first call. The session then stalls. ## Proposed fix Add a **"Treat as local/custom endpoint"** toggle to the connection settings UI. When enabled, it sets `canFallbackToJsonToolProtocol = true` and uses the guarded native tool attempt with JSON fallback — the same path already used for the built-in local sidecar. This gives users explicit control without relying on hostname heuristics and also helps users whose hosted provider advertises tool support but implements it poorly. A secondary improvement would be extending `isProbablyLocalEndpoint` to resolve the hostname via DNS and check whether the result is a private IP, but that adds an async network call to the hot path and may be overly magical. ## Environment - Marinara Engine version: 2.0.0 (staging) - Install type: docker - OS + version: Linux (container) - Browser or app shell: Web browser ## Logs, screenshots, or video No error is logged or shown to the user — the failure is the absence of output. Server-side, if verbose logging is enabled, the second `[Professor Mari]` provider call either errors or returns empty, but this is not surfaced to the client. ## Additional context Workaround until fixed: switch the Mari workspace connection to a model that reliably handles native tool calls (e.g. a Claude model via a gateway that proxies to Anthropic), or use a raw private IP as the base URL (`http://10.0.0.x:port/v1`) instead of a custom domain. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:31:16 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@Gunterlie commented on GitHub (Jun 20, 2026):

Related commit landed on staging: c29ed255 ("Added fix for llamacpp", #2646).

That PR takes a different approach — it makes the OpenAI provider's tool call parser more lenient, tolerating non-standard streaming formats from various backends (flat name/arguments structure, call_id instead of id, etc.). It also removes the old isProbablyLocalEndpoint / JSON protocol fallback machinery from workspace-agent.service.ts entirely.

What #2646 likely fixes: Cases where the provider streams tool calls in a slightly non-standard format — those now parse correctly instead of being silently dropped, which was probably the cause for llama.cpp users and may help some other backends.

What remains unaddressed by #2646: If the provider flat-out rejects or errors on the second LLM call — the one that sends role: "tool" result messages back — the error is still swallowed silently when any text was already streamed from the first call. Mari goes quiet with no indication of failure. The JSON fallback that previously could have saved this case has been removed rather than fixed.

The UI toggle proposed here (or any explicit "treat as local endpoint" option) would give users a way to opt into more defensive tool call handling for providers that are unreliable with native tool result replay, independent of hostname detection heuristics.

<!-- gh-comment-id:4757004616 --> @Gunterlie commented on GitHub (Jun 20, 2026): Related commit landed on staging: c29ed255 ("Added fix for llamacpp", #2646). That PR takes a different approach — it makes the OpenAI provider's tool call parser more lenient, tolerating non-standard streaming formats from various backends (flat `name`/`arguments` structure, `call_id` instead of `id`, etc.). It also removes the old `isProbablyLocalEndpoint` / JSON protocol fallback machinery from `workspace-agent.service.ts` entirely. **What #2646 likely fixes:** Cases where the provider streams tool calls in a slightly non-standard format — those now parse correctly instead of being silently dropped, which was probably the cause for llama.cpp users and may help some other backends. **What remains unaddressed by #2646:** If the provider flat-out rejects or errors on the second LLM call — the one that sends `role: "tool"` result messages back — the error is still swallowed silently when any text was already streamed from the first call. Mari goes quiet with no indication of failure. The JSON fallback that previously could have saved this case has been removed rather than fixed. The UI toggle proposed here (or any explicit "treat as local endpoint" option) would give users a way to opt into more defensive tool call handling for providers that are unreliable with native tool result replay, independent of hostname detection heuristics.
Author
Owner

@SpicyMarinara commented on GitHub (Jun 20, 2026):

Implemented on branch codex/spicymarinara-assigned-issues: connections can now be marked as local/custom endpoints, and Professor Mari uses a JSON workspace-tool protocol fallback for those endpoints. Final validation will run after the full assigned sweep per maintainer request.

<!-- gh-comment-id:4760051967 --> @SpicyMarinara commented on GitHub (Jun 20, 2026): Implemented on branch codex/spicymarinara-assigned-issues: connections can now be marked as local/custom endpoints, and Professor Mari uses a JSON workspace-tool protocol fallback for those endpoints. Final validation will run after the full assigned sweep per maintainer request.
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#1306
No description provided.