Skip to content

Fix #1315: [Bug] Topic Judge 100% failure rate - MiniMax API returns 404 for topic-judge ca#1972

Open
Memtensor-AI wants to merge 1 commit into
dev-20260624-v2.0.22from
bugfix/autodev-1315
Open

Fix #1315: [Bug] Topic Judge 100% failure rate - MiniMax API returns 404 for topic-judge ca#1972
Memtensor-AI wants to merge 1 commit into
dev-20260624-v2.0.22from
bugfix/autodev-1315

Conversation

@Memtensor-AI

Copy link
Copy Markdown
Collaborator

Description

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.

Related Issue (Required): Fixes #1315

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g. code style improvements, linting)
  • Documentation update

How Has This Been Tested?

Automated tests are pending.

  • Unit Test
  • Test Script Or Test Steps (please provide)
  • Pipeline Automated API Test (please provide)

Checklist

  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have created related documentation issue/PR in MemOS-Docs (if applicable)
  • I have linked the issue to this PR (if applicable)
  • I have mentioned the person who will review this PR

@MatthewZhuang, @CarltonXiang, @syzsunshine219, @World-controller please review this PR.

Reviewer Checklist

…ock MiniMax (#1315)

judgeNewTopicOpenAI and arbitrateTopicSplitOpenAI were sending
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 ever reaches the model, producing 100% failure rate on topic
boundary detection for users on MiniMax-backed openai_compatible setups.

Other summarizer calls in the same file (summarize, summarizeTask,
filterRelevant, judgeDedup, classifyTopic) work fine because they use
larger max_tokens (or none at all). classifyTopicOpenAI already uses 60
against the same MiniMax endpoint successfully, so 60 is adopted as the
new minimum for the two affected helpers.

Includes regression test that stubs global fetch and asserts both
helpers send max_tokens >= 60 while leaving the existing limits of the
healthy callers untouched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated bug Something isn't working | 功能异常

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants