Skip to content

fix(pragent): 修复 codex 编排通道 reasoning.effort=minimal 致 run 失败#78

Merged
huhamhire merged 1 commit into
devfrom
fix/codex-cli-reasoning-tools
Jun 18, 2026
Merged

fix(pragent): 修复 codex 编排通道 reasoning.effort=minimal 致 run 失败#78
huhamhire merged 1 commit into
devfrom
fix/codex-cli-reasoning-tools

Conversation

@huhamhire

Copy link
Copy Markdown
Owner

背景

修复 #77:启用 codex 作为本机 agentic CLI 时,Agent 编排通道(一键评审收尾 / 自由规划等)执行 agent 动作报 pr-agent exited with code 1,而普通 /review 正常。

根因

编排通道开低算力档 MEEBOX_CLI_REASONING=low → shim 对 codex 注入 -c model_reasoning_effort=minimal,触发两类 codex 400 使 codex exec 退 1:

  1. minimal 与 codex 默认工具 web_search / image_gen 互斥(API 400 invalid_request_error)。
  2. gpt-5.x-codex 不支持 minimal(仅 none/low/medium/high/xhigh)。

普通 /review 不开低算力档,故不受影响。

改动

  • 低算力档 minimallow:普遍受支持、与工具兼容。
  • 默认禁用 codex web_search / image_gen:评审/编排在只读临时目录里用不到,关闭收敛工具面并省约 3K tokens/请求。
    • -c web_search=disabled(字符串枚举 disabled/cached/live)
    • -c features.image_generation=false(feature flag,等价 --disable image_generation
  • 同步修正 ipc.ts 编排 env 注释中的 minimal 表述。

验证

实测 codex-cli 0.124.0 / gpt-5.5-codex:

  • 改前:-c model_reasoning_effort=minimal → exit 1(400)。
  • 改后:base flags / base+低算力档两种组合均 exit 0、正常返回 agent_message;input_tokens 30406 → 27420(工具定义不再下发)。

shim 改动需 npm --prefix apps/desktop run prepare:pragent 同步进 vendor(gitignored),本地已同步并冒烟通过。

Closes #77

Agent 编排通道开低算力档(MEEBOX_CLI_REASONING=low)时,shim 对 codex 注入
`-c model_reasoning_effort=minimal`,触发两类 codex 400 使 codex exec 退 1:
minimal 与默认工具(web_search / image_gen)互斥,且 gpt-5.x-codex 不支持 minimal。

- 低算力档改用 model_reasoning_effort=low(普遍受支持、与工具兼容)
- 默认禁用 codex web_search / image_gen(评审/编排在只读临时目录用不到,
  收敛工具面并省约 3K tokens/请求):-c web_search=disabled +
  -c features.image_generation=false

Closes #77

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@huhamhire huhamhire added the bug Something isn't working label Jun 18, 2026
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@huhamhire huhamhire merged commit 73f71b1 into dev Jun 18, 2026
1 check passed
huhamhire added a commit that referenced this pull request Jun 18, 2026
承接 #78:本机 CLI 模式下 codex 编排通道改用 model_reasoning_effort=low。
重构后该 env 注释位于 services/agent-orchestrator.ts(dev 侧对应改动在 ipc.ts),
此处同步表述,避免合并 dev 后注释口径不一致。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@huhamhire huhamhire deleted the fix/codex-cli-reasoning-tools branch June 18, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant