IDEA的ACP中配置iflow后提示需要缺少模型参数

我的系统是Windows10 ,使用的IDEA,对acp的配置如下:

"iflow": {
  "command": "C:\\\\Users\\\\cwsong\\\\AppData\\\\Local\\\\nvm\\\\v22.21.1\\\\iflow.cmd",
  "args": \["--experimental-acp","-y"\]
}

然后新建聊天切换到iflow的时候没有显示可选模型,发送消息会收到错误提示:

Failed to initialize ACP session. Error: Field 'modelId' is required for type with serial name 'com.agentclientprotocol.model.ModelInfo', but it was missing


尝试一下;你的报错信息现实的是没有配置上模型id

:wrench: 修改步骤

  1. 定位配置文件 :找到你正在使用的配置文件(可能是 JSON、JSONC 或 IDE 的设置文件)。
  2. 添加参数
  • args 数组中,除了已有的 --experimental-acp-y 外,新增两行
    • "--model-id"
    • "具体的模型ID" (例如:"gpt-4""qwen-long" 或你服务端支持的模型名称)。
  1. 保存并重启 :保存文件后,重新启动你的 IDE 或服务。
1 个赞

我用的–model-id
发送消息就报错了:

Failed to initialize ACP process. Process terminated with exit code: 1. Process output:
Usage: iflow [options] [command]

iFlow CLI - Launch an interactive CLI, use -p/--prompt for non-interactive mode

Commands:
  iflow [query]     Launch iFlow CLI  [default]
  iflow mcp         Manage MCP servers
  iflow commands    Manage marketplace commands
  iflow agent       Manage agents
  iflow workflow    workflowCommand.description
  iflow skill       Manage skills

Positionals:
  query  Optional query to process (equivalent to -p for non-interactive or -i for interactive mode)  [string]

