fix(tui): correct Ctrl+C abort handling#44223
Conversation
Greptile SummaryThis PR fixes three related Ctrl+C interaction bugs in the TUI: abort is now prioritized over draft-input clearing when a run is active, stale exit-confirmation state ( Key changes across the six files:
Confidence Score: 4/5
Last reviewed commit: 44bb8db |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54241ad1c8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
This comment was marked as spam.
This comment was marked as spam.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b2eaf9bfb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 61f18e1ee0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed89a59095
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d142d19a2d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
This pull request has been automatically marked as stale due to inactivity. |
|
Codex review: found issues before merge. Summary Reproducibility: yes. Source inspection on current main shows Ctrl+C only evaluates editor text and exit timing, so with an active run and non-empty draft it takes the clear-input path instead of aborting. Next step before merge Security Review findings
Review detailsBest possible solution: Maintain one explicit TUI shortcut contract: either land abort-first Ctrl+C with matching docs, changelog, and focused validation, or keep Ctrl+C as clear/exit and resolve the confusion through the hint-only path in #38501/#38502. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection on current main shows Ctrl+C only evaluates editor text and exit timing, so with an active run and non-empty draft it takes the clear-input path instead of aborting. Is this the best way to solve the issue? Unclear. The patch is a narrow implementation if maintainers want Ctrl+C to abort active runs, but it is not clearly the best solution until the shortcut contract is chosen against the open hint-only alternative. Full review comments:
Overall correctness: patch is incorrect What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against a90be474f441. |
|
What is going on for this? |
Summary
Ctrl+Cin TUI only aborted active runs when the editor was empty, and abort handling could leave stale exit-confirmation state armed.Ctrl+Ccould clear the drafted next prompt instead of interrupting the run, or make a later singleCtrl+Cexit unexpectedly.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Ctrl+Cnow aborts an active TUI run even if the draft editor already contains the next prompt.Ctrl+Cshows the normal warning instead of exiting immediately.Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation:Repro + Verification
Environment
Steps
openclaw tuiand submit a prompt so the run entersrunning/streaming.Ctrl+C.Ctrl+Cagain once without an active run.Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoFailure Recovery (if this breaks)
54241ad1c.src/tui/tui.ts,src/tui/tui-event-handlers.ts,src/tui/tui.test.ts,src/tui/tui-event-handlers.test.tsCtrl+Cclearing draft input during active runs, or immediate TUI exit after a prior abort.Risks and Mitigations