Codex notifications: काम पूरा होने या approval का इंतज़ार होने पर alert पाएँ

Codex आपको बता सकता है कि कब कोई turn पूरा हुआ और कब उसे आपकी approval चाहिए। पेच यह है: config फ़ाइल के दोनों तरीक़े अलग-अलग events कवर करते हैं, और ज़्यादातर terminals पर “desktop notification” चुपचाप एक bell बन जाती है।

लेखक: Aslan, Pet Island टीम · अपडेट: 26 अक्टू॰ 2026 · पढ़ने में 3 मिनट

संक्षेप में

[tui] section इस्तेमाल करें: notifications = ["agent-turn-complete", "approval-requested"], और अगर terminal पर focus होने पर भी alerts चाहिए तो notification_condition = "always"। Codex desktop notification (OSC 9) सिर्फ़ Ghostty, iTerm2, Kitty, Warp और WezTerm में भेजता है। बाक़ी हर जगह, Windows Terminal समेत, वह bell बजाता है। Top-level notify setting आपका अपना program चलाती है, लेकिन सिर्फ़ agent-turn-complete के लिए, approvals के लिए कभी नहीं।

दो अलग settings

[tui] notificationsnotify
क्या करता हैCodex CLI से terminal alertआपका चुना हुआ program चलाता है
Turn पूराहाँ (agent-turn-complete)हाँ (agent-turn-complete)
Approval माँगी गईहाँ (approval-requested)नहीं
Plan / सवाल वाले promptsहाँ (plan-mode-prompt, async-question)नहीं
Defaultचालूबंद

अगर आप जानना चाहते हैं कि Codex कब आपका इंतज़ार कर रहा है, तो अकेला notify यह कभी नहीं करेगा। इसके लिए TUI notifications इस्तेमाल करें।

TUI notifications

OpenAI के sample configuration का यह ज़रूरी हिस्सा है:

~/.codex/config.tomlकॉपी करें
[tui]
# Desktop notifications from the TUI: boolean or filtered list. Default: true
notifications = ["agent-turn-complete", "approval-requested"]
# Notification mechanism for terminal alerts: auto | osc9 | bel. Default: "auto"
notification_method = "auto"
# When notifications fire: unfocused (default) | always
notification_condition = "unfocused"
  • notifications: true, false, या events की list। approval-requested command, file-edit और MCP approval requests को कवर करता है।
  • notification_condition: default रूप से alerts सिर्फ़ तब fire होते हैं जब terminal पर focus न हो। अगर आप terminal को दूसरे monitor पर दिखता हुआ रखते हैं तो always सेट करें।
  • notification_method: auto, osc9 or bel.

Messages कुछ ऐसे दिखते हैं: “Approval requested: <command>”, “Codex wants to edit <file>” और “Agent turn complete”।

आपको सिर्फ़ beep क्यों सुनाई देती है (Windows Terminal और दूसरे)

auto mode में Codex desktop notification (OSC 9 escape sequence) सिर्फ़ तब भेजता है जब वह Ghostty, iTerm2, Kitty, Warp या WezTerm को पहचानता है। हर दूसरे terminal (Windows Terminal, VS Code terminal, Apple Terminal) को terminal bell मिलती है। यह Codex के source code (tui/src/notifications/mod.rs) से पता चलता है; docs सिर्फ़ इतना कहते हैं कि auto “prefers OSC 9” (OSC 9 को प्राथमिकता देता है)।

Windows Terminal पर आप bell को ज़्यादा ध्यान खींचने वाला बना सकते हैं: profile settings में bellStyle को all पर सेट करें ताकि sound बजे और taskbar icon चमके (default audible है)।

Windows Terminal settings.json (profile)कॉपी करें
{
"bellStyle": "all"
}

आप notification_method = "osc9" भी ज़बरदस्ती सेट कर सकते हैं; आपका terminal इसे system notification में बदलेगा या नहीं, यह terminal पर निर्भर है।

notify से अपना program चलाएँ

Turn पूरा होने पर notify एक external program चलाता है और type, thread-id, turn-id, cwd, input-messages और last-assistant-message वाला एक JSON argument देता है। इससे यह phone push, webhook या log के लिए अच्छा है: terminal से आगे की कोई भी चीज़। यह top-level key है, इसलिए इसे किसी भी [section] के ऊपर रखें:

~/.codex/config.tomlकॉपी करें
notify = ["python3", "/Users/you/.codex/notify.py"]

OpenAI के docs वाली script पर आधारित एक छोटी script:

~/.codex/notify.pyकॉपी करें
import json, subprocess, sys
 
notification = json.loads(sys.argv[1])
if notification.get("type") == "agent-turn-complete":
message = (notification.get("last-assistant-message") or "Turn complete")[:120]
# macOS: a system notification. On Linux use ["notify-send", "Codex", message].
subprocess.run(["osascript", "-e", f'display notification {json.dumps(message)} with title "Codex"'])
  • किसी project की .codex/config.toml notify सेट नहीं कर सकती। इसे आपकी user config में होना चाहिए।
  • Codex का source code notify को legacy बताता है और इसे hooks से बदलने की योजना है। यह आज काम करता है; changelog पर नज़र रखें।

Hooks का क्या?

Codex में भी hooks हैं। ये default रूप से चालू हैं और इनमें PermissionRequest और Stop events शामिल हैं, जो ~/.codex/hooks.json या [hooks] table में configure होते हैं, और हर non-managed hook को चलने से पहले /hooks से review और trust करना ज़रूरी है। कोई Notification event नहीं है, और OpenAI के docs में कोई notification hook नहीं दिखाया गया। Alerts के लिए ऊपर वाली TUI setting ही documented तरीक़ा है।

Codex app और IDE extension

Codex desktop app के अपने controls हैं: turn-complete alerts को कभी नहीं, सिर्फ़ app के background में होने पर, या हमेशा पर सेट किया जा सकता है, और अलग switches permission और सवाल वाली notifications को चालू या बंद करते हैं। IDE extension की अपनी कोई notification settings नहीं हैं। OpenAI के docs इसकी जगह notify की ओर इशारा करते हैं।

अगर आप ChatGPT app के ज़रिए अपने phone से approve करते हैं, तो issue #39346 एक ऐसे मामले की रिपोर्ट करता है जिसमें phone “approval waiting” दिखाता है लेकिन जवाब देने के लिए कोई card नहीं होता।

उसे देखना, और उसका जवाब देना

Bell बताती है कि किसी terminal में कुछ हुआ। Pet Island आपकी स्क्रीन के ऊपर एक छोटे island पर Codex को दिखाता है (काम कर रहा है, इंतज़ार कर रहा है या पूरा हो गया), और जब Codex कोई command चलाने या फ़ाइल edit करने की अनुमति माँगता है, तो request वहाँ command या diff के साथ दिखती है। Window बदले बिना allow या deny करें; सवालों के लिए एक click आपको सही terminal पर ले जाता है। यह Codex CLI और Codex app के साथ काम करता है, और Claude Code, Cursor व आपके दूसरे एजेंटों के बगल में दिखता है।

अक्सर पूछे जाने वाले सवाल

Codex का काम पूरा होने पर notification कैसे पाऊँ?

Codex की TUI notifications agent-turn-complete के लिए default रूप से चालू हैं, लेकिन default रूप से सिर्फ़ तब fire होती हैं जब terminal पर focus न हो। अगर focus होने पर भी चाहिए तो [tui] में notification_condition = "always" सेट करें।

Codex को approval चाहिए होने पर notification कैसे पाऊँ?

~/.codex/config.toml के [tui] section में notifications में "approval-requested" जोड़ें। notify setting approvals के लिए fire नहीं होती।

Codex notification दिखाने के बजाय सिर्फ़ beep क्यों करता है?

Auto mode में Codex desktop notification सिर्फ़ Ghostty, iTerm2, Kitty, Warp और WezTerm में भेजता है। दूसरे terminals को, Windows Terminal समेत, bell मिलती है।

क्या मैं notify को अपने project की .codex/config.toml में रख सकता हूँ?

नहीं। Project config notify सेट नहीं कर सकती; इसे ~/.codex/config.toml में रखें।

क्या Codex में Notification hook है?

नहीं। Codex hooks में PermissionRequest और Stop शामिल हैं, लेकिन कोई Notification event नहीं है और कोई documented notification hook नहीं है।

स्रोत

इस पेज की हर setting और हर व्यवहार को 26 अक्टूबर 2026 को इन पेजों से मिलाकर जाँचा गया। एजेंट तेज़ी से बदलते हैं; अगर कुछ अब मेल नहीं खाता, तो आधिकारिक पेज ही मान्य है।

आगे पढ़ें

हर एजेंट को अपनी स्क्रीन के ऊपर से जवाब दें।

Windows और Mac · 7 दिन मुफ़्त, फिर एक बार $8.99 · हर बिक्री से $1 सड़क के बेसहारा जानवरों के खाने पर जाता है

Pet Island मुफ़्त आज़माएँ