Emit "approval-requested" desktop notification for request_permissions prompt
What version of Codex CLI is running?
codex-cli 0.120.0
What subscription do you have?
Pro
Which model were you using?
gpt-5.4
What platform is your computer?
Linux 6.8.0-107-generic x86_64 x86_64
What terminal emulator and version are you using (if applicable)?
ghostty
What issue are you seeing?
When a turn reaches the built-in request_permissions tool in Codex CLI TUI, Codex shows the permission approval prompt and waits for input, but no desktop notification appears for that prompt.
This makes it easy to miss the request when the terminal is unfocused, leaving the session blocked waiting for approval.
The prompt itself appears normally in the TUI, for example:
Would you like to grant these permissions?
Reason: <reason>
1. Yes, grant these permissions (y)
2. Yes, grant these permissions for this session (a)
3. No, continue without permissions (n)
The issue is not that the prompt fails to render. The issue is that no corresponding desktop notification / approval-requested notification seems to fire for this request_permissions path.
What steps can reproduce the bug?
- Start Codex CLI TUI with desktop notifications enabled for approval events, for example:
[tui]
notifications = ["approval-requested"]
- Start a turn that can reach the built-in request_permissions tool.
- Make the terminal unfocused before the permission request is emitted.
- Let the turn reach a request_permissions prompt.
- Observe that Codex is waiting on the permission prompt when you return to the terminal.
- Observe that no desktop notification was emitted for that prompt.
I do not have a thread id to attach for this repro.
What is the expected behavior?
A request_permissions prompt should trigger the same kind of approval notification as other blocking approval flows, so the user is notified when Codex is waiting for permission while the terminal is unfocused.
At minimum, this path should emit a desktop notification consistent with approval-requested.
Additional information
Current code also suggests this is a bug rather than a feature request. In codex-rs/tui/src/chatwidget.rs on current main:
- handle_request_user_input_now(...) calls self.notify(...)
- handle_request_permissions_now(...) does not call self.notify(...)
- existing approval notifications already exist for exec/edit/elicitation paths
So this looks like request_permissions is missing from an existing notification path rather than lacking a brand-new feature.
8 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
This feature requires a terminal that supports osc9 escape sequences, and your terminal needs to be configured to show notifications.
Try switching to
belnotifications (a simple beep) to see if that works for you. You can do this by addingnotification_method = "bel"under the[tui]section.I think this may be a different issue.
I agree terminal notification backend support matters for whether a posted notification is visible/audible. But in current
main, therequest_permissionspath appears not to post a notification at all.Relevant code:
handle_request_user_input_now(...)callsself.notify(...):https://github.com/openai/codex/blob/280a4a6d42c150fe5fa5133e7f265fe59aeec781/codex-rs/tui/src/chatwidget.rs#L4557-L4566
handle_request_permissions_now(...)does not callself.notify(...):https://github.com/openai/codex/blob/280a4a6d42c150fe5fa5133e7f265fe59aeec781/codex-rs/tui/src/chatwidget.rs#L4571-L4582
maindoes not include arequest_permissionsnotification path:https://github.com/openai/codex/blob/280a4a6d42c150fe5fa5133e7f265fe59aeec781/codex-rs/tui/src/chatwidget.rs#L10675-L10723
So BEL vs OSC 9 affects delivery, but this specific path appears to be missing the emit step.
I can also repro this as a differential test:
If helpful, I can open a PR or provide a smaller repro.
I implemented a local fix for this in my fork and verified that it fixes the issue locally: https://github.com/Mygod/codex/commit/537413eb2b0f1d26987caca841efb7ce193f6e57
The problem appears to be the missing notification emit in the
request_permissionspath. My patch emits a TUI notification fromhandle_request_permissions_now(...), routes it through the existingapproval-requestedcategory, and adds regression tests.cargo test -p codex-tuipasses locally.Changing this from a bug report to an enhancement request.
I published a small hook-based workaround that may help with this class of "Codex is blocked waiting for me" problems on macOS:
https://github.com/constansino/codex-attention-notifier
It uses Codex hooks to send a native macOS notification for
PermissionRequestevents.It is not a first-party fix for the missing notification path described in this issue, and it cannot detect every child process that blocks on stdin after it has already started. It is a practical workaround for approval cases while the native notification behavior is still being improved.
More details:
https://github.com/openai/codex/discussions/21354
I ran into the same class of problem while building CodeVibe, which lets people monitor and respond to local coding-agent sessions from mobile.
One thing we learned the hard way: a generic tool lifecycle signal is not enough for this UX. We initially treated early tool events like “probably waiting for approval,” but that creates false positives because some tools are auto-approved or policy-approved. For a remote/mobile approval surface, the useful signal is specifically:
For now we work around this in CodeVibe by using Codex’s
PermissionRequesthook when trusted, then verifying the exact desktop prompt/options from tmux before sending a mobile approval prompt. If the exact options are unavailable, we suppress rather than guess, because sending the wrong approval key would be worse than no notification.So +1 to this request. Adding
request_permissionsto the same approval-requested notification path would help desktop users immediately, and a stable machine-readable approval event would make external UIs much safer than scraping terminal state.For reference, this is the product/workaround we built around this gap: https://quantiya.ai/codevibe
This still sounds like it needs a Codex-side fix if the
request_permissionspath is not emitting a notification event at all.For people who want a broader workaround around “Codex is waiting and I’m away from the terminal,” we built ai-agent-notifier to route Codex task-complete and needs-input style events into desktop toasts and optional ntfy phone push: https://github.com/DevinoSolutions/ai-agent-notifier
Just run
npx ai-agent-notifier setup, reset your current sessions, and you are good to go!---
https://github.com/user-attachments/assets/5714b528-7e04-478e-abfd-2a3d05db562c
Watch on YouTube