Skip to content

Conversation

@mikita-oai
Copy link

@mikita-oai mikita-oai commented Jan 5, 2026

What

  • When a user pastes a local image file path (or pastes an image from the clipboard), the TUI inserts an attachment
    placeholder into the composed prompt. This placeholder now includes the full path (e.g. /tmp/image.png instead of only the basename (e.g. image.png).
  • We separate the user-visible vs model-visible placeholder, to preserve the current aesthetics and avoid cluttering the input. So the user still sees image.png while the model sees /tmp/image.png.
  • Updated both TUI implementations (codex-tui and codex-tui2) + tests.

Why

  • Basename-only placeholders make it hard for the model to refer back to the actual local path (e.g. when the user wants
    the model to use the path in commands / docs / patches rather than “just see the image”).

Testing done

  1. Updated automated tests and ran:
cargo test -p codex-tui; cargo test -p codex-tui2
  1. Built codex locally and confirmed it can now see the full path
Screenshot 2026-01-06 at 19 06 15

When users paste a local image file path (or paste an image from the clipboard), Codex inserts a placeholder in the composed prompt.

Previously the placeholder only included the basename; this makes it hard for the model to refer back to the actual local file path. Include the full path instead.

Tests: cargo test -p codex-tui; cargo test -p codex-tui2
@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the TUI attachment placeholder format to use full file paths instead of basenames, enabling models to reference the actual local file paths in responses.

Key Changes:

  • Modified attach_image() in both TUI implementations to use path.display() instead of extracting the filename
  • Updated all test assertions to expect full paths in placeholders (e.g., [/tmp/image.png 24x42] instead of [image.png 24x42])

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
codex-rs/tui2/src/bottom_pane/chat_composer.rs Changed placeholder generation to use full path via path.display() instead of file_name()
codex-rs/tui2/src/chatwidget/tests.rs Updated test assertion to expect full path in placeholder
codex-rs/tui/src/bottom_pane/chat_composer.rs Changed placeholder generation to use full path via path.display() instead of file_name()
codex-rs/tui/src/chatwidget/tests.rs Updated test assertion to expect full path in placeholder

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mikita-oai
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Jan 5, 2026
@mikita-oai mikita-oai changed the title tui: include full image paths in attachment placeholders tui: expand image placeholders to full paths for models (keep basenames for users) Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants