feat(tui): add ambient terminal pets#21206
Conversation
5259c6f to
15bfa0f
Compare
|
@etraut-openai I have internalized the Sixel processing along with the rest of your feedback. Ready for another pass. |
etraut-openai
left a comment
There was a problem hiding this comment.
This is a really large PR, which makes it difficult to review in its entirety.
I did skim through the code, and I found a few issues (some with the help of codex).
I did a bunch of manual testing in various terminals — both those that support the graphics escapes and those that don't (all on macOS). It seems to work well.
I also verified that the total binary size increase. It's about 0.92MiB or a 0.5% increase, which is somewhat high for a single TUI feature, but I think it's within reason.
|
@etraut-openai thanks a lot for the review. I addressed them all, please do another pass when you can. |
etraut-openai
left a comment
There was a problem hiding this comment.
PR looks good.
I built the latest and did a quick smoke test.
I think there's room for some additional simplification, so consider running "simplify" pass on it before merging. See slack DM for details.
Why
The Codex App has animated pets, but the TUI had no equivalent ambient companion surface. This brings that experience into terminal Codex while keeping the main chat flow usable: the pet should feel present, but it cannot cover transcript text, composer input, approvals, or picker content.
The feature also needs to be terminal-aware. Different terminals support different image protocols, tmux can interfere with image rendering, and some users will want pets disabled entirely or anchored differently depending on their layout.
macOS - Ghostty, iTerm2 and WezTerm with Custom Pet
Windows Terminal
Linux - WezTerm and Ghostty
What Changed
codex-rs/tui/src/pets/./petsselection UI with a preview pane, loading state, built-in pet choices, and a first-rowDisable terminal petsoption.https://persistent.oaistatic.com/codex/pets/v1/..., and cache them locally under~/.codex/cache/tui-pets/.Current Scope
/petsselection, custom pets, terminal capability gating, and on-demand CDN-backed built-in assets.How to Test
/pets.Disable terminal pets.~/.codex/cache/tui-pets/, move onto a built-in pet and confirm the first preview downloads the spritesheet from the shared Codex pets CDN and renders successfully./pets, chooseDisable terminal pets, and confirm the sprite disappears cleanly.Targeted tests:
cargo test -p codex-tui ambient_pet_cargo test -p codex-tui resize_reflow_wraps_transcript_early_when_pet_is_enabledcargo insta pending-snapshots