Skip to content

[codex] Keep TUI approvals inline#11

Merged
hzhaoy merged 1 commit into
mainfrom
codex/inline-tui-approvals
Jul 6, 2026
Merged

[codex] Keep TUI approvals inline#11
hzhaoy merged 1 commit into
mainfrom
codex/inline-tui-approvals

Conversation

@hzhaoy

@hzhaoy hzhaoy commented Jul 6, 2026

Copy link
Copy Markdown
Owner

What changed

  • Replaced the TUI tool-approval modal with an inline approval card in the main transcript.
  • Added automatic focus for approval cards so arrow-key navigation works immediately.
  • Disabled mouse-click approval selection; clicking an option only focuses the approval card.
  • Moved help and worker-error feedback into the transcript instead of transient notifications.
  • Removed the old full-screen approval modal and its now-unused selectable-option widget.

Why

The previous approval modal took over the terminal window, could obscure options, and did not match the transcript-first interaction style used by CLI coding agents. Approval decisions are now visible where the tool call appears, without redundant popups.

User impact

Users can review and approve tool calls inside the normal TUI flow. Keyboard interaction is more predictable, accidental mouse approvals are avoided, and non-essential popups are reduced.

Validation

  • uv run pytest

Inline HITL approval cards avoid modal takeover and keep approval outcomes visible in the chat stream. Help and worker-error paths now render in the transcript as well, while stale approval modal code is removed to prevent regressions back to full-screen prompts.

Constraint: TUI approval decisions must preserve existing resume_with_decision payloads
Rejected: Keep ApprovalModal as a fallback | no production path remained and it preserved an unwanted full-screen interaction
Confidence: high
Scope-risk: moderate
Directive: Do not reintroduce approval popups without a transcript-first interaction review
Tested: uv run pytest
Not-tested: Manual terminal rendering across very small viewport sizes
@hzhaoy
hzhaoy marked this pull request as ready for review July 6, 2026 15:28
@hzhaoy
hzhaoy merged commit f9a89ae into main Jul 6, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: 0c40e8e82e

ℹ️ 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".

from deep_code_agent.tui.widgets.approval_request import ApprovalRequest

widget = ApprovalRequest(interrupt_data, callback=callback)
self._mount_above_todos_card(widget)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve pending approvals when clearing chat

Because the active approval prompt is now mounted inside the chat log, the existing Ctrl+L screen binding can call clear_messages() while an HITL interrupt is waiting. That removes the only widget holding on_decision, so the interrupted stream never receives a resume decision and the input remains disabled until the user restarts/exits. Please either ignore/disable clear while an approval is pending or keep pending ApprovalRequest widgets out of the cleared transcript.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant