MemOS icon indicating copy to clipboard operation
MemOS copied to clipboard

[Bug] Topic Judge 100% failure rate - MiniMax API returns 404 for topic-judge calls

Open smasunspot opened this issue 8 months ago • 4 comments

Bug Description

Topic Judge (任务边界检测) has never worked since installing memos-local-openclaw-plugin. Every single call fails with HTTP 404 error.

Environment

  • Plugin version: memos-local-openclaw-plugin v1.0.3
  • OpenClaw version: (latest)
  • OS: macOS
  • Installation date: 2026-03-20

Configuration

```json { "provider": "openai_compatible", "model": "MiniMax-M2.7-highspeed", "endpoint": "https://api.minimaxi.com/v1", "apiKey": "***" } ```

Error Details

Error message:

[plugins] [error] judgeNewTopic failed (openai_compatible/MiniMax-M2.7-highspeed), no more fallbacks: Error: OpenAI topic-judge failed (404): <html>
<head><title>404 Not Found</title></head>
<center><h1>404 Not Found</h1></center>

Statistics:

  • Topic Judge calls: 559
  • Failures: 559 (100% failure rate)
  • First failure: 2026-03-20T08:11:21 (first ever call after installation)

What Works

Other AI calls using the same MiniMax configuration work correctly:

  • ✅ Summarizer
  • ✅ Memory Filter (filterRelevant)
  • ✅ Dedup Judge (judgeDedup)

Only Topic Judge fails with 404.

Analysis

Looking at the source code (src/ingest/providers/openai.ts), the topic-judge call uses the same endpoint and model as other calls:

// judgeNewTopicOpenAI function (line 213)
const endpoint = normalizeChatEndpoint(cfg.endpoint ?? "https://api.openai.com/v1/chat/completions");
// endpoint becomes: https://api.minimaxi.com/v1/chat/completions
// model: MiniMax-M2.7-highspeed
// max_tokens: 10

The only difference is max_tokens: 10 (very short response expected).

Expected Behavior

Topic Judge should return "NEW" or "SAME" to detect conversation topic boundaries. Currently, all calls fall back to null, which disables task boundary detection.

Possible Causes

  1. MiniMax API may not support certain request patterns for topic-judge
  2. The model name "MiniMax-M2.7-highspeed" may not be valid for topic-judge endpoint
  3. MiniMax API at api.minimaxi.com may have different behavior for short max_tokens requests

Logs

``` 2026-03-20T08:11:21.166+08:00 [plugins] [error] judgeNewTopic failed (openai_compatible/MiniMax-M2.7-highspeed), no more fallbacks: Error: OpenAI topic-judge failed (404): 2026-03-22T12:37:24.954+08:00 [gateway] Topic judge result: null(fallback) ```

Workaround

None known. Task boundary detection is completely disabled.

smasunspot avatar Mar 22 '26 05:03 smasunspot

问题已解决 — 配置问题

不是 Topic Judge 本身的 bug,而是 MemOS 模型配置不完整导致的。

根本原因: 「技能专用模型」(skillEvolution.summarizer)字段为空时,即使选择「使用主摘要模型」,Topic Judge 也会读取到空白配置,导致 404。

关键发现: Topic Judge 的 Model 列显示「—」(空白),而其他角色显示具体模型名。这说明 Topic Judge 没有正确读取到模型配置。

解决方案: 不要依赖「使用主摘要模型」选项,要手动填满所有模型字段:

  • 摘要模型: MiniMax-M2.7-highspeed
  • 技能专用模型: MiniMax-M2.7-highspeed(手动填写)

配置铁律:

  1. 所有模型字段必须填满,不能留空
  2. 不要依赖「使用主摘要模型」等自动选项
  3. 填完后 Model Health 全部变 OK 才算配置完成

结论:这是配置问题,不是代码 bug。建议在文档中明确说明「技能专用模型」不能留空。

smasunspot avatar Mar 22 '26 09:03 smasunspot

This issue has been automatically marked as stale due to inactivity.

github-actions[bot] avatar Apr 23 '26 03:04 github-actions[bot]

🤖 AutoDev has picked up this issue and started working on it.

Task ID: 4a347ec72ca69867 Working branch: bugfix/autodev-1315 Target branch: latest dev* branch Workflow: opsp (analysis → coding → testing → PR)

I will post the PR link here once done. If I need more information, I will ask in the comments.

Memtensor-AI avatar Jun 29 '26 16:06 Memtensor-AI

✅ AutoDev task 4a347ec72ca69867 completed.

Summary: Fixes issue #1315: Topic Judge 100% failure rate against MiniMax. Root cause is that judgeNewTopicOpenAI and arbitrateTopicSplitOpenAI in apps/memos-local-openclaw/src/ingest/providers/openai.ts send max_tokens: 10. MiniMax's gateway (api.minimaxi.com) rejects requests with that small a ceiling by returning an HTML 404 page before the request reaches the model. Every other summarizer call in the same file works because they request larger max_tokens (200–4096) or none at all; classifyTopicOpenAI in the same file already uses 60 successfully against MiniMax.

The fix raises max_tokens from 10 to 60 in both helpers, with an inline code comment referencing issue #1315 so future contributors know not to lower it again. 60 is enough for the single-word NEW/SAME reply plus any reasoning preamble MiniMax-M models may emit, and is a no-op for the OpenAI / Anthropic / Gemini / Bedrock providers since each has its own per-provider helper.

Verified with a new regression test apps/memos-local-openclaw/tests/topic-judge-minimax-1315.test.ts that stubs global.fetch, captures the request body, and asserts both helpers send max_tokens >= 60 while the other healthy callers keep their existing limits. All 5 new tests pass. Broader runs across tests/integration.test.ts (26/26) and tests/openclaw-fallback.test.ts are green; tsc --noEmit passes. The handful of failures that remain in the full suite (task-processor session-boundary, accuracy semantic precision, skill-auto-install, update-install) reproduce on the unmodified base branch and are unrelated to this fix.

Commit 88f7622d on bugfix/autodev-1315 is pushed to origin; spec archive committed to memos-autodev-specs main.

Base branch: main Branch: bugfix/autodev-1315 Commit: 88f7622 PR: https://github.com/MemTensor/MemOS/pull/1972 Assigned to: @MatthewZhuang, @CarltonXiang, @syzsunshine219, @World-controller Reviewers: @MatthewZhuang, @CarltonXiang, @syzsunshine219, @World-controller

Memtensor-AI avatar Jun 29 '26 17:06 Memtensor-AI