← Back to Pull requests

Keep the client's hello names and `min_buffer_ms` within spec limits #624

Merged
maximmaxim345 merged 3 files (75 lines) on Nov 17, 2026 15:35 UTC
View on GitHub
maximmaxim345 maximmaxim345 commented on Nov 17, 2026 15:27 UTC
Author

What does this implement/fix?

<!-- Quick description and explanation of changes. -->

The client SDK could send a client/hello name or device_info string over 64 UTF-8 bytes, or a min_buffer_ms up to 30000. Conforming servers close the connection on these, and an aiosendspin server in strict mode rejects the client.

The client now cuts those strings to 64 bytes without splitting a character, and clamps min_buffer_ms to 0-5000.

Related issue or spec PR (if applicable):

  • Sendspin/spec#313

  • Sendspin/spec#329

  • Sendspin/spec#347
  • Types of changes

    <!--
    Tick exactly one box. CI (.github/workflows/pr-labels.yaml) applies the
    matching label, and the release notes use it to sort this change.
    -->

  • Bugfix (non-breaking change which fixes an issue): bugfix

  • New feature (non-breaking change which adds functionality): new-feature

  • Enhancement to an existing feature: enhancement

  • Breaking change (changes the public API or the protocol in a way that is not backwards compatible): breaking-change

  • Refactor (no behavior change): refactor

  • Documentation only: documentation

  • Maintenance / chore: maintenance

  • CI / workflow change: ci

  • Dependencies bump: dependencies
  • Diff: 75 lines (+67 / -8) across 3 files Reviewer: copilot-pull-request-reviewer[bot] Review duration: 8m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.42) × (1 − Review Confidence (0.48)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 75 lines diff across 3 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    47%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.259
    Rapid Merge rapid_merge
    0.100
    Real PR Conversation Timeline
    2 items
    copilot-pull-request-reviewer[bot] copilot-pull-request-reviewer[bot] commented on Nov 17, 2026 15:29 UTC
    Reviewer

    <!-- ccr-overview-v2 -->

    🟢 Approval recommended

    No active review issues were identified for the changes enforcing Sendspin hello-string and buffer limits.

    No open issues 🎉

    <details>
    <summary><strong>What changed in this PR</strong></summary>

    This PR keeps client SDK hello strings and minimum buffer values within Sendspin protocol limits, preventing strict servers from rejecting otherwise valid clients.

    Changes:

  • Truncates hello names and device information to 64 UTF-8 bytes without splitting characters.

  • Warns about oversized strings and clamps min_buffer_ms to 0–5000.

  • Adds regression tests for string truncation and the buffer upper limit.
  • | File | Description |
    | ---- | ----------- |
    | tests/​test_client_protocol_callbacks.py | Tests UTF-8-safe truncation, warnings, and buffer clamping. |
    | aiosendspin/​client/​connection.py | Truncates name and device information when building client hello messages. |
    | aiosendspin/​client/​client.py | Warns about oversized hello strings and enforces the buffer range. |
    </details>

    <sub>Review effort: Balanced</sub>

    Assignees
    maximmaxim345 maximmaxim345
    Labels
    risk: low confidence: 47.9% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 41.8% (MEDIUM) · Higher = larger blast radius
    41.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 47.9% · Lower = rushed or shallow review
    47.9%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 21.8% · Safe to merge
    21.8%