On October 18, openai/codex merged two hooks around model sampling attempts. A team can record what happened without putting the observer’s output into the model’s conversation. There is a timing choice. Try it.
WATCH THE
HANDOFF.
One response. One tool call. Choose where the observer sits.
A response produces a tool call. With a synchronous post observer, dispatch waits for the response and observer to finish. In background mode, dispatch can start while the response is still streaming.
- 1Response starts
- 2Tool call arrives
- 3Response ends
- 4Observer works
- 5Observer finishes
Our example has one configured post-request observer. It has nothing to record until this sampling attempt ends.
A record before dispatch.
Or observation alongside work.
A synchronous PostModelRequest observer holds tool dispatch until it finishes. A background observer preserves streaming dispatch. If any post handler is synchronous, that waiting rule wins.
The first attempt can disappear
from the happy ending.
The retry test fails one stream, then succeeds. The new hooks surround both sampling attempts.
Token usage: unavailable
Token usage: supplied
“Completed” describes the model response. A deferred tool may not have started yet.
It can watch.
Its reply cannot steer.
These observers treat returned control directives as diagnostics. Their output cannot veto the request or add model context. Their command programs can still perform ordinary side effects; existing tool permissions still apply.