Skip to content

fix: extend isMinimaxVlmModel to support M2.5/M2.7/M2.7-highspeed#67105

Closed
zhengyuliu047-rgb wants to merge 1 commit into
openclaw:mainfrom
zhengyuliu047-rgb:fix/minimax-vlm-m2x-support
Closed

fix: extend isMinimaxVlmModel to support M2.5/M2.7/M2.7-highspeed#67105
zhengyuliu047-rgb wants to merge 1 commit into
openclaw:mainfrom
zhengyuliu047-rgb:fix/minimax-vlm-m2x-support

Conversation

@zhengyuliu047-rgb
Copy link
Copy Markdown

@zhengyuliu047-rgb zhengyuliu047-rgb commented Apr 15, 2026

When MiniMax M2.7 is used as the primary model, the image tool would incorrectly send image requests directly to M2.7's chat endpoint, causing 400 errors. The image understanding for M2.7 models should be routed through the MiniMax-VL-01 plugin's /v1/coding_plan/vlm API.

This fix extends isMinimaxVlmModel to recognize MiniMax-M2.5, MiniMax-M2.7, and MiniMax-M2.7-highspeed, allowing them to trigger the VL fallback path correctly.

Fixes: #64244
Related: #54400, #53575

Summary

Describe the problem and fix in 2–5 bullets:

If this PR fixes a plugin beta-release blocker, title it fix(<plugin-id>): beta blocker - <summary> and link the matching Beta blocker: <plugin-name> - <summary> issue labeled beta-blocker. Contributors cannot label PRs, so the title is the PR-side signal for maintainers and automation.

  • Problem:
  • Why it matters:
  • What changed:
  • What did NOT change (scope boundary):

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #
  • Related #
  • This PR fixes a bug or regression

Root Cause (if applicable)

For bug fixes or regressions, explain why this happened, not just what changed. Otherwise write N/A. If the cause is unclear, write Unknown.

  • Root cause:
  • Missing detection / guardrail:
  • Contributing context (if known):

Regression Test Plan (if applicable)

For bug fixes or regressions, name the smallest reliable test coverage that should catch this. Otherwise write N/A.

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file:
  • Scenario the test should lock in:
  • Why this is the smallest reliable guardrail:
  • Existing test that already covers this (if any):
  • If no new test is added, why not:

User-visible / Behavior Changes

List user-visible changes (including defaults/config).
If none, write None.

Diagram (if applicable)

For UI changes or non-trivial logic flows, include a small ASCII diagram reviewers can scan quickly. Otherwise write N/A.

Before:
[user action] -> [old state]

After:
[user action] -> [new state] -> [result]

Security Impact (required)

  • New permissions/capabilities? (Yes/No)
  • Secrets/tokens handling changed? (Yes/No)
  • New/changed network calls? (Yes/No)
  • Command/tool execution surface changed? (Yes/No)
  • Data access scope changed? (Yes/No)
  • If any Yes, explain risk + mitigation:

Repro + Verification

Environment

  • OS:
  • Runtime/container:
  • Model/provider:
  • Integration/channel (if any):
  • Relevant config (redacted):

Steps

Expected

Actual

Evidence

Attach at least one:

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios:
  • Edge cases checked:
  • What you did not verify:

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.

Compatibility / Migration

  • Backward compatible? (Yes/No)
  • Config/env changes? (Yes/No)
  • Migration needed? (Yes/No)
  • If yes, exact upgrade steps:

Risks and Mitigations

List only real risks for this PR. Add/remove entries as needed. If none, write None.

  • Risk:
    • Mitigation:

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Apr 15, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 15, 2026

Greptile Summary

This PR extends isMinimaxVlmModel in src/agents/minimax-vlm.ts to recognize MiniMax-M2.5, MiniMax-M2.7, and MiniMax-M2.7-highspeed, routing their image requests through the /v1/coding_plan/vlm endpoint instead of the chat endpoint (which returned 400 errors). The logic change is straightforward and the routing fix for the M2.7 family is consistent with how MiniMax-VL-01 was already handled.

Confidence Score: 5/5

Safe to merge; all findings are minor P2 suggestions that do not affect correctness on the M2.7 path being fixed.

The core routing fix for M2.7/M2.7-highspeed is correct and matches the existing pattern for MiniMax-VL-01. Remaining findings are P2: a stale test description with missing coverage for the new IDs, and a question about whether M2.5-highspeed should be included alongside M2.5.

src/agents/minimax-vlm.normalizes-api-key.test.ts — test description and assertions should be updated to cover the new model IDs.

Comments Outside Diff (1)

  1. src/agents/minimax-vlm.normalizes-api-key.test.ts, line 56-61 (link)

    P2 Stale test description and missing coverage for new model IDs

    The test description "only matches the canonical MiniMax VLM model id" is now wrong, and the three new model IDs added by this PR have no coverage. Consider updating this block:

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: src/agents/minimax-vlm.normalizes-api-key.test.ts
    Line: 56-61
    
    Comment:
    **Stale test description and missing coverage for new model IDs**
    
    The test description `"only matches the canonical MiniMax VLM model id"` is now wrong, and the three new model IDs added by this PR have no coverage. Consider updating this block:
    
    
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/agents/minimax-vlm.ts
Line: 14-23

Comment:
**Missing `MiniMax-M2.5-highspeed` if M2.5 is image-capable**

The extension adds `MiniMax-M2.5` to the VLM routing list, but the model-definitions file marks only `MiniMax-M2.7` and models matching `MiniMax-M2.7-*` as image-capable (the `isImageCapable` flag in `extensions/minimax/model-definitions.ts:74`). M2.5 has no corresponding image-capability declaration there.

If M2.5 is genuinely image-capable via the VLM endpoint, its sibling `MiniMax-M2.5-highspeed` (which exists in the catalog and shares identical pricing) should be included here for parity. If M2.5 is not image-capable, its inclusion is dead scope that may silently route non-image requests through the VLM fallback path for error cases.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: src/agents/minimax-vlm.normalizes-api-key.test.ts
Line: 56-61

Comment:
**Stale test description and missing coverage for new model IDs**

The test description `"only matches the canonical MiniMax VLM model id"` is now wrong, and the three new model IDs added by this PR have no coverage. Consider updating this block:

```suggestion
  it("matches MiniMax VLM model ids including the M2 family", async () => {
    expect(isMinimaxVlmModel("minimax", "MiniMax-VL-01")).toBe(true);
    expect(isMinimaxVlmModel("minimax-portal", "MiniMax-VL-01")).toBe(true);
    expect(isMinimaxVlmModel("minimax", "MiniMax-M2.5")).toBe(true);
    expect(isMinimaxVlmModel("minimax", "MiniMax-M2.7")).toBe(true);
    expect(isMinimaxVlmModel("minimax", "MiniMax-M2.7-highspeed")).toBe(true);
    expect(isMinimaxVlmModel("minimax-portal", "custom-vision")).toBe(false);
    expect(isMinimaxVlmModel("openai", "MiniMax-VL-01")).toBe(false);
  });
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "fix: extend isMinimaxVlmModel to support..." | Re-trigger Greptile

Comment thread src/agents/minimax-vlm.ts
Comment on lines 14 to 23
export function isMinimaxVlmModel(provider: string, modelId: string): boolean {
return isMinimaxVlmProvider(provider) && modelId.trim() === "MiniMax-VL-01";
const id = modelId.trim();
return (
isMinimaxVlmProvider(provider) &&
(id === "MiniMax-VL-01" ||
id === "MiniMax-M2.5" ||
id === "MiniMax-M2.7" ||
id === "MiniMax-M2.7-highspeed")
);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Missing MiniMax-M2.5-highspeed if M2.5 is image-capable

The extension adds MiniMax-M2.5 to the VLM routing list, but the model-definitions file marks only MiniMax-M2.7 and models matching MiniMax-M2.7-* as image-capable (the isImageCapable flag in extensions/minimax/model-definitions.ts:74). M2.5 has no corresponding image-capability declaration there.

If M2.5 is genuinely image-capable via the VLM endpoint, its sibling MiniMax-M2.5-highspeed (which exists in the catalog and shares identical pricing) should be included here for parity. If M2.5 is not image-capable, its inclusion is dead scope that may silently route non-image requests through the VLM fallback path for error cases.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agents/minimax-vlm.ts
Line: 14-23

Comment:
**Missing `MiniMax-M2.5-highspeed` if M2.5 is image-capable**

The extension adds `MiniMax-M2.5` to the VLM routing list, but the model-definitions file marks only `MiniMax-M2.7` and models matching `MiniMax-M2.7-*` as image-capable (the `isImageCapable` flag in `extensions/minimax/model-definitions.ts:74`). M2.5 has no corresponding image-capability declaration there.

If M2.5 is genuinely image-capable via the VLM endpoint, its sibling `MiniMax-M2.5-highspeed` (which exists in the catalog and shares identical pricing) should be included here for parity. If M2.5 is not image-capable, its inclusion is dead scope that may silently route non-image requests through the VLM fallback path for error cases.

How can I resolve this? If you propose a fix, please make it concise.

@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Apr 15, 2026
When MiniMax M2.7 is used as the primary model, the image tool would
incorrectly send image requests directly to M2.7's chat endpoint,
causing 400 errors. The image understanding for M2.7 models should
be routed through the MiniMax-VL-01 plugin's /v1/coding_plan/vlm API.

This fix extends isMinimaxVlmModel to recognize MiniMax-M2.5,
MiniMax-M2.7, and MiniMax-M2.7-highspeed, allowing them to trigger
the VL fallback path correctly.

Fixes: openclaw#64244
Related: openclaw#54400, openclaw#53575

---

fix: debounce session.message reload to prevent webchat flicker

When lossless-claw or other plugins fire session.message events rapidly,
the webchat UI flickers because loadChatHistory sets chatLoading=true
on every event, causing messages to disappear and reappear.

This fix adds a 500ms debounce: instead of reloading immediately on
each event, we wait 500ms after the last event before reloading.
Multiple events within 500ms only trigger one reload.

Fixes: openclaw#66274
@zhengyuliu047-rgb zhengyuliu047-rgb force-pushed the fix/minimax-vlm-m2x-support branch from f6e4ad1 to 45556df Compare April 15, 2026 09:52
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 45556dfe96

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ui/src/ui/app-gateway.ts
Comment on lines +466 to +467
if (host.sessionKey === sessionKey) {
void loadChatHistory(host as unknown as ChatState);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Guard deferred reload against starting a new chat run

Because this reload is delayed by 500ms, users can start a new run before the timer fires; the callback only checks sessionKey and still calls loadChatHistory. That reintroduces the mid-run race this handler was avoiding, since loadChatHistory clears streaming/tool state (ui/src/ui/controllers/chat.ts:182-186) and can hide/delay optimistic chat updates while the new run is active. Add a !host.chatRunId guard (or cancel this timer when a run begins) before reloading.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: MiniMax image tool bypasses plugin VL-01 routing in 2026.4.8, sends image request directly to M2.7 chat endpoint

1 participant