TypeScript SDK rejects local image filenames beginning with a hyphen
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- cli
Research direction
The SDK constructs CLI arguments in sdk/typescript/src/exec.ts around lines 173–180. Read that argument construction and locate the fresh and resumed-turn argument tests. Update the image argument handling so a filename beginning with a hyphen is passed intact, then run those tests and confirm they cover -sample.png.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Rust
- Stars
- 135k
- Forks
- 21.4k
- Avg merge
- 1m
- Merged PRs (30d)
- 995
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openai/codex
-
bug CLI exec session
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug CLI config
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
app-server bug CLI
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug CLI exec
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
app-server bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
compatibility
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
aws/aws-emulator#30 · 1 comment ·
-
tormach-plasma refusal text with no machine reads "no machine is not declared a plasma machine"Openarea:post bug effort:low P2 source:agent
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Higher Interval Candles draws nothing on a seconds chart whose interval does not divide two hoursOpenbug studies
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
userFRM/egui-charts#2727 ·
Maintainers usually reply within 1 day
-
enhancement priority::low upstream
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day