codex - 💡(How to fix) Fix Feature request: native event-driven session wake primitive [3 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#20312Fetched 2026-05-01 05:44:08
View on GitHub
Comments
3
Participants
2
Timeline
13
Reactions
0
Timeline (top)
labeled ×5commented ×3unlabeled ×3cross-referenced ×1

Codex is turn-driven and has no native primitive for waking an idle session on an external event. This blocks real-time reaction patterns where an agent should respond to inbound activity (chat mentions, queue messages, file changes, MCP resource pushes) while idle, not only at the next user turn.

Requesting a configurable inbound event source that delivers structured input into an idle session and starts a new turn, under the session's existing sandbox/approval mode.

Root Cause

Codex is turn-driven and has no native primitive for waking an idle session on an external event. This blocks real-time reaction patterns where an agent should respond to inbound activity (chat mentions, queue messages, file changes, MCP resource pushes) while idle, not only at the next user turn.

Requesting a configurable inbound event source that delivers structured input into an idle session and starts a new turn, under the session's existing sandbox/approval mode.

RAW_BUFFERClick to expand / collapse

Summary

Codex is turn-driven and has no native primitive for waking an idle session on an external event. This blocks real-time reaction patterns where an agent should respond to inbound activity (chat mentions, queue messages, file changes, MCP resource pushes) while idle, not only at the next user turn.

Requesting a configurable inbound event source that delivers structured input into an idle session and starts a new turn, under the session's existing sandbox/approval mode.

Shape

A watcher declared in config (e.g. ~/.codex/config.toml) naming:

  • source — process to spawn, file to tail, SSE URL, MCP resource, or local unix socket
  • delivery — line-delimited JSON, each record injected as a user-message-frame equivalent (not as an exec-tool invocation)
  • cursor — position that survives crash, reconnect, and session resume so events are neither dropped nor duplicated
  • session scope — multiple Codex agents on one host can subscribe to disjoint streams without cross-talk

Lifecycle to specify

  • idle session — wake triggers a new turn
  • mid-turn arrival — queued, coalesced, or dropped (any choice, just defined)
  • restart — cursor resumes from last delivered record
  • shutdown — defined drain semantics

Non-goals

  • Not asking Codex to host the bus, broker, or persistence layer.
  • Not asking Codex to bypass approval/sandbox. The primitive triggers a turn; the turn still obeys the existing safety model.

Why

Claude Code exposes this via its Monitor tool: each stdout line from a watched process is delivered as a session notification and wakes the model. Same operational shape in Codex would let event sources — message buses, webhooks, queue consumers, MCP push subscriptions — drive Codex agents in real time while preserving Codex's safety semantics.

Concrete use case driving this: yaklog (https://github.com/jrtorrez31337/yaklog), a small SSE-fanout message bus we use for multi-agent coordination. Claude Code agents wire Monitor to tail -F events.ndjson and react to @mentions in ~500ms. Codex agents on the same bus can only catch up at turn start via a drain helper — real-time reaction while idle isn't currently possible.

extent analysis

TL;DR

Implementing a configurable inbound event source in Codex to deliver structured input into an idle session and start a new turn would enable real-time reaction patterns.

Guidance

  • Define a watcher in the Codex configuration file (~/.codex/config.toml) that specifies the source, delivery, cursor, and session scope for the inbound event.
  • Determine the desired behavior for mid-turn arrival, restart, and shutdown lifecycle events, such as queuing, coalescing, or dropping incoming events.
  • Ensure that the new primitive triggers a turn while still obeying the existing safety model and approval/sandbox mode.
  • Consider using an existing tool like Monitor from Claude Code as a reference for implementing the event source.

Example

No code snippet is provided as the issue does not contain sufficient technical details for a concrete implementation.

Notes

The implementation of the inbound event source should not bypass the existing safety model or approval/sandbox mode, and should preserve the session's sandbox/approval mode.

Recommendation

Apply a workaround by utilizing an external tool or service that can simulate the desired behavior, such as using tail -F with a drain helper, until a native solution is implemented. This would allow for some level of real-time reaction while idle, although it may not be as seamless as a native Codex solution.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING