CLI / TypeScript SDK: image paths containing commas are split into separate attachments

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

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

@akhil9tiet がすでに取り組んでいます。

2026年11月10日 から。

評価

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

調査の方向性

まず、codex-rs/exec/src/cli_tests.rsについて説明されているパーサーの回帰ケースを確認し、次にcodex-rs/utils/cli/src/shared_options.rsとcodex-rs/exec/src/cli.rsにある画像引数の宣言を読みます。カンマによる分割が、想定されるリテラルなパスや既存のカンマ区切り構文とどのように作用するかを確認してください。パーサーのテストで、カンマを含むパスが1つの添付ファイルとして扱われることを確認し、fresh、resume、forkの動作も考慮できれば完了です。

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

説明

bug CLI exec

What issue are you seeing?

A literal local image path containing a comma cannot be passed through --image intact. For example, one existing screenshot,annotated.png is parsed as two attachments: screenshot and annotated.png. The same problem affects commas in parent directory names.

The TypeScript SDK exposes this as well: local_image.path is passed to the CLI as a single argument, but clap then splits the argument. Shell quoting does not preserve the path because the split happens after the shell has already produced argv.

Validated against source commit b32ada5320b043bde03a10edab6b88fc126812b4 (2026-11-10), using Node.js 24.22.1, Rust 1.95.0, and the repository's locked clap 4.5.58 on Linux x86_64.

What steps can reproduce the bug?

A user-facing example, given an existing PNG at that path:

codex exec 'Describe this image' --image './screenshot,annotated.png'

The corresponding SDK input is:

await thread.run([
  { type: 'text', text: 'Describe this image' },
  { type: 'local_image', path: '/tmp/screenshot,annotated.png' },
]);

A deterministic parser regression case can be added to codex-rs/exec/src/cli_tests.rs. It requires no account, model request, or image decoder:

#[test]
fn preserves_comma_in_literal_image_path() {
    let path = "/tmp/screenshot,annotated.png";
    let cli = Cli::try_parse_from([
        "codex-exec", "--experimental-json", "--image", path,
    ]).unwrap();
    assert_eq!(cli.images, vec![PathBuf::from(path)]);
}

The assertion fails with two parsed paths instead of one. I also executed the real SDK CodexExec.run() argv construction against a child fixture that prints its arguments, then passed those arguments through the unchanged production exec/src/cli.rs and utils/cli/src/shared_options.rs parser modules in an isolated harness. Unrelated protocol types were replaced by lightweight stand-ins; the image declarations and parser implementations were unchanged.

Observed control and failing outputs (common fixture directory shortened):

SDK argv: ["exec","--experimental-json","--image","/fixture/ordinary.png"]
parsed image count = 1
image = "/fixture/ordinary.png"; exists = true

SDK argv: ["exec","--experimental-json","--image","/fixture/screenshot,annotated.png"]
parsed image count = 2
image = "/fixture/screenshot"; exists = false
image = "annotated.png"; exists = false

SDK argv: ["exec","--experimental-json","resume","00000000-0000-4000-8000-000000000001","--image","/fixture/screenshot,annotated.png"]
parsed image count = 2
image = "/fixture/screenshot"; exists = false
image = "annotated.png"; exists = false

The original PNG exists in both failing cases. Fresh and resumed SDK turns are affected. Fork uses the same delimiter declaration; that path was inspected but not executed in the SDK test.

What is the expected behavior?

An SDK local_image.path should remain one exact filesystem path. CLI users should have a supported way to attach a file whose name or directory contains a comma. This could be implemented by accepting one literal path per repeated --image, or by providing a separate literal-path option while preserving existing comma-separated syntax.

Additional information

Validation is at the SDK transport/parser boundary, not a completed model turn. An attempted local full-CLI control run stopped during environment initialization before attachment processing, so it is not used as evidence of the image behavior.

Duplicate searches covered open and closed issues and PRs for image comma, image commas, image delimiter, and local_image comma, plus SDK comma. I found no equivalent literal-path report. #30106 and #40695 concern --image greedily consuming a positional prompt; this report is distinct and also reproduces in resume, where num_args = 1 already avoids that problem.

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

環境構築

はじめの一歩

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

openai/codex のほかの issue

openai/codex の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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