app-server v2: expose provider-reported response model, per-turn request count, and final token usage for interrupted turns
What version of Codex CLI is running?
codex-cli 0.144.5 (npm @openai/codex, current latest)
What platform is your computer?
Linux x86_64 (musl binary from @openai/codex-linux-x64)
What subscription do you have?
ChatGPT (personal)
Feature request
I build evaluation/benchmarking and cost-attribution tooling on top of codex app-server
(v2 protocol, schemas from codex app-server generate-json-schema --experimental). Three
pieces of process evidence are currently impossible to obtain from the protocol, which
makes rigorous accounting/audit of a turn impossible:
1. Provider-reported response model is not surfaced anywhere.ThreadStartResponse and turn_context report the configured/resolved model (a config
echo), and model/rerouted reports reroutes — but the model field that the backend
actually returns in the response envelope (Responses API response.model) is never
exposed in any v2 response or notification. RawResponseItemCompletedNotification exists
as a schema but carries response items only (no response envelope) and its method is not
part of the ServerNotification union. Without this, a client cannot independently
confirm which model actually served a turn (e.g. for benchmark validity or silent-reroute
detection beyond model/rerouted).
Request: include the provider-reported model string in turn/completed (or emit a
turn-bound notification carrying the response envelope metadata).
2. No turn-bound upstream request count.
A single turn can issue multiple upstream requests (retries, continuations). Thethread/tokenUsage/updated payload (ThreadTokenUsage / TokenUsageBreakdown) contains
token fields only; nothing in the protocol reports how many upstream requests/attempts a
turn made. Cost attribution and rate-limit debugging both need this.
Request: add a turn-bound request/attempt count to the usage payload or toturn/completed.
3. Interrupted turns end without final token usage.
After turn/interrupt is acknowledged and the turn reaches the interrupted terminal
status, no final thread/tokenUsage/updated for that turn arrives (observed live on
0.144.5: interrupt ACK + interrupted terminal, then no usage notification within a
2-second drain window). Tokens consumed by an interrupted turn are billed but cannot be
accounted client-side.
Request: emit a final cumulative thread/tokenUsage/updated (or include usage in the
terminal notification) when a turn is interrupted.
All three are additive protocol surfaces; no existing behavior needs to change. Happy to
provide more detail on the observation setup if useful.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