Skip to content

Render multiline hook output in TUI#24965

Merged
abhinav-oai merged 1 commit into
mainfrom
abhinav/tui-multiline-hook-output
May 29, 2026
Merged

Render multiline hook output in TUI#24965
abhinav-oai merged 1 commit into
mainfrom
abhinav/tui-multiline-hook-output

Conversation

@abhinav-oai
Copy link
Copy Markdown
Collaborator

Why

Fixes #24529. Completed hook output in the TUI rendered each HookOutputEntry as one ratatui line, so explicit newlines inside hook output were not shown as separate transcript rows. That made multiline SessionStart.additionalContext hard to inspect even though the model-facing context path preserved the original text.

What

  • Split completed hook output entries on explicit newlines before rendering them in codex-rs/tui/src/history_cell/hook_cell.rs.
  • Keep the hook output prefix, such as hook context: or warning:, on the first physical line only.
  • Preserve explicit blank lines and render continuation lines with the hook body indent.
  • Add unit coverage for multiline context and warning output, plus a chatwidget snapshot regression for SessionStart history output.

Testing

  • cargo nextest run -p codex-tui completed_hook_multiline hook_completed_before_reveal_renders_completed_without_running_flash
  • just argument-comment-lint -p codex-tui -- --ignore-rust-version --lib --tests

Copy link
Copy Markdown
Contributor

@fcoury-oai fcoury-oai left a comment

Choose a reason for hiding this comment

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

Smoke tested and works as expected, good looks good! 👍

Approved.

@abhinav-oai abhinav-oai enabled auto-merge (squash) May 29, 2026 15:08
@abhinav-oai abhinav-oai merged commit 251b241 into main May 29, 2026
32 of 33 checks passed
@abhinav-oai abhinav-oai deleted the abhinav/tui-multiline-hook-output branch May 29, 2026 15:12
@github-actions github-actions Bot locked and limited conversation to collaborators May 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SessionStart additionalContext does not preserve multiline hook context in TUI

2 participants