Options:
  -m, --model                           Model  [string]
  -p, --prompt                          Prompt. Appended to input on stdin (if any).  [string]
  -i, --prompt-interactive              Execute the provided prompt and continue in interactive mode  [string]
  -c, --continue                        Start the application and load the most recent conversation from current directory  [boolean] [default: false]
  -r, --resume                          Resume conversation from a specific session file. If no session ID is provided, shows interactive session selector.
  -s, --sandbox                         Run in sandbox?  [boolean]
      --sandbox-image                   Sandbox image URI.  [string]
  -d, --debug                           Run in debug mode?  [boolean] [default: false]
  -a, --all-files                       Include ALL files in context?  [boolean] [default: false]
      --all_files                       Include ALL files in context?  [deprecated: Use --all-files instead. We will be removing --all_files in the coming weeks.] [boolean] [default: false]
      --show-memory-usage               Show memory usage in status bar  [boolean] [default: false]
      --show_memory_usage               Show memory usage in status bar  [deprecated: Use --show-memory-usage instead. We will be removing --show_memory_usage in the coming weeks.] [boolean] [default: false]
  -y, --yolo                            Automatically accept all actions (aka YOLO mode, see https://www.youtube.com/watch?v=xvFZjo5PgG0 for more details)?  [boolean] [default: false]
      --default                         Use default mode (manual approval for actions)  [boolean]
      --plan                            Use plan mode (planning without execution)  [boolean]
      --thinking                        Enable thinking mode when supported by the selected model  [boolean]
      --autoEdit                        Use auto-edit mode  [boolean]
      --telemetry                       Enable telemetry? This flag specifically controls if telemetry is sent. Other --telemetry-* flags set specific values but do not enable telemetry on their own.  [boolean]
      --telemetry-target                Set the telemetry target (local or gcp). Overrides settings files.  [string] [choices: "local", "gcp"]
      --telemetry-otlp-endpoint         Set the OTLP endpoint for telemetry. Overrides environment variables and settings files.  [string]
      --telemetry-log-prompts           Enable or disable logging of user prompts for telemetry. Overrides settings files.  [boolean]
      --telemetry-outfile               Redirect all telemetry output to the specified file.  [string]
      --checkpointing                   Enables checkpointing of file edits  [boolean] [default: true]
      --experimental-acp                Starts the agent in ACP mode  [boolean]
      --stream                          Enable or disable streaming mode  [boolean]
      --port                            Port number for ACP server (used with --experimental-acp)  [number]
      --allowed-mcp-server-names        Allowed MCP server names  [array]
      --include-directories, --add-dir  Additional directories to include in the workspace (comma-separated or multiple --include-directories)  [array]
      --max-turns                       Maximum number of model calls (assistant rounds) before terminating  [number]
      --max_turns                       Maximum number of model calls (assistant rounds) before terminating  [deprecated: Use --max-turns instead. We will be removing --max_turns in the coming weeks.] [number]
      --max-tokens                      Maximum total token usage (input + output) before terminating  [number]
      --max_tokens                      Maximum total token usage (input + output) before terminating  [deprecated: Use --max-tokens instead. We will be removing --max_tokens in the coming weeks.] [number]
      --timeout                         Maximum execution time in seconds before terminating  [number]
  -o, --output-file                     Output file path to save execution information (non-interactive mode only)  [string]
      --output_file                     Output file path to save execution information (non-interactive mode only)  [deprecated: Use --output-file instead. We will be removing --output_file in the coming weeks.] [string]
  -v, --version                         Show version number  [boolean]
  -h, --help                            Show help  [boolean]


Unknown arguments: model-id, modelId

嘿嘿,等等明天官方看看吧,兄弟,先用命令行终端

不知道官方啥时候管管

排查后判断是个bug,之后会修复,很抱歉影响您的使用 :pleading_face:

不懂就问,ACP是啥。。。?

用于连接代码编辑器(如IntelliJ IDEA, VS Code)与AI Agent(如Claude Code, Codex)的协议。

配置目的: 让AI助手直接在IDE中运行,而不是在终端里闪屏;实现更流畅的代码生成和工具调用(如MCP)。

1 个赞

okkkk,期待修复

ACP (Agent Client Protocol) 是 Zed 编辑器推出的一种通用智能体协议,使智能体的核心功能(服务端)和用户界面(客户端)解耦,允许用户自由选择不同的智能体服务端和客户端进行搭配使用。
翻译成人话:如果你的IDE/编辑器支持ACP协议,就可以在IDE原生AI功能中使用支持ACP协议的agent。
例如:假设IDEA、VSCODE支持ACP协议,就可以直接在IDEA/VSCODE自己的AI功能中使用codex、cc、opencode,而不需要对应的插件或者cli中使用。

新版本将修复这个问题,这两天发布最新版本哦~

刚刚又遇到个新问题:
agent选择iflow后提示Starting iflow ,过了很久之后提示:
Failed to initialize ACP session. Error: Process cancelled

是最新版本吗,方便的话可以提供下具体日志?

我看了下,版本是5.3.0,界面显示如图

acp日志如何上传?

刚刚更新到0.5.4,依旧是这个问题

好的,技术同学在看了

我从别人那抄了个acp配置就可以了,希望可以在IDEA内切换模型

    "iFlow": {
      "command": "C:\\nvm4w\\nodejs\\node.exe",
      "args": [
        "C:\\Users\\cwsong\\AppData\\Local\\nvm\\v22.21.1\\node_modules\\@iflow-ai\\iflow-cli\\bundle\\iflow.js",
        "--experimental-acp"
      ]
    }

切换模型这个功能需要等 ACP 规范中明确指出,然后等各个客户端适配才能用上。

如果在 terminal 里面可以直接运行 iflow 命令,可以尝试下面的配置。--stream 可以开启流式输出


{
  "default_mcp_settings": {},
  "agent_servers": {
    "iFlow": {
      "command": "iflow.cmd",
      "args": [
        "--experimental-acp",
        "--stream"
      ],
      "env": {
      }
    }
  }
}

我看QwenCode和OpenCode都可以进行切换,他们是怎么实现的呢?