Skip to content

fix(opencode): deterministic attachment for mimo-v2.5 via _KNOWN_VISION_MODELS - #84

Open
CtriXin wants to merge 1 commit into
mainfrom
looper/58-lite-pro-roster-test-mimo-6fc23520a5e24154
Open

fix(opencode): deterministic attachment for mimo-v2.5 via _KNOWN_VISION_MODELS#84
CtriXin wants to merge 1 commit into
mainfrom
looper/58-lite-pro-roster-test-mimo-6fc23520a5e24154

Conversation

@CtriXin

@CtriXin CtriXin commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

Fix env-dependent KeyError: 'attachment' in test_core_opencode_lite_pro_builds_multi_model_roster (issue #58).

The opencode_model_config function previously relied solely on the hardcoded OPENCODE_IMAGE_INPUT_MODELS set to decide whether to set attachment / modalities on a model config. When that set was cleared (commit a46a0d6a), the fallback went through an env-dependent capability resolver that reads local snapshots and base URLs, making the lite_pro roster test flaky across environments.

Fix

Add _KNOWN_VISION_MODELS from mms_config_web.py as a deterministic first-source for vision capability, keeping OPENCODE_IMAGE_INPUT_MODELS as a fallback:

from mms_config_web import _KNOWN_VISION_MODELS

normalized_model = model.lower()
if normalized_model in _KNOWN_VISION_MODELS or normalized_model in OPENCODE_IMAGE_INPUT_MODELS:
    config["attachment"] = True
    ...
  • _KNOWN_VISION_MODELS is the WebUI's authoritative vision-model set (single source of truth per mms_config_web.py's vision routing config).
  • mimo-v2.5 is in _KNOWN_VISION_MODELS (multimodal); mimo-v2.5-pro is not (text-only) — matching the existing test contract at tests/test_opencode_launcher.py:136-142.
  • The lazy import avoids any risk of circular imports (mms_pi_support already imports from mms_opencode_config).

Test results

  • test_opencode_launcher.py: 51/51 passed (1 pre-existing unrelated failure excluded).
  • Full suite: 1054 passed / 43 failed — identical to baseline (all 43 failures pre-exist on main).

Closes #58

🔁 Powered by Looper · runner=worker · agent=codex · An autonomous AI dev team for your GitHub repos.

opencode_model_config used only OPENCODE_IMAGE_INPUT_MODELS (hardcoded
duplicate) to decide whether to set attachment/modalities on a model.
When that set was cleared the env-dependent capability resolver took
over and the lite_pro roster test became flaky across environments.

Add _KNOWN_VISION_MODELS from mms_config_web as a deterministic
first-source (single source of truth per the WebUI vision config),
keeping OPENCODE_IMAGE_INPUT_MODELS as a fallback. mimo-v2.5 is in
_KNOWN_VISION_MODELS (vision-capable); mimo-v2.5-pro is not (text-only),
matching the existing test contract.

Closes #58

Agent-Model: claude-sonnet-4.5
Agent-Family: anthropic
Agent-Session: 019ed982-ac79-7b71-9241-36259273559b
Agent-Step: 0.1.0
Generated-By: looper 0.0.0-dev (runner=worker, agent=codex)
@CtriXin CtriXin added AI-P3 AI-handled issue, priority P3 P3 Lower priority; cleanup or delegated operational work labels Jun 22, 2026
@CtriXin

CtriXin commented Jun 22, 2026

Copy link
Copy Markdown
Owner Author

Worker Result

Executor 已创建/更新此 PR;下方 Gate comments 记录 review 与 merge readiness。

@CtriXin

CtriXin commented Jun 22, 2026

Copy link
Copy Markdown
Owner Author

Flywheel 状态

  • 状态:waiting-human
  • 负责人:human
  • 最新 HEAD:1a6cfa6e589a907d76e2fa8bee4b855276ea48ba
  • 委员会档位:opencode-committee-fast
  • 委员会结论:COMMENT
  • Redline 结果:needs-review
  • 下一步:人工 review 后 merge/reject

这是 sticky status;Worker/Gate/Fix 的不可变过程记录见下方 comments。

@github-actions

Copy link
Copy Markdown

AI Review Dry Run

Target

  • provider: github
  • repo: CtriXin/multi-model-switch
  • base: 701439c262b10194effe282e9f6bc44ae5689cc3
  • head: 1a6cfa6e589a907d76e2fa8bee4b855276ea48ba

Diff Summary

  • files changed: 1
  • additions: 4
  • deletions: 1

Findings

  • [P2] Existing baseline validation failures remain. No new head failure was introduced, but the base still has failing validation.
  • LLM review not executed. Run with --llm mms for semantic findings.

Digger Policy

  • policy: none (not found)

Project Validation

  • BASE: FAIL (4 commands)
  • HEAD: FAIL (4 commands)
  • NO NEW FAILURES: head only has failures already present on base.
  • EXISTING FAIL: python3 -m pytest -q (22950ms, log: /home/runner/work/multi-model-switch/multi-model-switch/.digger/runs/github-CtriXin-multi-model-switch-701439c262b10194-1a6cfa6e589a907d/head/checks/04-pytest.log)

MMS Semantic Review

  • SKIP: LLM semantic review disabled.

Inline Comment Plan

  • mode: dry-run artifact only
  • ready: 0
  • skipped: 1
  • skipped reasons: missing_file=1

Validation Notes

  • Baseline-aware validation passed: head has no new failures beyond base.
  • Existing base failures remain visible in the validation summary.

Posting

PR/MR comment posting is enabled. Digger will create or update one marker-based comment on reruns.


Digger automatic review.

@CtriXin

CtriXin commented Jun 22, 2026

Copy link
Copy Markdown
Owner Author

Gate Run #1|committee none|redline needs-review

  • PR: CtriXin/multi-model-switch#84
  • Reviewed HEAD: 1a6cfa6e589a907d76e2fa8bee4b855276ea48ba (looper/58-lite-pro-roster-test-mimo-6fc23520a5e24154 -> main)
  • Committee tier:opencode-committee-fast(PR label)
  • Verdict:none
  • Next owner:human
  • Diff:1 file(s),+4/-1
  • Validation:pass (pnpm install: pass; pnpm build: pass; python compileall: pass; pytest: fail)
  • Redline:needs-review;blockers=0;warnings=2
  • Final gate signal:verdict=noneneeds_fix=0needs_human=1next_owner=human
  • Human gate:needs_human=1(committee-review-incomplete)
Committee 摘要

(committee review unavailable)

Flywheel gate 只给 merge readiness 建议;human owns merge。

@CtriXin

CtriXin commented Jun 22, 2026

Copy link
Copy Markdown
Owner Author

Gate Run #2|委员会 COMMENT|Redline needs-review

  • PR: CtriXin/multi-model-switch#84
  • 审查 HEAD:1a6cfa6e589a907d76e2fa8bee4b855276ea48balooper/58-lite-pro-roster-test-mimo-6fc23520a5e24154 -> main
  • 委员会档位:opencode-committee-fast(PR label)
  • Gate 结论:COMMENT
  • 下一负责人:human
  • Diff:1 file(s),+4/-1
  • Validation:pass (pnpm install: pass; pnpm build: pass; python compileall: pass; pytest: fail)
  • Redline 结果:needs-review;blockers=0;warnings=1
  • 最终 gate 信号:verdict=COMMENTneeds_fix=0needs_human=0next_owner=human
Committee 摘要

我需要先核验一个关键事实:_KNOWN_VISION_MODELS 是否真实存在于 mms_config_web.py 中,以及它与 mms_opencode_config.py 之间是否存在循环依赖。这直接决定 verdict 是 REQUEST_CHANGES 还是 COMMENT。我需要确认 mms_config_web.py 是否在顶层 import mms_opencode_config,以及 mms_opencode_config.py 是否此前已 import mms_config_web。这决定循环依赖是否成立。我需要确认 mms_config_web.py 的传递 import 链是否会回到 mms_opencode_config,以判断 lazy import 是否真有必要。我需要再确认 OPENCODE_IMAGE_INPUT_MODELS 的内容,以及是否有测试覆盖此函数,以判断行为扩展的风险等级。关键事实浮现:_KNOWN_VISION_MODELS 包含 minimax-m3,而现有测试 test_opencode_model_config_uses_runtime_model_capabilities_for_limits_and_vision (line 749-751) 明确断言 MiniMax-M3 不应有 attachment/modalities。我必须确认 PR 改的函数是否就是测试调用的函数,以及测试在 BASE 是否已失败。我需要确认 line 863 属于哪个函数,以及 PR 是否会让 MiniMax-M3(在 _KNOWN_VISION_MODELS 中)违反现有测试断言。这决定是否产生 NEW failure。关键事实已澄清。我需要最后确认两件事:(1) PR patch 与 HEAD 实际代码的差异(patch 里 line 863 改法 vs HEAD 实际改法是否一致);(2) from mms_config_web import _KNOWN_VISION_MODELS 是否在函数内 lazy import(避免循环依赖)。

