[GH-ISSUE #8584] Professor Mari fails on an OpenAI-typed Anthropic-backend proxy: Unexpected role "tool" #8413

Closed
opened 2026-11-07 16:42:49 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @ylli-selmani on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8584

Originally assigned to: @ylli-selmani on GitHub.

Summary

Professor Mari fails on an OpenAI-typed connection that is really an Anthropic-backed proxy (LinkAPI): the first
tool round works, then the run dies with OpenAI API error 429: messages: Unexpected role "tool". Allowed roles are "user", "assistant" or "system".

Same reporter as #8564, different cause. #8576 fixed tools being dropped for uncatalogued models; this is the
history shape the endpoint cannot take.

Expected behavior

Mari keeps reading and writing lorebooks on that connection, the way she does on every other model.

Actual behavior

Round 1: tools are sent, the model returns tool_calls, Mari runs them ("Looked at 2 things"). Round 2 replays
the results as a {role:"tool"} message. Anthropic's Messages API has only user and assistant, so the proxy
rejects the request. Because the rejection arrives as HTTP 429, it is classified as a rate limit and retried with
backoff (two different request ids in the banner, "Worked for 24s") before the task fails.

Steps to reproduce

  1. Add LinkAPI as an OpenAI-typed connection, pick a Claude model.
  2. Open Professor Mari, permissions Bypass, ask her to read a lorebook entry.
  3. Watch the first tool round succeed, then fail on the next round with the error above.

Verified without LinkAPI by a local fixture that accepts tools, returns tool_calls, and rejects any
{role:"tool"} message with the same 429 body: the second round is rejected exactly as reported.

Environment

  • Marinara Engine version: 2.5.1 (reporter build 1403a9818506; provider code identical on staging)
  • Install type: source
  • OS + version: Windows server, Android Firefox client over a remote IP
  • Browser or app shell: Android Firefox

Logs, screenshots, or video

One of Professor Mari's tools could not run.
OpenAI API error 429: messages: Unexpected role "tool". Allowed roles are "user", "assistant" or "system"
(request id: 202610302337086847479988268d9d6Omw023bE) (request id: 202610302337086373072178268d9d6YVK7FHIw)

Additional context

  • Ties to #8564. Not a duplicate of it: #8576 is merged and tools are now sent.

  • Switching the connection to provider type Custom does not help (the tool role is emitted the same way);
    that workaround only covered the dropped-tools bug.

  • Affects every tool-calling surface on such a connection, not only Mari.

  • If the proxy exposes an Anthropic-compatible endpoint, connecting as provider type Anthropic should work;
    untested.

  • I DID NOT read this template and provide the requested details.

Originally created by @ylli-selmani on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8584 Originally assigned to: @ylli-selmani on GitHub. ## Summary Professor Mari fails on an OpenAI-typed connection that is really an Anthropic-backed proxy (LinkAPI): the first tool round works, then the run dies with `OpenAI API error 429: messages: Unexpected role "tool". Allowed roles are "user", "assistant" or "system"`. Same reporter as #8564, different cause. #8576 fixed tools being *dropped* for uncatalogued models; this is the *history shape* the endpoint cannot take. ## Expected behavior Mari keeps reading and writing lorebooks on that connection, the way she does on every other model. ## Actual behavior Round 1: `tools` are sent, the model returns `tool_calls`, Mari runs them ("Looked at 2 things"). Round 2 replays the results as a `{role:"tool"}` message. Anthropic's Messages API has only `user` and `assistant`, so the proxy rejects the request. Because the rejection arrives as HTTP 429, it is classified as a rate limit and retried with backoff (two different `request id`s in the banner, "Worked for 24s") before the task fails. ## Steps to reproduce 1. Add LinkAPI as an OpenAI-typed connection, pick a Claude model. 2. Open Professor Mari, permissions Bypass, ask her to read a lorebook entry. 3. Watch the first tool round succeed, then fail on the next round with the error above. Verified without LinkAPI by a local fixture that accepts `tools`, returns `tool_calls`, and rejects any `{role:"tool"}` message with the same 429 body: the second round is rejected exactly as reported. ## Environment - Marinara Engine version: 2.5.1 (reporter build `1403a9818506`; provider code identical on `staging`) - Install type: source - OS + version: Windows server, Android Firefox client over a remote IP - Browser or app shell: Android Firefox ## Logs, screenshots, or video ``` One of Professor Mari's tools could not run. OpenAI API error 429: messages: Unexpected role "tool". Allowed roles are "user", "assistant" or "system" (request id: 202610302337086847479988268d9d6Omw023bE) (request id: 202610302337086373072178268d9d6YVK7FHIw) ``` ## Additional context - Ties to #8564. Not a duplicate of it: #8576 is merged and tools are now sent. - Switching the connection to provider type **Custom** does not help (the `tool` role is emitted the same way); that workaround only covered the dropped-tools bug. - Affects every tool-calling surface on such a connection, not only Mari. - If the proxy exposes an Anthropic-compatible endpoint, connecting as provider type **Anthropic** should work; untested. - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-11-07 16:42:49 +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-Engine#8413
No description provided.