Skip to content

Codex Response 接口接入 claude code,工具调用有问题 #47

@lesignals

Description

@lesignals

将 codex 转成 Response 接口接入 claude code时,调用 agent会出问题
❯ 用子 agent 看这个项目的启动入口
⎿  Read(go.mod · pages 1-5)
+9 more tool uses (ctrl+o to expand)
⎿  Invalid tool parameters

• 这是工具调用参数错了,不是“子 agent 看不懂项目”。

大概率是你上次调 spawn_agent 时字段名写错了。这个工具能吃的核心参数是这些:

  • agent_type: 一般看代码用 explorer
  • fork_context: 通常设 true
  • message 或 items: 二选一,最常用是 message
  • 可选:model、reasoning_effort

一个最小可用的调用长这样:

{
"agent_type": "explorer",
"fork_context": true,
"message": "请检查当前项目的启动入口,找出程序是从哪个文件、哪个 main 函数或启动命令进入的,并说明
调用链。"
}

常见会报 Invalid tool parameters 的写法有这些:

  • 把 message 写成了 prompt / task
  • agent_type 写了不存在的值
  • 同时传了 message 和 items,结构又不对
  • items 里字段不是 type/path/text/name
  • 参数包了一层额外对象,schema 对不上

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