Skip to content

feat: support dynamic WebSocket session charges#668

Merged
brendanjryan merged 2 commits into
mainfrom
georgios/dynamic-websocket-metering
Jul 20, 2026
Merged

feat: support dynamic WebSocket session charges#668
brendanjryan merged 2 commits into
mainfrom
georgios/dynamic-websocket-metering

Conversation

@gakonst

@gakonst gakonst commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Adds an optional raw-unit amount to the manual WebSocket session controller's charge method. This lets bidirectional services price each application message after inspecting it while retaining the existing fixed challenge tick as the default.

This is needed for persistent paid transports such as OpenAI Responses WebSocket, where every response.create frame can have a different request-aware price. Reservations are still committed only when the corresponding application message is emitted.

Validation:

  • focused WebSocket metering test (Tempo network disabled)
  • pnpm check:types

@pkg-pr-new

pkg-pr-new Bot commented Jul 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/mppx@668

commit: 0abb0fa

@brendanjryan brendanjryan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brendanjryan
brendanjryan merged commit bd9b05c into main Jul 20, 2026
14 checks passed
@brendanjryan
brendanjryan deleted the georgios/dynamic-websocket-metering branch July 20, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants