Skip to content

oh-my-pi adapter passes invalid tool names in --tools flag #995

Description

@zhengxu245-boop

问题描述

botmux 的 oh-my-pi 适配器在通过 --tools 参数启动 omp 时,传入了 omp 不认识的工具名,导致 omp 启动校验失败,以 exit code 1 退出。

错误信息

CliUsageError: Unknown tool in --tools: ast_grep. Valid tools: read, bash, edit, write, browser, web_search, ast_edit, lsp, debug, glob, eval, grep, task, ask, goal, init_experiment, run_experiment, log_experiment, update_notes.

根因

botmux 的 oh-my-pi 适配器中硬编码了一个工具列表,包含 omp 不支持的名称:

来源文件: src/adapters/cli/oh-my-pi.ts(编译后为 dist/adapters/cli/oh-my-pi.js

问题代码片段:

buildArgs({ initialPrompt, model, workingDir, disableCliBypass }) {
    const args = [
        '--tools', 'read,bash,edit,write,browser,web_search,ast_grep,ast_edit,lsp,debug,find,eval,search,task,ask',
        // ...
    ];
}

无效的工具名:

工具名 问题
ast_grep omp 中不存在(正确的 AST 工具名是 ast_edit
find omp 中不存在
search omp 中不存在

影响

  • 每次 botmux 启动 omp 时,omp 校验 --tools 列表发现未知工具名,抛出 CliUsageError 异常
  • omp 进程以 exit code 1 退出
  • botmux 检测到进程退出后自动重试,导致连续崩溃(Oh My Pi crashed 4 times in 1 min, not auto-restarting
  • 该 bot 完全不可用

修复建议

将工具列表更新为 omp v17.4.0 实际支持的工具有效名称:

'--tools', 'read,bash,edit,write,browser,web_search,ast_edit,lsp,debug,glob,eval,grep,task,ask'

(移除 ast_grepfindsearch,添加 globgrep

或直接移除 --tools 参数,让 omp 使用默认的全部工具集(default: all)。

环境信息

  • botmux版本: 2.87.0
  • omp版本: 17.4.0
  • 运行环境: Linux, Node.js 22.22.3, bun

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions