feat: add session-bound WebSocket server helper - #734
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 93e5fbf2e5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| 'mppx': patch | |||
There was a problem hiding this comment.
Preserve the replaced APIs or use a minor bump
This changeset declares a patch release, but the commit removes the public mppx.session.settleScheduled extension and renames the public tempo.Ws.serve option from settleScheduled to onChargeCommitted. Existing TypeScript consumers will require source changes, while already-built JavaScript integrations can silently lose scheduled settlement because the old option is ignored. Retain backward-compatible aliases, or classify this consumer migration as a minor bump.
AGENTS.md reference: AGENTS.md:L152-L154
Useful? React with 👍 / 👎.
| Each route can choose its own price and unit type. Verification, channel state, | ||
| and settlement policy remain shared through the single session method. |
There was a problem hiding this comment.
Route mixed POST charges through the settlement policy
This shared-settlement claim is false for a billable POST route configured with sse: true that returns a plain Response: applyVerifiedHttpAccounting exits early for every such POST (src/tempo/session/server/Settlement.ts:295), and the plain-response path in Transport.sse.respondReceipt only calls ChannelStore.deductFromChannel without invoking settleCharged (src/tempo/server/internal/transport.ts:185-224). Consequently the documented mixed configuration records HTTP spend but skips its configured automatic settlement schedule; either wire that deduction through the settlement callback or document the limitation rather than recommending this configuration as fully shared.
Useful? React with 👍 / 👎.
b32907f
into
brendanjryan/fix-streaming-session-settlement
* fix: settle streaming session charges on schedule * feat: add session-bound WebSocket server helper (#734) * feat: add session-bound websocket server helper * fix: preserve settlement APIs for mixed transports * test: expand streaming settlement coverage
Motivation
WebSocket session servers should reuse the store and scheduled-settlement policy already configured on the session method instead of requiring callers to thread those dependencies through every route.
Summary
mppx.session.serveWebSocket(...)with the configured store and settlement callback bound automaticallyKey design considerations