Skip to content

Add image support in TUI#13908

Open
kevinyang372 wants to merge 4 commits into
masterfrom
kevin/add-image-support
Open

Add image support in TUI#13908
kevinyang372 wants to merge 4 commits into
masterfrom
kevin/add-image-support

Conversation

@kevinyang372

@kevinyang372 kevinyang372 commented Jul 17, 2026

Copy link
Copy Markdown
Member

Description

Adds image attachments to Warp's TUI Agent prompts.

  • Recognizes pasted local PNG, JPEG, GIF, and WebP paths and consumes them as image context instead of inserting the paths into the prompt.
  • Supports raw clipboard images through the same native WarpUI system clipboard implementation used by the GUI.
  • Adds a dedicated attachment model and bar with eager loading state, multi-image navigation, removal controls, and TUI-scoped keybindings.
  • Locks the composer to Agent mode while an attachment is present, then restores normal input detection after attachments are removed or submitted.
  • Preserves ordinary text paste behavior when a paste is not a valid image attachment.

Linked Issue

N/A

Testing

  • Manually tested locally with ./script/run-tui
    • Confirmed authenticated local startup reaches a usable prompt without panicking.
    • Confirmed bracketed image-path paste is consumed and produces a finalized attachment.
    • Confirmed multi-image navigation and empty-input Backspace removal.
    • Confirmed ordinary pasted text falls back to the prompt.
  • Added model, rendering, input, and keybinding tests covering path parsing and processing, clipboard content, attachment state transitions, Agent-mode locking, paste fallback, and removal.
  • cargo nextest run -p warp_tui --no-fail-fast — 342 passed.
  • cargo nextest run -p warpui_core --features tui --no-fail-fast — 500 passed, 7 skipped.
  • cargo clippy -p warp_tui -p warpui -p warpui_core --all-targets -- -D warnings
  • ./script/format

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-IMPROVEMENT: Added support for attaching images to prompts in Warp's TUI.

@cla-bot cla-bot Bot added the cla-signed label Jul 17, 2026
@oz-for-oss

oz-for-oss Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

@kevinyang372

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overview

This PR adds TUI image attachment support, including a new attachment bar, paste/path ingestion, clipboard image handling, input-mode locking, keybindings, and render/model tests.

Concerns

  • The PR changes user-visible TUI behavior, but the description does not include the required terminal transcript, render snapshot diff, or ./script/run-tui capture demonstrating the end-to-end flow. For this user-facing TUI change, please include one of those artifacts before merge.
  • Pasted image paths are read fully into memory before any explicit byte cap is applied, which can stall or crash the TUI for very large files.

Security

  • The pasted-path ingestion path accepts user-controlled file paths and can perform unbounded memory allocation before rejecting oversized images.

Verdict

Found: 0 critical, 2 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread crates/warp_tui/src/attachment_bar/model.rs
@kevinyang372
kevinyang372 force-pushed the kevin/add-image-support branch from 490d3b8 to a6a4b07 Compare July 17, 2026 21:21
@kevinyang372
kevinyang372 requested a review from harryalbert July 17, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant