Skip to content
This repository was archived by the owner on Sep 13, 2026. It is now read-only.

v2.2.1: 修复 analyze 传自然语言指令崩溃

Choose a tag to compare

@Moritz230127 Moritz230127 released this 29 Aug 05:44
· 70 commits to main since this release

问题

用户调用 analyze 时把自然语言指令(如"分析这张截图中的 fcitx5 候选框外观…")直接传给 --task,而 vs_analyze.py 把 task 当作配置文件名去打开 tasks/<task>.json → [Errno 36] File name too long 崩溃,经 bwrap 沙箱包装后表现为 python failed。

修复

  • vs_analyze.py:task 改为文件名安全校验(^[A-Za-z0-9_-]{1,64}$);传入自然语言长句时返回结构化清晰错误并列出可用任务(diagnose-screenshot / audit-pptx / classify-images / diff-screenshots),提示自由文本视觉分析改用 semantic 动作,不再崩溃。
  • 新增 --prompt 参数:随报告带出用户指令(不执行),附 note 指引语义分析走 semantic。
  • index.ts:analyze 动作补充 prompt 构建;task 描述明确为预置配置名(非自由文本)。

正确用法

  • 数值诊断截图:analyze task=diagnose-screenshot input=<png>
  • 自由文本视觉问答(如 fcitx5 外观分析):semantic image=<png> prompt="..."(VLM 兜底,本地 Ollama)

验证

  • analyze 有效任务正常产出;无效 task 返回结构化错误(非崩溃);客户视角零报错。