Bug: codex exec --json CollabToolCallItem omits error details when status is failed

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

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

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

評価

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

調査の方向性

まず codex-rs/exec/src/exec_events.rs で CollabToolCallItem と McpToolCallItem を比較し、次に codex-rs/exec/src/event_processor_with_jsonl_output.rs のマッピングを調べます。コラボレーション呼び出しの失敗が生成される箇所を追跡し、失敗理由をアイテムに渡せるようにします。完了条件は、失敗したコラボレーション呼び出しが JSONL で値が設定されたオプショナルな error をシリアライズし、成功した呼び出しは変更されないまま、出力をカバーする関連 Rust テストが存在することです。

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

説明

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

When a multi-agent collaboration tool call (spawn_agent, send_input, wait, resume_agent, close_agent) fails, codex exec --json emits a collab_tool_call item with "status": "failed", "receiver_thread_ids": [], and "agents_states": {} — with no error field or failure reason.

By contrast, McpToolCallItem in the same file (codex-rs/exec/src/exec_events.rs) includes pub error: Option<McpToolCallItemError> so headless JSONL consumers can inspect why a tool call failed.

Source Location (main @ 065e18b)
  1. No error field on CollabToolCallItem — codex-rs/exec/src/exec_events.rs:252-259:
    pub struct CollabToolCallItem {
        pub tool: CollabTool,
        pub sender_thread_id: String,
        pub receiver_thread_ids: Vec<String>,
        pub prompt: Option<String>,
        pub agents_states: HashMap<String, CollabAgentState>,
        pub status: CollabToolCallStatus,
    }
    
  2. JSONL serialization — codex-rs/exec/src/event_processor_with_jsonl_output.rs:233-262:
    Maps ThreadItemPayload::CollabAgentToolCall to CollabToolCallItem without any error message field.
Reproduction
  1. Run codex exec --json on a multi-agent workflow where spawn_agent fails (for example, exceeding max_threads or passing an invalid task_name).
  2. Inspect the emitted item.completed JSONL event:
    • status is "failed", receiver_thread_ids is [], agents_states is {}.
    • No error string or reason code is present anywhere in the JSONL event, making it impossible for automated runners or trace evaluators to distinguish thread-limit exhaustion, validation errors, and not_found target errors from the JSONL stream.

(Reproduced during TraceTrial-Bench Core-95 evaluation on L3-widefanout-004 — 6 consecutive spawn_agent failures with no failure reason in JSONL — with [email protected].)

Expected Behavior

Include an optional error field (e.g. #[serde(skip_serializing_if = "Option::is_none")] pub error: Option<...> matching McpToolCallItem) on CollabToolCallItem and populate it when a collaboration tool call fails.

主要言語
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 を短くまとめたダイジェスト。