Skip to content

Feature request: native event-driven session wake primitive #20312

Description

@jrtorrez31337

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentIssues related to the core agent loopenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions