magpie icon indicating copy to clipboard operation
magpie copied to clipboard

同步 OpenBot 配置时漏写 inputs 和 reasoningEfforts,导致无法传图和选择思考等级

Open Felix-Jung opened this issue 2 weeks ago • 2 comments

magpie version

0.1.4654

Where

GUI

OS

macOS 26

Agent, provider and model

No response

Steps to reproduce

  1. 在 macOS 上使用 magpie v0.1.4654 连接并同步模型到 OpenBot(写入 ~/Library/Application Support/OpenBot/openbot-custom-providers-v1.json)。
  2. 打开 OpenBot,在 magpie 供应商下选择任意支持多模态和思考等级的模型(如 Claude / GPT / Gemini / DeepSeek 等)。
  3. 尝试在对话里上传图片/PDF,或切换思考等级(reasoning effort)。
  4. 对照查看本地接口 http://127.0.0.1:3425/agent/openbot/v1/models 与 openbot-custom-providers-v1.json 中 magpie 段的模型定义。

What happened, and what you expected

实际结果: OpenBot 中所有经 magpie 同步的模型都无法上传图片/PDF,也不显示思考等级选项。检查 openbot-custom-providers-v1.json 发现,magpie 写入每个模型时只包含了 id、name、contextWindow,漏掉了 inputs 和 reasoningEfforts(以及可选的 maxOutput),而 magpie 自己的 /agent/openbot/v1/models 接口实际上已经返回了完整的 modalities.input 和 reasoning_levels。

期望结果: magpie 同步 OpenBot 配置时,应把网关里的能力字段一并写入每个模型条目:

  • inputs:["image", "pdf"] 的有序子集(纯文本模型可省略或写 [])
  • reasoningEfforts:["none", "minimal", "low", "medium", "high", "xhigh", "max"] 的有序子集(无思考等级可省略或写 [];需过滤掉 OpenBot 不认的值如 "ultra",并严格保持该顺序,否则 OpenBot 校验会失败)
  • maxOutput(可选):范围 256 ~ 1000000 的整数

手动按 /agent/openbot/v1/models 补齐上述字段并重启 OpenBot 后,传图和思考等级均已恢复正常;希望 magpie 原生写入,避免下次同步被覆盖。

Error text or logs


Felix-Jung avatar Nov 21 '26 13:11 Felix-Jung

Prepared a fix on fork branch fix/7439-openbot-model-capabilities (1d1330ce, based on f0b58041):

  • inputs: writes an ordered subset of ["image", "pdf"] (image follows m.Images including Vision's stand-in; pdf follows InputModalities), writes explicit [] for known text-only models so OpenCode writes modalities: {input: ["text"], output: ["text"]} instead of defaulting image input on, and omits inputs only when input modalities are unknown.
  • reasoningEfforts: normalizes, deduplicates, filters unsupported words (ultra, light, persistent, etc.), and orders into ["none", "minimal", "low", "medium", "high", "xhigh", "max"]; writes explicit [] (variants: {}) for non-reasoning/reasonless/unsupported-level models, and omits it only for toggle-only reasoning models (Reasoning && len(Efforts) == 0).
  • maxOutput: emits maxOutput when contextWindow is written and 256 <= output <= 1_000_000 with output < contextWindow.
  • Updated docs/subsystems/agent-wiring.md and added unit/integration coverage in internal/agent/openbot_test.go (go test -race -count=1 ./internal/agent -run 'TestOpenBot', TestEvery|TestFolder|TestDocs, and darwin/linux-nogui/windows go vet all pass).

eisen0419 avatar Nov 21 '26 15:11 eisen0419

Fixed in v0.1.5212 (97cc6b916).

magpie now writes each model's inputs, reasoningEfforts and maxOutput into openbot-custom-providers-v1.json, in the form OpenBot (v0.74.0+) accepts:

  • inputs: image when the model takes images (or magpie's Vision describes them for it), pdf when its source lists pdf. A known text-only model gets [].
  • reasoningEfforts: the model's levels that OpenBot names (light is written as low, extra_high as xhigh). A model that doesn't think gets []. A model that thinks without named levels leaves the field out, so OpenBot offers low/medium/high.
  • maxOutput: written only when it is below the context window.

A value you wrote by hand on one of magpie's models stays through every sync, including one written before this version. It is replaced only when you set the same thing for that model in magpie (Max output, Images, or its reasoning levels).

OpenBot reads the file only when it starts, so restart OpenBot after updating magpie.

Ported from @eisen0419's branch, credited in the commit. Leaving this open until someone confirms it works in OpenBot.

yetone avatar Nov 30 '26 14:11 yetone