Files
plugins/packages
yetone bf302fab7d minimax 0.2.4: generate_image takes the catalog's area, n, output_format and reference_images (#955)
hokaii6990-boop (Windows 11, magpie 0.1.3654, plugin 0.2.3, CN site):
`magpie tool minimax_generate_image --requests '{"prompt":"...","area":"2K"}'`
answered "bad arguments: arguments.requests[0].area is not an accepted
argument", while the account's catalog schema has area, and
minimax_call_tool with the same arguments generated the image.

Our first reply said execute checks against the catalog's
input_schema_json. It does, but createConnectorTools wraps every tool's
execute in checked(t.args, args) first, and a named Matrix tool's args
are the bundled matrix-tools.json copy (2026-11-03: resolution,
input_urls, a six-value aspect_ratio). So that check refused the call
before the catalog was ever read.

- A named Matrix tool's call is now checked up front only for its two
  routing fields (site, account). Its own arguments are checked once, in
  execute, against the catalog entry's input_schema_json, and against the
  bundled copy only when the catalog gives none. A parameter MiniMax adds
  later passes without a plugin release. A priced call still never goes
  out with bad arguments; the catalog read now comes first.
  list_tools, tool_schema and call_tool keep their up-front check.
- The refusal names whose schema it was: "(checked against the account's
  catalog schema for connector__matrix__generate_image)", or the bundled
  one when the catalog gave none.
- matrix-tools.json's generate_image input_schema is the reporter's
  pasted `minimax_tool_schema --json` output, byte for byte after JSON
  parsing (kept as testdata/generate-image-schema-955.json). It is what
  agents are shown. Its description says reference_images, not
  input_urls. The other 15 tools' copies are unchanged; no fresher
  bytes for them.
- README says calls are checked against the live catalog.

Run:
- wsl-run (magpie-desktop, Bun 1.4.2), HOME=$(mktemp -d):
  bun test packages/minimax 148 pass 0 fail; bun scripts/check.mjs exit 0.
- win-run (xiaomi-gpu Windows 11, Bun 1.4.2), HOME and USERPROFILE a
  fresh temp dir: bun test packages/minimax 148 pass 0 fail;
  bun scripts/check.mjs exit 0.
- Broken by hand (wsl-run, connector-tools.test.mjs):
  - 0.2.3's code and bundle: 5 red, among them the area/n/output_format/
    reference_images call.
  - New code with 0.2.3's bundle: only the bundled-copy test red; the
    area call passes, held to the catalog.
  - New bundle with the old up-front check: 3 red (the catalog's
    refusal message, the no-schema fallback message, and a refusal that
    now reads the catalog first).

Not tried: no MiniMax Code account here, so no real generation; the
schema is the reporter's, from one CN-site account. The global site's
catalog was not seen. Codex desktop refusing area from the advertised
schema (the reporter's second path) was not reproduced; the refreshed
copy covers it for these fields. The get_asset_url /visible/ watermark
note is split out to #974.

Reported-by: hokaii6990-boop
Refs #955
2026-11-11 14:21:17 +08:00
..
middleware: param-override, model-map, system-prompt, word-guard and think-tags — gateway middleware that magpie runs on every agent's requests and replies, mostly New API's channel settings with the same JSON (the owner) — magpie can now run a plugin as gateway middleware (onRequest, onEvent, onResponse, in-process on moejs), and these are the first ones: param-override is New API's param_override (both forms, operations with gjson paths and conditions, return_error); model-map is model_mapping (chains, /regex/ keys with $1) and puts the asked-for name back into replies; system-prompt adds a prompt in each API's own place, keeping an agent's own unless override (New API's semantics), by agent or model; word-guard is the sensitive-word filter (reject or mask the user's text, optionally replies); think-tags strips a leading <think>…</think> from replies across stream chunks, or puts Chat reasoning_content into the text (thinking_to_content). Each is one file with no imports, named @magpie-community/middleware-<name>, with magpie.options as the example the app's editor starts from; registry.json lists them with "kind": "middleware" and no providers; check.mjs skips middleware-only packages. scripts/middleware.mjs calls the hooks as the gateway does (events split, [DONE] passed by) and runs each package's cases.json. Tested with a real DeepSeek account and real Claude Code through magpie's gateway: a mapped model named back in message_start, max_tokens capped, a system prompt appended for claude only, a word turned away as a 400 in Anthropic's shape, return_error as a 403 in Chat's, <think> stripped from Chat and Responses streams and an Anthropic whole reply, reasoning_content moved into the text. bun test (61 for these five) and bun scripts/check.mjs pass; packages/devin's two image tests fail on this machine only, as on main. Their first npm version has to be published by hand (trusted publishing can't create a package); until then magpie shows them as Coming soon.
2026-10-05 20:49:42 +08:00