Skip to content

Feature: expose upstream WebSocket response events to plugins #5248

Description

@seakee

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions