Reason
For Codex HTTP requests, quota information is returned in x-codex-* response headers, so plugins and downstream consumers can collect it normally.
For Codex WebSocket requests, the quota information is instead sent in provider-native messages such as:
{
"type": "codex.rate_limits",
"rate_limits": {
"primary": {
"used_percent": 1
}
}
}
CPA already receives these events internally, but the current plugin response interceptors operate after executor processing / translation, so plugins cannot reliably access the original WebSocket event.
This prevents plugins from collecting quota metadata for WebSocket requests.
Expected result
Provide a generic plugin hook that allows plugins to observe upstream WebSocket response events such as codex.rate_limits, with enough context to identify the current request and selected auth/credential.
Reason
For Codex HTTP requests, quota information is returned in
x-codex-*response headers, so plugins and downstream consumers can collect it normally.For Codex WebSocket requests, the quota information is instead sent in provider-native messages such as:
{ "type": "codex.rate_limits", "rate_limits": { "primary": { "used_percent": 1 } } }CPA already receives these events internally, but the current plugin response interceptors operate after executor processing / translation, so plugins cannot reliably access the original WebSocket event.
This prevents plugins from collecting quota metadata for WebSocket requests.
Expected result
Provide a generic plugin hook that allows plugins to observe upstream WebSocket response events such as
codex.rate_limits, with enough context to identify the current request and selected auth/credential.