Skip to content

[Bug]: memory-llm hardcoded to gpt-4o-mini, breaks silently for non-OpenAI BYOK providers #5162

Description

@wellfitness

Title suggestion: [Bug]: memory-llm hardcoded to gpt-4o-mini, breaks silently for non-OpenAI BYOK providers


Summary

OD's memory-llm subsystem makes cross-turn memory calls hardcoded to gpt-4o-mini. When using BYOK against any provider that isn't OpenAI itself (e.g. api.minimax.io, which has no gpt-4o-mini in its catalog), every memory call fails with HTTP 400. The agent runs without memory between turns and the user gets no visible error.

How to reproduce

  1. Install Open Design 1.17.13 on Windows
  2. Configure a BYOK provider via OpenAI-compatible protocol with baseUrl other than api.openai.com (e.g. https://api.minimax.io).
  3. Trigger any BYOK agent run that requires cross-turn memory (i.e. essentially any multi-turn task).
  4. Check %APPDATA%\Open Design\namespaces\release-stable-win\logs\daemon\latest.log.

Observed log excerpt (verbatim)

[provider:models] openai api.minimax.io → 8 models in 620ms
[proxy:openai] POST api.minimax.io model=MiniMax-M3
[memory-llm] openai call failed openai 400: {"type":"error","error":{"type":"bad_request_error","message":"invalid params, unknown model 'gpt-4o-mini' (2013)","http_code":"400"},"request_id":"06980b8869091118c9df2ca9db999302"}
[proxy:openai] POST api.minimax.io model=MiniMax-M3
[memory-llm] openai call failed openai 400: {"type":"error","error":{"type":"bad_request_error","message":"invalid params, unknown model 'gpt-4o-mini' (2013)","http_code":"400"},"request_id":"06980c066a7c9d9b602a8bf676a50a3b"}

Every proxy:openai chat call is paired with a memory-llm 400 failure. Silent.

Impact

  • Agent runs without persistent memory across turns. The user can't tell because there's no error in the UI; only daemon log noise.
  • In my specific repro: combined with the BYOK tools-forwarding bug (see [Bug]: BYOK MiniMax/MiMo via OpenAI-compatible protocol returns empty assistant turn and only chat text #5114), the agent produces output that depends on memory that's missing. Memory-less runs hallucinate project context.
  • Affects every BYOK provider that isn't OpenAI itself: MiniMax/MiMo, OpenRouter (probably), Together, Groq, local Ollama, anything not OpenAI.

Diagnosis context (from @lefarcen on #5114)

Per maintainer investigation on main:

"memory-llm is not unconditionally hardcoded to OpenAI — it now prefers the per-turn BYOK chatProvider snapshot when the web app sends it, and only falls back to defaults like gpt-4o-mini when that path is missing or loses the race."

So in main there's at least a partial fix (prefer per-turn snapshot), but the fallback path still uses gpt-4o-mini and is reachable. My 1.17.13 build predates that fix and is hit every time.

Expected behavior

memory-llm should:

  1. Use the same provider / model / baseUrl / apiKey that the chat turn is using (or refuse to run if it can't be determined).
  2. If a fallback is needed, prefer a model that exists in the resolved provider's catalog (e.g. for api.minimax.io, use MiniMax-M2.5-highspeed or similar).
  3. Surface failures to the user-visible run status, not just the daemon log. A "memory subsystem degraded" warning in the run metadata would be acceptable.

Workaround (until fixed)

None on the runtime side — the failure is invisible. Workaround at the user level: switch to the CLI route (minimax-coding-plan/MiniMax-M3) where memory goes through opencode-ai's managed plan and isn't affected. But this defeats the purpose of BYOK.

Related


Originally requested by @lefarcen in #5114 (comment) to keep the tool-forwarding discussion focused while the memory regression gets its own tracking path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions