Bug: CodexErrorDetails::AgentLimitReached { max_threads } drops max_threads from Display and model-facing collab spawn error

オープン 初心者向け
#64,537 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
88/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust
領域
cli

調査の方向性

codex-rs/protocol/src/error.rs を読み、CodexErrorDetails::AgentLimitReached が thiserror の表示形式を定義していることを確認してから、codex-rs/core/src/tools/handlers/multi_agents_common.rs を調べ、モデル向けの collab_spawn_error のフォーマットを確認します。codex exec --json と、agents.max_threads を超えるマルチエージェントワークフローで再現します。エラーに設定済みの max_threads の値が含まれ、モデルが collab spawn エラー経由でその値を受け取れる状態になったら完了です。

索引モデルが issue の本文から書いたものです。

説明

bug CLI subagent
Version / Commit
  • Observed in: codex-cli 0.172.0 (codex exec --json)
  • Verified on main (065e18b)
Summary

CodexErrorDetails::AgentLimitReached { max_threads } explicitly carries the configured max_threads: usize value, but its thiserror #[error(...)] format string omits {max_threads} and renders only "agent thread limit reached". Because collab_spawn_error forwards format!("collab spawn failed: {err}") to the model, a model hitting the concurrency cap receives "collab spawn failed: agent thread limit reached" with no indication of what the limit is (or that closing/waiting on active agents frees slots).

Source Location (main @ 065e18b)
  1. Error Display omits max_threads — codex-rs/protocol/src/error.rs:152-153:
    #[error("agent thread limit reached")]
    AgentLimitReached { max_threads: usize },
    
  2. Model-facing spawn error — codex-rs/core/src/tools/handlers/multi_agents_common.rs:68-78:
    pub(crate) fn collab_spawn_error(err: CodexErr) -> FunctionCallError {
        match err.details() {
            ...
            _ => FunctionCallError::RespondToModel(format!("collab spawn failed: {err}")),
        }
    }
    
Reproduction
  1. Run a multi-agent workflow that attempts to spawn more concurrent subagents than agents.max_threads (e.g., spawning 5 parallel subagents under a lower thread cap).
  2. Observe the tool error returned to the model:
    collab spawn failed: agent thread limit reached
    
    The max_threads value already present on AgentLimitReached { max_threads } is discarded.

(Reproduced during TraceTrial-Bench Core-95 multi-agent evaluation on C6-infra-research-subagent-001 with [email protected].)

Expected Behavior

Interpolate {max_threads} in CodexErrorDetails::AgentLimitReached (e.g., #[error("agent thread limit reached (max_threads={max_threads})")] or in collab_spawn_error) so both logs and the model know the active thread cap and can plan batching/closing accordingly.

主要言語
Rust
スター
136k
フォーク
21.6k
平均マージ
1分
マージ済み PR(30日)
999

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

openai/codex のほかの issue

openai/codex の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。