Skip to content

[WRONG BRANCH] fix(minimax): refresh MiniMax-M3 metadata with video input and current pricing - #706

Closed
octo-patch wants to merge 1 commit into
lidge-jun:mainfrom
octo-patch:octo/20260729-parameter-refresh-recvqahwKrhN8L
Closed

[WRONG BRANCH] fix(minimax): refresh MiniMax-M3 metadata with video input and current pricing#706
octo-patch wants to merge 1 commit into
lidge-jun:mainfrom
octo-patch:octo/20260729-parameter-refresh-recvqahwKrhN8L

Conversation

@octo-patch

@octo-patch octo-patch commented Jul 29, 2026

Copy link
Copy Markdown

Reason: MiniMax-M3 metadata was stale — it omitted video input and kept the old $0.30/$1.20 per-million input/output pricing instead of $0.60/$2.40 with $0.12 cache reads.

Changes

  • src/generated/jawcode-model-metadata.ts: refresh the minimax bundle's MiniMax-M3 row — add video to its input modalities and update pricing to $0.60 input / $2.40 output per million tokens with $0.12 cache reads. The 1,000,000-token context window is preserved.
  • scripts/generate-jawcode-metadata.ts: widen the model input-modality type, and the interface/cast it emits, from ("text" | "image")[] to ("text" | "image" | "video")[] so the generator can carry video input and the generated metadata stays consistent with its source.

Checks

  • bun x tsc --noEmit — passes.
  • bun test tests/codex-catalog.test.ts tests/provider-registry-parity.test.ts tests/minimax-reasoning-split.test.ts tests/usage-cost.test.ts — 187 pass, 0 fail.

Summary by CodeRabbit

  • New Features
    • Added support for video inputs in Jawcode model metadata.
    • Generated metadata now correctly represents models that accept text, image, or video inputs.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

⚠️ Wrong target branch

This pull request currently targets main, but pull requests must target one of dev or dev2-go.

@octo-patch Please retarget this PR to dev. Most contributions go to dev first; use dev2-go only for scoped Go native-port work. main receives only release promotions. See our Contributing guide for details. Thanks! 🙏

Its title has been prefixed with [WRONG BRANCH].

This pull request is being kept as a draft automatically. Once every issue above is resolved, it will be marked ready for review again.

@github-actions github-actions Bot changed the title fix(minimax): refresh MiniMax-M3 metadata with video input and current pricing [WRONG BRANCH] fix(minimax): refresh MiniMax-M3 metadata with video input and current pricing Jul 29, 2026
@github-actions
github-actions Bot marked this pull request as draft July 29, 2026 14:43
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d5df4c56-7055-47f4-83d8-cf9fa8026f9b

📥 Commits

Reviewing files that changed from the base of the PR and between bc811e7 and 154a9eb.

⛔ Files ignored due to path filters (1)
  • src/generated/jawcode-model-metadata.ts is excluded by !**/generated/**
📒 Files selected for processing (1)
  • scripts/generate-jawcode-metadata.ts

📝 Walkthrough

Walkthrough

The metadata generator expands model input support from text and image to include video across raw types, generated interfaces, and parsed metadata serialization.

Changes

Metadata input support

Layer / File(s) Summary
Widen input metadata unions
scripts/generate-jawcode-metadata.ts
RawModel, generated JawcodeModelMetadata, and rowToMetadata now support "video" input values alongside "text" and "image".

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: ingwannu, wibias, lidge-jun

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating MiniMax-M3 metadata for video input and current pricing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

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

Copy link
Copy Markdown

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: 154a9eb457

ℹ️ 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".

"deepseek": [["deepseek-v4-flash",1000000,384000,"text",1,null,0.14,0.28,0.0028,0],["deepseek-v4-pro",1000000,384000,"text",1,null,0.435,0.87,0.003625,0]],
"google": [["gemini-1.5-flash",1000000,8192,"text,image",0,null,0.075,0.3,0.01875,0],["gemini-1.5-flash-8b",1000000,8192,"text,image",0,null,0.0375,0.15,0.01,0],["gemini-1.5-pro",1000000,8192,"text,image",0,null,1.25,5,0.3125,0],["gemini-2.0-flash",1048576,8192,"text,image",0,null,0.1,0.4,0.025,0],["gemini-2.0-flash-lite",1048576,8192,"text,image",0,null,0.075,0.3,0,0],["gemini-2.5-flash",1048576,65536,"text,image",1,null,0.3,2.5,0.03,0],["gemini-2.5-flash-lite",1048576,65536,"text,image",1,null,0.1,0.4,0.01,0],["gemini-2.5-flash-lite-preview-06-17",1048576,65536,"text,image",1,null,0.1,0.4,0.025,0],["gemini-2.5-flash-lite-preview-09-2025",1048576,65536,"text,image",1,null,0.1,0.4,0.025,0],["gemini-2.5-flash-preview-04-17",1048576,65536,"text,image",1,null,0.15,0.6,0.0375,0],["gemini-2.5-flash-preview-05-20",1048576,65536,"text,image",1,null,0.15,0.6,0.0375,0],["gemini-2.5-flash-preview-09-2025",1048576,65536,"text,image",1,null,0.3,2.5,0.075,0],["gemini-2.5-pro",1048576,65536,"text,image",1,null,1.25,10,0.125,0],["gemini-2.5-pro-preview-05-06",1048576,65536,"text,image",1,null,1.25,10,0.31,0],["gemini-2.5-pro-preview-06-05",1048576,65536,"text,image",1,null,1.25,10,0.31,0],["gemini-3-flash-preview",1048576,65536,"text,image",1,null,0.5,3,0.05,0],["gemini-3-pro-preview",1048576,65536,"text,image",1,null,2,12,0.2,0],["gemini-3.1-flash-lite",1048576,65536,"text,image",1,null,0.25,1.5,0.025,0],["gemini-3.1-flash-lite-preview",1048576,65536,"text,image",1,null,0.25,1.5,0.025,0],["gemini-3.1-pro-preview",1048576,65536,"text,image",1,null,2,12,0.2,0],["gemini-3.1-pro-preview-customtools",1048576,65536,"text,image",1,null,2,12,0.2,0],["gemini-3.5-flash",1048576,65536,"text,image",1,null,1.5,9,0.15,0],["gemini-flash-latest",1048576,65536,"text,image",1,null,0.3,2.5,0.075,0],["gemini-flash-lite-latest",1048576,65536,"text,image",1,null,0.1,0.4,0.025,0],["gemini-live-2.5-flash",128000,8000,"text,image",1,null,0.5,2,0,0],["gemini-live-2.5-flash-preview-native-audio",131072,65536,"text",1,null,0.5,2,0,0],["gemma-3-27b-it",131072,8192,"text,image",0,null,0,0,0,0],["gemma-4-26b",256000,8192,"text,image",1,null,0,0,0,0],["gemma-4-26b-a4b-it",262144,32768,"text,image",1,null,0,0,0,0],["gemma-4-26b-it",256000,8192,"text,image",1,null,0,0,0,0],["gemma-4-31b",256000,8192,"text,image",1,null,0,0,0,0],["gemma-4-31b-it",262144,32768,"text,image",1,null,0,0,0,0],["gemma-4-E2B-it",131072,8192,"text,image",1,null,0,0,0,0],["gemma-4-E4B-it",131072,8192,"text,image",1,null,0,0,0,0]],
"minimax": [["MiniMax-M2",196608,128000,"text",1,null,0.3,1.2,0,0],["MiniMax-M2.1",204800,131072,"text",1,null,0.3,1.2,0,0],["MiniMax-M2.5",204800,131072,"text",1,null,0.3,1.2,0.03,0.375],["MiniMax-M2.5-highspeed",204800,131072,"text",1,null,0.6,2.4,0.06,0.375],["MiniMax-M2.5-lightning",204800,32000,"text",1,null,0.3,2.4,0,0],["MiniMax-M2.7",204800,131072,"text",1,null,0.3,1.2,0.06,0.375],["MiniMax-M2.7-highspeed",204800,131072,"text",1,null,0.6,2.4,0.06,0.375],["minimax-m3",512000,128000,"text,image",1,null,0.6,2.4,0.12,0],["MiniMax-M3",1000000,128000,"text,image",1,null,0.3,1.2,0.06,0]],
"minimax": [["MiniMax-M2",196608,128000,"text",1,null,0.3,1.2,0,0],["MiniMax-M2.1",204800,131072,"text",1,null,0.3,1.2,0,0],["MiniMax-M2.5",204800,131072,"text",1,null,0.3,1.2,0.03,0.375],["MiniMax-M2.5-highspeed",204800,131072,"text",1,null,0.6,2.4,0.06,0.375],["MiniMax-M2.5-lightning",204800,32000,"text",1,null,0.3,2.4,0,0],["MiniMax-M2.7",204800,131072,"text",1,null,0.3,1.2,0.06,0.375],["MiniMax-M2.7-highspeed",204800,131072,"text",1,null,0.6,2.4,0.06,0.375],["minimax-m3",512000,128000,"text,image",1,null,0.6,2.4,0.12,0],["MiniMax-M3",1000000,128000,"text,image,video",1,null,0.6,2.4,0.12,0]],

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 Preserve the short-context MiniMax-M3 rate

MiniMax's PAYG pricing is tiered at the 512k input-token boundary: the current discounted <=512k rate is $0.30 input / $1.20 output / $0.06 cache-read, while $0.60 / $2.40 / $0.12 is the >512k tier (https://platform.minimax.io/docs/guides/pricing-paygo). Because usage/cost.ts consumes this metadata as one flat per-token rate, this change doubles the cost estimate shown in logs for every MiniMax-M3 request that stays below 512k input tokens. Please either add tier-aware pricing keyed off the request's input token count or keep the <=512k current rate in the flat row until tiering exists.

Useful? React with 👍 / 👎.

"deepseek": [["deepseek-v4-flash",1000000,384000,"text",1,null,0.14,0.28,0.0028,0],["deepseek-v4-pro",1000000,384000,"text",1,null,0.435,0.87,0.003625,0]],
"google": [["gemini-1.5-flash",1000000,8192,"text,image",0,null,0.075,0.3,0.01875,0],["gemini-1.5-flash-8b",1000000,8192,"text,image",0,null,0.0375,0.15,0.01,0],["gemini-1.5-pro",1000000,8192,"text,image",0,null,1.25,5,0.3125,0],["gemini-2.0-flash",1048576,8192,"text,image",0,null,0.1,0.4,0.025,0],["gemini-2.0-flash-lite",1048576,8192,"text,image",0,null,0.075,0.3,0,0],["gemini-2.5-flash",1048576,65536,"text,image",1,null,0.3,2.5,0.03,0],["gemini-2.5-flash-lite",1048576,65536,"text,image",1,null,0.1,0.4,0.01,0],["gemini-2.5-flash-lite-preview-06-17",1048576,65536,"text,image",1,null,0.1,0.4,0.025,0],["gemini-2.5-flash-lite-preview-09-2025",1048576,65536,"text,image",1,null,0.1,0.4,0.025,0],["gemini-2.5-flash-preview-04-17",1048576,65536,"text,image",1,null,0.15,0.6,0.0375,0],["gemini-2.5-flash-preview-05-20",1048576,65536,"text,image",1,null,0.15,0.6,0.0375,0],["gemini-2.5-flash-preview-09-2025",1048576,65536,"text,image",1,null,0.3,2.5,0.075,0],["gemini-2.5-pro",1048576,65536,"text,image",1,null,1.25,10,0.125,0],["gemini-2.5-pro-preview-05-06",1048576,65536,"text,image",1,null,1.25,10,0.31,0],["gemini-2.5-pro-preview-06-05",1048576,65536,"text,image",1,null,1.25,10,0.31,0],["gemini-3-flash-preview",1048576,65536,"text,image",1,null,0.5,3,0.05,0],["gemini-3-pro-preview",1048576,65536,"text,image",1,null,2,12,0.2,0],["gemini-3.1-flash-lite",1048576,65536,"text,image",1,null,0.25,1.5,0.025,0],["gemini-3.1-flash-lite-preview",1048576,65536,"text,image",1,null,0.25,1.5,0.025,0],["gemini-3.1-pro-preview",1048576,65536,"text,image",1,null,2,12,0.2,0],["gemini-3.1-pro-preview-customtools",1048576,65536,"text,image",1,null,2,12,0.2,0],["gemini-3.5-flash",1048576,65536,"text,image",1,null,1.5,9,0.15,0],["gemini-flash-latest",1048576,65536,"text,image",1,null,0.3,2.5,0.075,0],["gemini-flash-lite-latest",1048576,65536,"text,image",1,null,0.1,0.4,0.025,0],["gemini-live-2.5-flash",128000,8000,"text,image",1,null,0.5,2,0,0],["gemini-live-2.5-flash-preview-native-audio",131072,65536,"text",1,null,0.5,2,0,0],["gemma-3-27b-it",131072,8192,"text,image",0,null,0,0,0,0],["gemma-4-26b",256000,8192,"text,image",1,null,0,0,0,0],["gemma-4-26b-a4b-it",262144,32768,"text,image",1,null,0,0,0,0],["gemma-4-26b-it",256000,8192,"text,image",1,null,0,0,0,0],["gemma-4-31b",256000,8192,"text,image",1,null,0,0,0,0],["gemma-4-31b-it",262144,32768,"text,image",1,null,0,0,0,0],["gemma-4-E2B-it",131072,8192,"text,image",1,null,0,0,0,0],["gemma-4-E4B-it",131072,8192,"text,image",1,null,0,0,0,0]],
"minimax": [["MiniMax-M2",196608,128000,"text",1,null,0.3,1.2,0,0],["MiniMax-M2.1",204800,131072,"text",1,null,0.3,1.2,0,0],["MiniMax-M2.5",204800,131072,"text",1,null,0.3,1.2,0.03,0.375],["MiniMax-M2.5-highspeed",204800,131072,"text",1,null,0.6,2.4,0.06,0.375],["MiniMax-M2.5-lightning",204800,32000,"text",1,null,0.3,2.4,0,0],["MiniMax-M2.7",204800,131072,"text",1,null,0.3,1.2,0.06,0.375],["MiniMax-M2.7-highspeed",204800,131072,"text",1,null,0.6,2.4,0.06,0.375],["minimax-m3",512000,128000,"text,image",1,null,0.6,2.4,0.12,0],["MiniMax-M3",1000000,128000,"text,image",1,null,0.3,1.2,0.06,0]],
"minimax": [["MiniMax-M2",196608,128000,"text",1,null,0.3,1.2,0,0],["MiniMax-M2.1",204800,131072,"text",1,null,0.3,1.2,0,0],["MiniMax-M2.5",204800,131072,"text",1,null,0.3,1.2,0.03,0.375],["MiniMax-M2.5-highspeed",204800,131072,"text",1,null,0.6,2.4,0.06,0.375],["MiniMax-M2.5-lightning",204800,32000,"text",1,null,0.3,2.4,0,0],["MiniMax-M2.7",204800,131072,"text",1,null,0.3,1.2,0.06,0.375],["MiniMax-M2.7-highspeed",204800,131072,"text",1,null,0.6,2.4,0.06,0.375],["minimax-m3",512000,128000,"text,image",1,null,0.6,2.4,0.12,0],["MiniMax-M3",1000000,128000,"text,image,video",1,null,0.6,2.4,0.12,0]],

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 Refresh the case-variant MiniMax-M3 row too

MiniMax providers opt into case-insensitive metadata lookup, but this line now has two MiniMax-M3 case variants with different capabilities: the refreshed MiniMax-M3 row has text,image,video and 1M context, while the earlier minimax-m3 row still has only text,image and 512k context. In lower-case configured/live IDs, and even in getJawcodeModelMetadataCaseInsensitive("minimax", "MiniMax-M3"), callers hit the stale row first, so the catalog still blocks video input and advertises the wrong context despite this refresh. Please update or deduplicate the case variant so every MiniMax-M3 lookup returns the refreshed capabilities.

Useful? React with 👍 / 👎.

@lidge-jun

Copy link
Copy Markdown
Owner

Thanks for this — the video finding is correct and I've applied it, but not in this shape. Closing with the reasoning, since two of the three premises don't hold.

Video input: right, and now landed upstream. MiniMax documents video for M3 and only M3 — the M2 series takes text and tool blocks but not image or video. Fixed at the source in jawcode as 762549f, and the generator type widening you proposed is adopted as d2e4cc984.

One correction worth recording: the grounding is the OpenAI-compatible endpoint, not the Anthropic one. Our minimax preset is adapter: "openai-chat" with baseUrl: "https://api.minimax.io/v1" (src/providers/registry.ts:1001; minimax-cn at :1013). The anthropic-messages + /anthropic pair in the metadata row is jawcode's own field, not a path opencodex calls. On our path video arrives as a video_url content part; the Anthropic path uses a {"type":"video","source":…} block. Same conclusion, different citation.

Pricing: the premise is wrong, so this part is not adopted. $0.30/$1.20 isn't stale — it's MiniMax's standing 50% discounted rate for the ≤512K input tier. $0.60/$2.40 is that tier's list price and simultaneously the >512K rate. Both are official numbers, so choosing which one a catalog carries is a policy decision rather than a staleness fix.

It also happens to be the wrong direction here: our row flattens a 1,000,000-token context into a single entry, so adopting list price would overstate the bill for most real requests. Cache-read $0.06 vs $0.12 splits the same way. If we ever want list pricing, it needs a tiered-cost model first, and that's a separate discussion.

Editing the generated file gets reverted. src/generated/jawcode-model-metadata.ts carries // Generated by scripts/generate-jawcode-metadata.ts. Do not edit by hand. — the next bun run generate:jawcode-metadata would drop a hand-edited row. That's why the fix went into the jawcode source instead.

There's a wrinkle behind that worth flagging: the committed generated file is already 95 models and 63 price rows out of sync with its source, plus a PROVIDER_ALIASES ordering drift. Nothing enforces sync — no test regenerates and compares — so it silently drifted. A regeneration today would therefore sweep 63 unrelated price changes into cost accounting alongside your one modality fix, including halving opencode-go/minimax-m3's advertised context from 1,000,000 to 512,000. So the resync is being handled as its own reviewed unit with a drift guard, and the M3 video row lands there as a clean one-row delta. Verified the combination produces exactly that:

["MiniMax-M3",1000000,128000,"text,image,video",1,null,0.3,1.2,0.06,0]
                              ^^^^^^^^^^^^^^^^^  video           ^^^^^^^^^ prices unchanged

Branch target. This PR targets main, which enforce-target already fails — per AGENTS.md every PR goes to dev, with main moving only by maintainer promotion. Worth knowing for next time.

One honest limitation on the feature itself: advertising video only changes what the catalog claims. No code in src/ emits a video_url part, and OcxContentPart is text | image only, so a video attachment is silently dropped rather than sent. The wire path is tracked separately — this change just stops the catalog from understating what the model supports.

Closing as superseded by the upstream fix. The video catch was a good one.

@lidge-jun lidge-jun closed this Jul 30, 2026
lidge-jun added a commit that referenced this pull request Jul 30, 2026
MiniMax-M3 accepts video, and the jawcode source now says so (jawcode 762549f),
so widen the generator's input-modality type and the type it emits from
("text" | "image")[] to ("text" | "image" | "video")[].

Type-only. RawModel.input is consumed via input.join(","), the row field is
string | null, and rowToMetadata casts unchecked — so tsc passes either way.
This keeps the declared type honest rather than fixing a compile error.

src/generated/jawcode-model-metadata.ts is deliberately NOT regenerated here.
That file is already 95 models / 63 price rows out of sync with its source, so a
regeneration would sweep unrelated price changes into cost accounting alongside
one modality fix. The resync is its own unit of work, with the delta reviewed on
its own merits and a drift guard added; the M3 video row lands there as a clean
one-row delta.

Reported as #706, which proposed the same type widening but hand-edited the
generated file and also swapped MiniMax's discounted rates for list prices.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants