fix(pty): capability-elevation approval prompt PTY handoff - #1254
Conversation
Pause the supervised PTY relay before Linux seccomp-notify approval prompts and restore relay mode afterward. This keeps the terminal in cooked mode while the approval backend reads from /dev/tty, avoiding garbled prompt rendering and input freezes when --capability-elevation asks for runtime access. Also group per-notification mutable state into a small context struct so the seccomp handler stays within clippy limits. Resolves: #1198 Signed-off-by: Luke Hinds <lukehinds@gmail.com>
PR Review SummarySize
Affected crates
Blast radius — ContainedThis PR touches: source code Updated automatically on each push to this PR. |
There was a problem hiding this comment.
Code Review
This pull request introduces terminal pausing and resuming around supervisor-owned approval prompts. It refactors handle_seccomp_notification to accept a new SeccompNotificationState struct, which bundles several parameters including the PTY proxy. When requesting approval, the terminal is paused and subsequently resumed using the newly added resume_terminal_after_prompt method in PtyProxy. A unit test has also been added to verify this behavior. There are no review comments, and I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
hold on this, as I think I resolved in the Seccomp patch. Luke to test again to clarify |
|
/nogent review |
There was a problem hiding this comment.
nogent code review
No blocking issues.
Findings (not tied to a changed line):
- 🐛 [MEDIUM · bug]
crates/nono-cli/src/exec_strategy.rs:2965— The PR fixes terminal/PTY state corruption by pausing the PTY terminal proxy during Linux seccomp-notify capability-elevation prompts. However, the generic socket-based supervisor request pathway (used on macOS and as an alternative on Linux) insidehandle_supervisor_messagealso issues interactive approval prompts viaconfig.approval_backend.request_approval(). Becausehandle_supervisor_messagedoes not accept or pause/resume theptyproxy, any capability-elevation prompts triggered via the supervisor socket under PTY mode will still suffer from raw-mode terminal corruption, garbled rendering, and input freezes. Updatehandle_supervisor_message(and its callers inrun_supervisor_loop) to acceptpty: Option<&mut PtyProxy>and wrap itsrequest_approval()calls withpause_terminal_for_prompt()andresume_terminal_after_prompt()protection.
Automated code + security review. CI already covers clippy, rustfmt, tests, cargo-audit and commit-lint.
Extract the pause/prompt/resume sequence into a shared helper, request_approval_with_relay_paused, and use it from both the Linux seccomp-notify handler and the cross-platform supervisor socket path (handle_supervisor_message). Previously only the seccomp path paused the relay, so approval prompts triggered over the supervisor socket (macOS Seatbelt supervised mode) still rendered garbled and froze on input while a terminal client was attached. This also fixes the macOS CI failure: resume_terminal_after_prompt was only referenced from Linux-only code, tripping -D dead-code on the macOS binary build. Gate the UnixDatagram test import to Linux for the same reason. Resolves: #1198 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Luke Hinds <lukehinds@gmail.com>
SequeI
left a comment
There was a problem hiding this comment.
lgtm, cleaner abstraction. Thanks!
Pause the supervised PTY relay before Linux seccomp-notify approval prompts and restore relay mode afterward. This keeps the terminal in cooked mode while the approval backend reads from /dev/tty, avoiding garbled prompt rendering and input freezes when --capability-elevation asks for runtime access.
Also group per-notification mutable state into a small context struct so the seccomp handler stays within clippy limits.
Linked Issue
Resolves: #1198
Checklist
CHANGELOG.mdif needed