[GH-ISSUE #422] [Issue]: Silent fallback to paid API as agent default (no cost warning) #180

Closed
opened 2026-10-20 17:25:57 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @cha1latte on GitHub (May 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/422

Originally assigned to: @SpicyMarinara on GitHub.

Summary

When the local model is unavailable, Marinara silently falls back to whichever paid API connection is set as the default for agents — with no warning or confirmation. This caused significant unexpected charges from a high-cost model (Opus 4.7) being used for routine mini agent / tracker tasks. Discord post: https://discord.com/channels/1417099416812392641/1501008711064359114

Expected behavior

When the local model becomes unavailable (or was never installed) and a paid API connection is the default for agents, Marinara should either (a) prompt the user to confirm before falling back to the paid connection for agent traffic, or (b) at minimum surface a persistent warning in the UI noting that paid agent calls are now active and on which model. Ideally a dedicated cost-tier warning when the agent-default model is in a "premium" tier (e.g., Opus-class).

Actual behavior

With the local sidecar runtime not installed (see related Bug 2), all mini agent / tracker calls silently routed to the paid API connection set as agent default — Opus 4.7 in this case — with no notification or confirmation. The user only discovered the fallback after seeing significant unexpected charges on the API bill.

Steps to reproduce

  1. Set a paid API connection (e.g., Anthropic Opus 4.7) as the default agent connection.
  2. Ensure the local model is unavailable (e.g., GGUF present but sidecar runtime not installed, or local model disabled mid-session).
  3. Use any chat / Game Mode session that triggers agents (trackers, scene analysis, etc.).
  4. Observe agent calls being made against the paid connection with no UI indication. No prompt, no warning, no confirmation.
  5. Check API provider billing — usage from the paid model.

Environment

  • Marinara Engine version: v1.5.7 (build f00a8b9)
  • Install type: (to be filled by reporter)
  • OS + version: (to be filled by reporter)
  • Browser or app shell: (to be filled by reporter)

Logs, screenshots, or video

(No specific log — behavior is silent. API provider usage logs would show the unexpected agent traffic against the paid connection.)

Additional context

Suggested fixes, in increasing order of friction:

  1. Persistent UI banner whenever the agent default is a paid connection and the local model is not in use, naming the model that will be billed for agent calls.
  2. One-time confirmation prompt the first time agent traffic falls back to a paid connection in a session.
  3. A per-tier warning when the agent default is set to a premium-tier model (Opus-class, GPT-4-class), since agent traffic volume is much higher than main-model traffic and the cost mismatch is the trap.

Related: Bug 2 (sidecar runtime install 403) is what surfaced this behavior here — but the silent-fallback issue exists independently and would happen any time the local model is unavailable.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @cha1latte on GitHub (May 5, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/422 Originally assigned to: @SpicyMarinara on GitHub. ## Summary When the local model is unavailable, Marinara silently falls back to whichever paid API connection is set as the default for agents — with no warning or confirmation. This caused significant unexpected charges from a high-cost model (Opus 4.7) being used for routine mini agent / tracker tasks. Discord post: https://discord.com/channels/1417099416812392641/1501008711064359114 ## Expected behavior When the local model becomes unavailable (or was never installed) and a paid API connection is the default for agents, Marinara should either (a) prompt the user to confirm before falling back to the paid connection for agent traffic, or (b) at minimum surface a persistent warning in the UI noting that paid agent calls are now active and on which model. Ideally a dedicated cost-tier warning when the agent-default model is in a "premium" tier (e.g., Opus-class). ## Actual behavior With the local sidecar runtime not installed (see related Bug 2), all mini agent / tracker calls silently routed to the paid API connection set as agent default — Opus 4.7 in this case — with no notification or confirmation. The user only discovered the fallback after seeing significant unexpected charges on the API bill. ## Steps to reproduce 1. Set a paid API connection (e.g., Anthropic Opus 4.7) as the default agent connection. 2. Ensure the local model is unavailable (e.g., GGUF present but sidecar runtime not installed, or local model disabled mid-session). 3. Use any chat / Game Mode session that triggers agents (trackers, scene analysis, etc.). 4. Observe agent calls being made against the paid connection with no UI indication. No prompt, no warning, no confirmation. 5. Check API provider billing — usage from the paid model. ## Environment - Marinara Engine version: v1.5.7 (build f00a8b9) - Install type: (to be filled by reporter) - OS + version: (to be filled by reporter) - Browser or app shell: (to be filled by reporter) ## Logs, screenshots, or video (No specific log — behavior is silent. API provider usage logs would show the unexpected agent traffic against the paid connection.) ## Additional context Suggested fixes, in increasing order of friction: 1. Persistent UI banner whenever the agent default is a paid connection and the local model is not in use, naming the model that will be billed for agent calls. 2. One-time confirmation prompt the first time agent traffic falls back to a paid connection in a session. 3. A per-tier warning when the agent default is set to a premium-tier model (Opus-class, GPT-4-class), since agent traffic volume is much higher than main-model traffic and the cost mismatch is the trap. Related: Bug 2 (sidecar runtime install 403) is what surfaced this behavior here — but the silent-fallback issue exists independently and would happen any time the local model is unavailable. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:25:57 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@dutchaiagency commented on GitHub (May 5, 2026):

Read-only pass on current main (4a6808d): this looks separate from #413.

#413 adds a useful loadout-cost readout in ChatSettingsDrawer, but it does not change the runtime connection resolution path that can bill the wrong provider.

The fallback I would look at first is:

  • packages/server/src/routes/generate.routes.ts:2480-2484: if an agent config explicitly uses LOCAL_SIDECAR_CONNECTION_ID and the sidecar is not available, effectiveConnectionId becomes defaultAgentConn?.id ?? null.
  • packages/server/src/routes/generate.routes.ts:2533-2545: built-in agents without a DB row also pick up defaultAgentConn when present.
  • packages/server/src/routes/generate/retry-agents-route.ts:357-377 and 398-414: retry-agent resolution is different; if local sidecar is unavailable it falls through to the chat connection, not the default-for-agents connection.

So the warning/guard probably needs to cover both live generation and manual retry paths, otherwise one path can warn while the other still bills a different connection.

Minimal shape I would test:

  1. Carry an explicit connectionSource/fallbackReason alongside each resolved agent (explicit, default_for_agents, chat, local_sidecar_unavailable_default, local_sidecar_unavailable_chat).
  2. Emit a user-visible warning when a requested local sidecar agent is replaced by a paid/default/chat provider.
  3. Consider failing closed for explicit Local Model overrides when the sidecar is unavailable, unless the user confirms fallback for that session.

That keeps #413 as "how heavy is this agent loadout?" and #422 as "which provider will actually be billed if the local path is unavailable?"

<!-- gh-comment-id:4377144538 --> @dutchaiagency commented on GitHub (May 5, 2026): Read-only pass on current `main` (`4a6808d`): this looks separate from #413. #413 adds a useful loadout-cost readout in `ChatSettingsDrawer`, but it does not change the runtime connection resolution path that can bill the wrong provider. The fallback I would look at first is: - `packages/server/src/routes/generate.routes.ts:2480-2484`: if an agent config explicitly uses `LOCAL_SIDECAR_CONNECTION_ID` and the sidecar is not available, `effectiveConnectionId` becomes `defaultAgentConn?.id ?? null`. - `packages/server/src/routes/generate.routes.ts:2533-2545`: built-in agents without a DB row also pick up `defaultAgentConn` when present. - `packages/server/src/routes/generate/retry-agents-route.ts:357-377` and `398-414`: retry-agent resolution is different; if local sidecar is unavailable it falls through to the chat connection, not the default-for-agents connection. So the warning/guard probably needs to cover both live generation and manual retry paths, otherwise one path can warn while the other still bills a different connection. Minimal shape I would test: 1. Carry an explicit `connectionSource`/`fallbackReason` alongside each resolved agent (`explicit`, `default_for_agents`, `chat`, `local_sidecar_unavailable_default`, `local_sidecar_unavailable_chat`). 2. Emit a user-visible warning when a requested local sidecar agent is replaced by a paid/default/chat provider. 3. Consider failing closed for explicit Local Model overrides when the sidecar is unavailable, unless the user confirms fallback for that session. That keeps #413 as "how heavy is this agent loadout?" and #422 as "which provider will actually be billed if the local path is unavailable?"
Author
Owner

@SpicyMarinara commented on GitHub (May 5, 2026):

Fixed.

<!-- gh-comment-id:4378053401 --> @SpicyMarinara commented on GitHub (May 5, 2026): Fixed.
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#180
No description provided.