openai / openai/codex

Readiness and idle signals for orchestrators: provider-error notify event, Stop payload with turn usage, and a SessionIdle hook event

Open
#45,977 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

CLI enhancement hooks rate-limits
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What variant of Codex are you using?

CLI (codex-cli 0.153.4 on macOS 26.6, ChatGPT auth)

What feature would you like to see?

Hooks give orchestrators turn boundaries (Stop, SessionStart, SessionEnd) and notify reports turn completion, but nothing reports that a session cannot work (rate limit, usage limit, auth failure) or that it has gone idle with input waiting. In our tmux team of Codex and Claude Code sessions, a task assigned to a session that had hit its usage limit sat unnoticed; the orchestrator could not tell "idle" from "stuck".

Proposal

  1. notify and hooks: a provider-error event with a stable error_class (rate_limit | usage_limit | auth | network | server), retry_after_seconds when known, thread id and turn id, so a watchdog can mark the session degraded and reassign work.
  2. Stop hook payload: include the turn's token usage (input, cached input, output, reasoning) and the thread and turn ids, so per-task cost can be recorded at the boundary where work is accepted.
  3. SessionIdle hook event: fires once when a turn ends with an empty queue and at a configurable debounce while idle, with queued_items and idle duration in the payload; decision: "block" with a reason starts a continuation turn exactly as Stop does today. This lets a hook wake the session from a shared task ledger without codex queue injecting text as the user.
Additional information

The [features].codex_hooks deprecation warning we hit while setting this up is correct and the rename to [features].hooks works; this request is about what hooks can observe, not the flag.

codex-cli 0.153.4 on macOS 26.6, ChatGPT auth, features.hooks = true, agents.enabled default.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing hooks paths for Stop, SessionStart, SessionEnd, and notify; the issue names no files or tests, so these event entry points are the first place to investigate. Compare the current Stop continuation behavior with codex queue, then verify that provider-error, enriched Stop, and SessionIdle cover the payloads and lifecycle cases described here.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.