core-agent-ide/codex-cli/src
Robbie Hammond 8e2760e83d
Add fallback text for missing images (#397)
# What?
* When a prompt references an image path that doesn’t exist, replace it
with
  ```[missing image: <path>]``` instead of throwing an ENOENT.
* Adds a few unit tests for input-utils as there weren't any beforehand.

# Why?
Right now if you enter an invalid image path (e.g. it doesn't exist),
codex immediately crashes with a ENOENT error like so:
```
Error: ENOENT: no such file or directory, open 'test.png'
   ...
 {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'test.png'
}
```
This aborts the entire session. A soft fallback lets the rest of the
input continue.

# How?
Wraps the image encoding + inputItem content pushing in a try-catch. 

This is a minimal patch to avoid completely crashing — future work could
surface a warning to the user when this happens, or something to that
effect.

---------

Co-authored-by: Thibault Sottiaux <tibo@openai.com>
2025-04-18 22:55:24 -07:00
..
components feat: add flex mode option for cost savings (#372) 2025-04-18 22:15:01 -07:00
hooks feat: shell command explanation option (#173) 2025-04-17 13:28:58 -07:00
utils Add fallback text for missing images (#397) 2025-04-18 22:55:24 -07:00
app.tsx add support for -w,--writable-root to add more writable roots for sandbox (#263) 2025-04-17 15:39:26 -07:00
approvals.ts feat: add user-defined safe commands configuration and approval logic #380 (#386) 2025-04-18 22:35:32 -07:00
cli-singlepass.tsx fix: standardize filename to kebab-case 🐍➡️🥙 (#302) 2025-04-17 20:25:44 -07:00
cli.tsx feat: add flex mode option for cost savings (#372) 2025-04-18 22:15:01 -07:00
format-command.ts Back out @lib indirection in tsconfig.json (#111) 2025-04-16 14:16:53 -07:00
parse-apply-patch.ts chore: consolidate patch prefix constants in apply‑patch.ts (#274) 2025-04-17 17:00:30 -07:00
text-buffer.ts fix(text-buffer): correct word deletion logic for trailing spaces (Ctrl+Backspace) (#131) 2025-04-16 16:25:08 -07:00
typings.d.ts Initial commit 2025-04-16 12:56:08 -04:00