Skip to content

feat(qmux): take a session config on every transport builder - #426

Merged
kixelated merged 2 commits into
mainfrom
feat/qmux-builder-config
Oct 14, 2026
Merged

kixelated merged 2 commits into
mainfrom
feat/qmux-builder-config

Conversation

@kixelated

@kixelated kixelated commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The tcp, uds, tls and ws builders build their session from Config::negotiated, so a caller cannot change the stream limits or any other flow-control setting without driving transport::Stream by hand, which loses the builders' TLS, ALPN and keep-alive handling. An application that holds a stream per subscription, as MoQ does, stalls silently on MAX_STREAMS once it passes the default of 100.

Approach

Every builder takes a full qmux::Config: session_config on tcp::Config and uds::Config, matching their unprefixed setters, and with_session_config on tls::{Client, Server} and ws::{Client, Server, Upgraded}, matching theirs. The builder or the handshake still decides the wire-format version and application protocol; every other setting comes from the config. The default stays at 100 streams.

Impact

  • Public API: additive. Seven new builder methods; no signature or default changes.
  • Wire format: unchanged. A configured session advertises its own initial_max_streams_*.
  • JS: @moq/qmux already accepts config in new Session() and Session.accept(), so nothing changes there.

Validation

  • configured_limit_holds_a_thousand_streams holds 1,000 bidi and 1,000 uni streams through ws::Upgraded::with_session_config on paused time. With the config ignored, it stops at exactly 100.
  • default_limit_stalls_at_a_hundred_streams pins the unchanged default.
  • session_config_keeps_version_and_protocols covers the tcp builder's merge.
  • just check and just test pass.

Follow-ups

Backport to qmux-v0.5.x in a separate PR; it ships in 0.5.3 with #413.

(Written by Claude Opus 5.5)

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

The tcp, uds, tls and ws builders built their session from
`Config::negotiated`, so a caller could not raise the stream limits (or
any other flow-control setting) without dropping to `transport::Stream`
by hand. An application that holds a stream per subscription stalls
silently on MAX_STREAMS once it passes the default of 100.

Add `session_config` to `tcp::Config` and `uds::Config`, and
`with_session_config` to `tls::{Client, Server}` and
`ws::{Client, Server, Upgraded}`. The builder or the handshake still
decides the wire-format version and application protocol. Defaults are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T04:34:54.790786Z f22a621 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1f8b9d6f-9417-431c-8f18-8629be88c078
📥 Commits

Reviewing files that changed from the base of the PR and between f22a621 and 1cdb31a.

📒 Files selected for processing: 1
  • rs/qmux/src/ws.rs
🚧 Files skipped from review as they are similar to previous changes: 1
  • rs/qmux/src/ws.rs

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

Walkthrough

Transport entry points now accept session configuration while retaining their negotiated wire-format version and application protocol. Config::negotiated preserves other settings when applying negotiated values. Documentation describes the 100-stream default per direction, and WebSocket tests cover default and increased stream limits.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 1cdb3

No specific merge-blocking issue is established; the change appears mergeable after normal checks.

Pre-merge checks: Passed 5
Passed Passed checks: 5 passed
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: transport builders now accept a session configuration.
Description check Passed The description directly explains the problem, implementation, public API impact, validation, and follow-up work for the session configuration changes.
Docstring Coverage Passed Docstring coverage is 93.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 30 functions across 6 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
✨ Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f22a621601

ℹ️ 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".

Comment thread rs/qmux/src/ws.rs Resolved
Comment thread rs/qmux/src/ws.rs Resolved
The WebSocket builders start the session without awaiting transport
parameters, so handshake_timeout has no effect there, and a record
larger than the WebSocket frame limit is refused before QMux sees it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge summary

Every qmux transport builder (tcp, uds, tls, ws) now takes a full qmux::Config, so callers can raise stream limits and other flow-control settings without driving transport::Stream by hand. The builder or handshake still decides the wire-format version and application protocol. Defaults are unchanged, and the API change is additive.

Review: CI is green and CodeRabbit raised nothing. Codex left two P2 findings on rs/qmux/src/ws.rs. 1cdb31a documents both on the WebSocket with_session_config methods, and I resolved both threads:

  • handshake_timeout has no effect on WebSocket sessions. They start through Session::new without waiting for the peer's TRANSPORT_PARAMETERS.
  • max_record_size must stay within the WebSocket frame limit (16 MiB by default). ws::Server and ws::Upgraded don't expose the tungstenite config.

Suggested follow-ups (not created here):

  • Bound the time a WebSocket session waits for TRANSPORT_PARAMETERS, so handshake_timeout applies on that path.
  • Keep the WebSocket frame limit and max_record_size consistent. Either configure tungstenite from the session config or clamp the advertised record size.
  • Backport to qmux-v0.5.x for 0.5.3, as the PR description notes.

Enabling squash auto-merge on 1cdb31a.

(Written by Claude Opus 5.5)

@kixelated
kixelated merged commit ded7983 into main Oct 14, 2026
1 check passed
@kixelated
kixelated deleted the feat/qmux-builder-config branch October 14, 2026 21:40
@moq-bot moq-bot Bot mentioned this pull request Oct 14, 2026
@moq-bot moq-bot Bot mentioned this pull request Oct 14, 2026
kixelated added a commit that referenced this pull request Oct 14, 2026
* quest: plan the WebSocket follow-ups from #426

Bound a silent WebSocket peer with handshake_timeout (a0) and advertise
only a record size the WebSocket accepts (a1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* quest: reject WebSocket limits below the record minimum

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant