Skip to content

helper 配置 pi 时第三方 Plan 模型缺少 input/contextWindow 元数据,导致多模态模型被宿主按纯文本处理 #25

Description

@yaokuku123

环境

  • arkcli: 1.0.33
  • 目标 harness: pi-coding-agent 0.86.0(@earendil-works/pi-coding-agent,macOS)
  • 配置命令:arkcli helper configure pi(Agent Plan profile)

问题描述

arkcli helper configure pi 写入 ~/.pi/agent/models.json 时,只有豆包(doubao-seed-*)系列模型被补全了模型元数据(input / contextWindow / maxTokens),第三方 Plan 模型(GLM / Kimi / DeepSeek / MiniMax)的条目只有光秃秃的 {"id": "..."}

pi 对 models.json 里未声明 input 字段的自定义模型默认按 ["text"] 处理(见 pi 官方文档 models.md,input 缺省为 text-only),结果就是:GLM-5.3-Flash、DeepSeek-V4-1-Flash、Kimi-K3、MiniMax-M3 这些原生多模态模型,在 pi 里全部无法读图——pi 的 read 工具遇到图片直接丢弃并提示:

[Current model does not support images. The image will be omitted from this request.]

复现步骤

  1. arkcli helper configure pi,选择 Agent Plan profile 完成配置
  2. 打开 ~/.pi/agent/models.json,观察 providers.agent-plan.models 数组
  3. 对比 doubao 与非 doubao 条目:
// doubao 系列正常:
{ "contextWindow": 262144, "id": "doubao-seed-2-1-turbo-260628", "input": ["text","image"], "maxTokens": 256000 }

// 第三方模型缺少全部元数据:
{ "id": "glm-5-3-flash" },
{ "id": "kimi-k3" },
{ "id": "deepseek-v4-1-flash" },
{ "id": "minimax-m3" }
  1. 在 pi 中切换到 glm-5-3-flash,让它读取一张本地图片 → 图片被丢弃,报 "does not support images"

根因分析

helper 文档提到模型元数据走 ArkModels LookupModelMeta → enrichModelMeta 管道,「查询失败时扩展字段保持未知并省略」。实测发现两个问题:

  1. 控制面模型索引查不到第三方模型arkcli models search kimi / search minimax 返回 {"items": []}search glm 也搜不到 glm-5.3,于是 enrich 被跳过;
  2. 但部分模型明明有权威数据却没被用上:例如 arkcli models search glm-5-3-flash 能查到完整模态信息——
{
  "name": "glm-5-3-flash",
  "input_modalities": ["text", "image", "video"],
  "context_window": 1048576,
  "max_completion_tokens": 131072
}

deepseek-v4-1-flash 同样能查到 input_modalities: ["text","image","video"],但写入 pi 配置时这些字段全部丢失。

实际影响

  • 多模态模型在 pi 中退化为纯文本,图片输入被静默禁用;
  • contextWindow 缺省时 pi 按 128K 处理、maxTokens 按 16K 处理,远低于这些模型实际支持的 1M 上下文,长上下文场景会被提前截断。

建议修复

  1. helper 写 pi 的 models.json 时,对控制面索引查不到的第三方 Plan 模型提供元数据回退来源(如 Plan 侧模型清单、或内置一份 Plan 模型能力表),至少把 input_modalities → inputcontext_window → contextWindowmax_completion_tokens → maxTokens 映射写全;
  2. 对确实无法获知模态的模型,在 helper configure 完成输出中提示用户:pi 侧未声明 input 的模型将按纯文本处理,多模态模型需手动在 models.json 中补 "input": ["text", "image"]

当前 Workaround

手动在 ~/.pi/agent/models.json 的对应模型条目补上(已验证 GLM-5.3-Flash 补配置后可正常读图):

{
  "id": "glm-5-3-flash",
  "input": ["text", "image"],
  "contextWindow": 1048576,
  "maxTokens": 131072
}

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions