Skip to content

[codex] Improve hook status rendering#17266

Merged
abhinav-oai merged 20 commits into
mainfrom
dev/abhinav/hook-status-messages
Apr 10, 2026
Merged

[codex] Improve hook status rendering#17266
abhinav-oai merged 20 commits into
mainfrom
dev/abhinav/hook-status-messages

Conversation

@abhinav-oai

@abhinav-oai abhinav-oai commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Make hook display less noisy and more useful by keeping transient hook activity out of permanent history unless there is useful output

Also addresses some of the concerns in #15497

Changes

Hook Lifecycle Rendering

  • Hook start events no longer write permanent history rows like Running PreToolUse hook.
  • Running hooks now render in a dedicated live hook area above the composer. It's similar to the active cell we use for tool calls but its a separate lane.
  • Running hook rows use the existing animation setting.

Hook Reveal Timing

  • We wait 300ms before showing running hook rows and linger for up to 600ms once visible.
    • This is so fast hooks don't flash a transient Running hook row before user can read it every time.
  • If a fast hook completes with meaningful output, only the completed hook result is written to history.
  • If a fast hook completes successfully with no output, it leaves no visible trace.

Completed Hook Output

  • Completed hooks with output are sticky, for example • SessionStart hook (completed).
  • Hook output entries are rendered under that row with stable prefixes: warning:, stop:, feedback:, hook context:, and error:.
  • Blocked hooks show feedback entries, for example • PreToolUse hook (blocked) followed by feedback: ....
  • Failed hooks show error entries, for example • PostToolUse hook (failed) followed by error: ....
  • Stopped hooks show stop entries and remain visually treated as non-success.

Parallel Hook Behavior

  • Multiple simultaneously running hooks can be tracked in one live hook cell.
  • Adjacent running hooks with the same hook event name and same status message collapse into a count, for example • Running 3 PreToolUse hooks: checking command policy.
  • Running hooks with different event names or different status messages remain separate rows.

Hook Run Identity

  • PreToolUse and PostToolUse hook run IDs now include the tool call ID which prevents concurrent tool-use hooks from sharing a run ID and clobbering each other in the UI.
  • This ID scoping applies to tool-use hooks only; other hook event types keep their existing run identity behavior.

App-Server Hook Notifications

  • App-server HookStarted and HookCompleted notifications use the same live hook rendering path as core hook events.
  • UserPromptSubmit hook notifications now render through the same completed hook output format, including warning and stop entries.

@abhinav-oai abhinav-oai marked this pull request as ready for review April 10, 2026 02:58
@abhinav-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 22490e9ba5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/tui/src/history_cell/hook_cell.rs Outdated
@abhinav-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@abhinav-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2a8e2ae1be

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/tui/src/history_cell/hook_cell.rs

@fcoury-oai fcoury-oai 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.

The code looks good, I was able to test it and it works great, aside from one finding below and the one that Codex already pin pointed.

Comment thread codex-rs/tui/src/chatwidget.rs
@abhinav-oai abhinav-oai requested a review from fcoury-oai April 10, 2026 20:02

@fcoury-oai fcoury-oai 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.

Looks good! Approved.

@abhinav-oai abhinav-oai merged commit 87b9275 into main Apr 10, 2026
26 of 30 checks passed
@abhinav-oai abhinav-oai deleted the dev/abhinav/hook-status-messages branch April 10, 2026 21:05
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 10, 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.

2 participants