Repository navigation
Feature request: Notifications for approval prompts, job completion, and file saves #3052
Description
What feature would you like to see?
Thanks for the discussion here! I’d love to extend the current notify behavior beyond “session complete” to also cover:
Approval required — when Codex is waiting for user confirmation (command exec, file modify).
Job / tool run completion — when a long-running action finishes (success or error).
File writes / saves — when files are created/modified/moved/deleted by Codex.
Why
When switching windows, it’s easy to miss approval prompts and the session stalls.
For long runs, an audible/visual alert saves context switching.
For file operations, a discrete “saved/modified” cue helps keep track of side effects without watching the terminal.
// codex config
{
"notify": {
// enable/disable globally; default: true if previously enabled
"enabled": true,
// events to notify on (default: ["sessionComplete"])
"on": [
"sessionComplete", // existing behavior
"approvalPending", // NEW: user approval required
"jobCompleted", // NEW: tool/task finished
"fileWrite" // NEW: file create/modify/move/delete
],
// channels to use (any subset)
"channels": [
"systemNotification", // native system notification (current)
"sound", // short chime
"command" // run a shell command
],
// optional sound + command payloads
"sound": {
"enabled": true,
"path": "/System/Library/Sounds/Glass.aiff", // macOS example
"volume": 1.0
},
"command": {
"enabled": false,
"cmd": "afplay /System/Library/Sounds/Glass.aiff"
},
// allow per-event customization (overrides top-level)
"overrides": {
"approvalPending": { "channels": ["systemNotification","sound"] },
"jobCompleted": { "channels": ["sound"] },
"fileWrite": { "channels": ["systemNotification"] }
}
}
}
Suggested hook points (high-level)
approvalPending: fire when state transitions into “awaiting user confirmation” for command exec or file changes (same place that renders the approval UI).
jobCompleted: fire after tool/agent step resolves (success/failure), right before printing results. Include status + duration.
fileWrite: fire after file ops succeed (create/modify/move/delete). Include filenames, counts, and a short summary (e.g., “3 files updated”).
sessionComplete: keep existing behavior.
Each hook should emit through a small NotificationBus that fans out to systemNotification (existing), optional sound (cross-platform: afplay/PowerShell beep/paplay/aplay), or user-provided command.
Minimal pseudo-diff (illustrative)
// notificationBus.ts
export type NotifyEvent = "sessionComplete" | "approvalPending" | "jobCompleted" | "fileWrite";
export function notify(event: NotifyEvent, payload?: any) {
if (!cfg.notify.enabled) return;
const spec = resolveChannelsFor(event, cfg.notify);
if (spec.systemNotification) systemNotify(event, payload);
if (spec.sound) playSound(spec.sound.path);
if (spec.command) run(spec.command.cmd);
}
// approval flow
if (requiresApproval) {
notify("approvalPending", { kind: "command", text: cmdPreview });
await showApprovalUI(...);
}
// tool run completion
const result = await runTool(step);
notify("jobCompleted", { step, ok: result.ok, ms: result.ms });
// after file operations succeed
const stats = await applyFileChanges(changes);
notify("fileWrite", { stats }); // e.g., {created:1, modified:3, deleted:0}
Acceptance criteria
When approval is required, I receive a system notification (and optional chime).
When a tool finishes, I can get a quick chime (configurable), even if the terminal isn’t focused.
When files are written/moved/deleted by Codex, I get a concise notification.
All new notifications are opt-in via notify.on and respect notify.enabled.
Works on macOS/Windows/Linux (sound channel may fall back to a simple beep if no player).
Happy to help test a PR or iterate on naming (jobCompleted vs stepCompleted, etc.). Thanks!
Are you interested in implementing this feature?
Would love to work on this.
Additional information
No response
Activity
dedrisian-oai commentedon Sep 3, 2025
Thank you! Closing as it's already been reported (we definitely want this!)
NightMachinery commentedon Sep 28, 2025
@dedrisian-oai Where is this feature tracked? What parts are already implemented?
XoxRumbleLorexoX commentedon Sep 30, 2025
@NightMachinery - I believe it could be here https://github.com/openai/codex/pull/4329 but i could be wrong.
XoxRumbleLorexoX commentedon Sep 30, 2025
@NightMachinery - This is more useful i believe https://github.com/openai/codex/issues/3962
infoxiao commentedon Oct 8, 2025
approval-requested would be great!!