TypeScript SDK rejects local image filenames beginning with a hyphen

Aperta Adatta ai principianti
#60,991 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
cli

Direzione di ricerca

L’SDK costruisce gli argomenti CLI in sdk/typescript/src/exec.ts, intorno alle righe 173–180. Leggi la costruzione degli argomenti e individua i test degli argomenti per i turni nuovi e ripresi. Aggiorna la gestione degli argomenti delle immagini in modo che un nome di file che inizia con un trattino venga passato intatto, poi esegui quei test e conferma che coprono -sample.png.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug CLI exec windows-os

What issue are you seeing?

A valid relative image filename beginning with - cannot be attached through the TypeScript SDK. The SDK passes --image and the filename as separate arguments, and the CLI interprets the filename as an option rather than the image value.

Reproduction

In a directory containing a valid PNG named -sample.png, run a turn with the SDK:

import { Codex } from "@openai/codex-sdk";

const thread = new Codex().startThread({
  workingDirectory: process.cwd(),
  skipGitRepoCheck: true,
});
await thread.run([
  { type: "text", text: "Describe this image." },
  { type: "local_image", path: "-sample.png" },
]);

The CLI exits with code 2 and reports that a value is required for --image. The failure happens before the model request. Changing the path to ./-sample.png is a workaround.

I reproduced this with the actual bundled SDK and Codex CLI 0.167.0-alpha.4.1 on Windows, using a local mock Responses server. normal.png and ./-sample.png completed and reached the mock; -sample.png failed before a request. As an independent control, codex exec --image=-sample.png ... accepted the same file and completed against the mock.

Expected behavior

The SDK should pass a literal path intact even when it starts with a hyphen. One option is to use the single-argument --image=<path> form; add fresh and resumed-turn argument tests. This is distinct from #60587, which concerns commas in image paths.

The SDK constructs the arguments here. Source checked at 6bfdc75f0d9e6fae313234f694839866d7c63c39.

Lingua principale
Rust
Stelle
135k
Fork
21.4k
Merge medio
1m
PR unite (30g)
995

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openai/codex

Tutte le issue di openai/codex

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.