Skip to content
CppCooperProgramming Portfolio

Article

When Codex Needs an Answer

CLI Tools

I wanted an alert when Codex was blocked waiting for an answer. A question can leave a session sitting idle just as effectively as an approval request, so it needs to be recognizable as an event of its own.

Code-notify already provided notification delivery and approval alerts. Reusing that framework left a smaller problem to solve: recognize the requests that need attention, route them through the existing notifier and keep the alert controls understandable.

Following the request

The extension adds a Python launcher that relays the local CLI protocol. As messages pass through, it identifies command, file and permission approvals, blocking user-input requests and MCP elicitation requests. The launcher can then send the appropriate attention event to code-notify.

A request also has an identity. Tracking that identity allows the relay to recognize that it has already raised an alert instead of treating every appearance of the same request as another reason to interrupt. The notification transport remains the responsibility of the existing framework.

There is a useful timing distinction here. An early approval request and an event confirmed as needing human attention are separate states. Routing them separately allows normal question notifications and early alerts to follow their intended paths rather than sharing one ambiguous trigger.

An extension should fit the existing settings

The notification types have independent switches. The changes also preserve unrelated installed hooks and settings; enabling an attention alert should not replace someone else’s configuration. Existing delivery behavior, including sound and snooze handling, is reused where the event is routed through it.

The focused checks cover payload routing, configuration preservation, and the launcher’s protocol behavior. Four launcher tests use a fake endpoint and stub delivery to isolate the relay. Live CLI compatibility and desktop notification delivery require separate checks.

The result is a small integration with a clear boundary: recognizing when the session is asking for a person, then handing that event to the notifier already responsible for getting their attention.