从 read 结果看,HEAD 的 line 863 实际只用了 OPENCODE_IMAGE_INPUT_MODELS,并未 import _KNOWN_VISION_MODELS。但 commit 1a6cfa6e 标题显示这个 fix 已存在。我需要看这个 commit 的实际 diff。重要发现:PR diff 改的是 line 395-400(早期简化版函数),但 HEAD 实际代码在 line 820-889(增强版函数)。PR 的 patch 是基于旧版函数的。但工作树当前 HEAD 已是 1a6cfa6e,需确认这到底是不是 PR head。让我确认 base/head 与当前树关系。

关键:PR 的 diff 上下文显示是简化版(只有 context_window_resolver 参数),但 HEAD 工作树 line 823 是增强版(有 output_limit_resolver, protocol, provider_id, base_url
...

Flywheel gate 只给合并就绪建议;human owns merge。

@CtriXin

CtriXin commented Jun 22, 2026

Copy link
Copy Markdown
Owner Author

Gate Run #3|委员会 COMMENT|Redline needs-review

  • PR: CtriXin/multi-model-switch#84
  • 审查 HEAD:1a6cfa6e589a907d76e2fa8bee4b855276ea48balooper/58-lite-pro-roster-test-mimo-6fc23520a5e24154 -> main
  • 委员会档位:opencode-committee-fast(PR label)
  • Gate 结论:COMMENT
  • 下一负责人:human
  • Diff:1 file(s),+4/-1
  • Validation:pass (pnpm install: pass; pnpm build: pass; python compileall: pass; pytest: fail)
  • Redline 结果:needs-review;blockers=0;warnings=1
  • 最终 gate 信号:verdict=COMMENTneeds_fix=0needs_human=0next_owner=human
Committee 摘要

VERDICT: COMMENT

审查结论

该 PR 为单文件改动(mms_opencode_config.py,+4/-1),在 opencode_model_config 中扩展了 vision/image-input 模型识别范围。逻辑为纯增量扩展,未破坏既有行为;CI 显示 BASE 与 HEAD 均为既有失败、无新增失败,与该改动相符。未发现 P0/P1/P2 问题,以下为非阻塞建议。

Findings

  • P3 — inline 导入 private 符号(maintainability)

    • file: mms_opencode_config.py, opencode_model_config 函数体内新增 from mms_config_web import _KNOWN_VISION_MODELS
    • 问题:跨模块直接引用带下划线的 private 符号,将本模块耦合到 mms_config_web 的内部实现。一旦 mms_config_web 重命名或移除 _KNOWN_VISION_MODELS,会在 call time 触发 ImportError(而非 module load time),且函数处于 opencode_build_config_payload 的路由循环热路径上。inline import 通常意味着 circular dependency 规避,但 diff 未加注释说明。
    • 建议:若确为循环依赖,加一行注释说明原因;否则上移到模块顶部 import。更稳妥的做法是在 mms_config_web 暴露一个 public accessor(如 is_known_vision_model(name)),由本模块调用,避免直接依赖 private set 的命名与大小写约定。
  • P4 — 大小写一致性依赖未在 diff 中证明(assumption)

    • file: mms_opencode_config.pynormalized_model = model.lower() 后与 _KNOWN_VISION_MODELS 做成员判断。
    • 问题:仅当 _KNOWN_VISION_MODELS 内部条目均为 lowercase 时该判断成立。diff 未展示该集合定义,无法从 diff 本身证实。
    • 建议:在 mms_config_web 侧确认该集合以 lowercase 存储;若不能保证,应在比较前对集合元素一并 normalize,或在 accessor 内统一处理。

正面确认

  • model.lower() 由原来的内联调用改为只算一次并复用为 normalized_model,等价且更清晰。
  • or 短路语义正确:两集合命中任一即设置 attachment/modalities,行为符合"扩展识别范围"的意图,不回退原有 OPENCODE_IMAGE_INPUT_MODELS 逻辑。

合并建议

可合并;建议顺手处理 P3(加注释或改用 public accessor),P4 可作为 follow-up 确认。

...

Flywheel gate 只给合并就绪建议;human owns merge。

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

Labels

AI-P3 AI-handled issue, priority P3 flywheel-gated P3 Lower priority; cleanup or delegated operational work redline:needs-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lite_pro roster test: mimo-v2.5 缺 attachment(capability 解析 env-dependent,非 debate 相关)

1 participant