Skip to content

codex CLI 集成:Agent 编排通道因 reasoning.effort=minimal 与默认工具冲突导致 run 失败 (exit 1) #77

@huhamhire

Description

@huhamhire

现象

启用 codex 作为本机 agentic CLI(CLI 集成模式)时,Agent 编排通道(一键评审的 describe→review→收尾、自由规划「对话即委派」等)执行 agent 自身动作时报错:

失败:pr-agent exited with code 1

而手动 /review 等普通 pr-agent 工具 run 正常(如截图能正常产出「未发现重大问题」),随后紧接着的编排动作才失败。

根因

编排通道会开低算力档 MEEBOX_CLI_REASONING=low,shim(cli/specs.py)据此对 codex 注入 -c model_reasoning_effort=minimal。该 flag 触发两类 codex 400,使 codex exec 退 1:

  1. minimal 与默认工具互斥:codex 默认携带 web_search / image_gen 工具,API 报
    invalid_request_error: The following tools cannot be used with reasoning.effort 'minimal': image_gen, web_search
  2. minimal 不被模型支持gpt-5.x-codex 仅支持 none/low/medium/high/xhigh,传 minimal
    unsupported_value: 'minimal' is not supported ... Supported values are: 'none','low','medium','high','xhigh'

普通 /review 不开低算力档(不带该 flag),故不受影响 —— 这解释了「评审结果先出来、紧接着编排动作失败」的现象。

修复方向

  • 低算力档对 codex 由 minimal 改为 low(普遍受支持、与工具兼容)。
  • 默认禁用 codex 的 web_search / image_gen:评审/编排在只读临时目录里用不到,关闭后收敛工具面并省约 3K tokens/请求。
    • web_search 为字符串枚举:-c web_search=disabled
    • image_gen 为 feature flag:-c features.image_generation=false

影响范围

  • apps/desktop/scripts/pragent-shim/meebox_pragent_shim/cli/specs.py(codex spec)
  • apps/desktop/src/main/ipc.ts(编排 env 注释中的 minimal 表述)

环境:codex-cli 0.124.0,模型 gpt-5.5-codex。

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions