mirror of
https://github.com/openai/codex.git
synced 2026-05-05 03:47:01 +00:00
2.4 KiB
2.4 KiB
+++ id = "19" title = "Bash Command Rendering Improvements for Less Verbosity" status = "Merged" dependencies = "02,07,09,11,14,29" last_updated = "2025-06-25T05:36:32.641375" +++
This task is specific to per-agent UI conventions and log readability.
Acceptance Criteria
- Shell commands render as plain text without
bash -lcwrappers. - Role labels and message content appear on the same line, separated by a space.
- Command-result annotations show a checkmark and duration for zero exit codes, or
exit code: Nand duration for nonzero codes, in the format<icon or exit code> <duration>ms. - Existing functionality remains unaffected beyond formatting changes.
- Verbose background event logs (e.g. sandbox‑denied exec errors, retries) collapse into a single command execution entry showing command start, running indicator, and concise completion status.
- Automated examples or tests verify the new rendering behavior.
Implementation
This change will touch both the event-processing and rendering layers of the Rust TUI:
-
Event processing (
codex-rs/exec/src/event_processor.rs):- Strip any
bash -lcwrapper when formatting shell commands viaescape_command. - Replace verbose
BackgroundEventlogs for sandbox-denied errors and automatic retries with a unified exec-command begin/end sequence. - Annotate completed commands with either a checkmark (✅) and
<duration>msfor success orexit code: N <duration>msfor failures.
- Strip any
-
TUI rendering (
codex-rs/tui/src/history_cell.rs):- Collapse consecutive
BackgroundEvententries related to exec failures/retries into the standard active/completed exec-command cells. - Update
new_active_exec_commandandnew_completed_exec_commandto use the new inline format (icon or exit code + duration, with$ <command>on the same block). - Ensure role labels and plain-text messages render on a single line separated by a space.
- Collapse consecutive
-
Tests (
codex-rs/tui/tests/):- Add or update test fixtures to verify:
- Commands appear without any
bash -lcboilerplate. - Completed commands show the correct checkmark or exit-code annotation with accurate duration formatting.
- Background debugging events no longer leak raw debug strings and are correctly collapsed into the exec-command flow.
- Commands appear without any
- Add or update test fixtures to verify:
Notes
- Improves readability of interactive sessions and logs by reducing boilerplate.
- Ensure compatibility with both live TUI output and persisted log transcripts.