I’d like to request a feature that would let Codex agents inspect their own economic/runtime constraints in a machine-readable way.
Right now, a human can use commands like /status to check things like token usage and remaining rate limits, but the agent itself has no equivalent way to access that information programmatically.
That creates a real limitation for projects where agents need to make cost-aware decisions while they work. For example, an agent may need to:
-
track its own token consumption
-
adapt its behavior as it approaches a limit
-
choose between a cheaper and more expensive strategy
-
decide whether to continue a task, summarize, checkpoint, or stop
-
coordinate budget use across multiple agents
At the moment, the agent is effectively blind to its own operating constraints, even though that information exists for the human operator.
Feature request:
Please expose something like a programmatic /status endpoint, tool, or environment surface that an agent can query directly.
Ideally this would include at least:
-
tokens used so far
-
remaining token budget or context budget
-
current rate-limit state
-
remaining requests / tokens in the current window
-
model or session-specific cost metadata where applicable
A structured JSON response would be especially useful.
This would make it much easier to build agents that are budget-aware, rate-limit-aware, and better able to manage their own execution. It would also reduce the need for external guesswork or brittle bookkeeping on the developer side.
This would help substantially with my project, and I suspect it would be useful for anyone building more autonomous or multi-step Codex workflows.