Skip to content

feat: add client-initiated stream/request-format renegotiation scenarios#75

Merged
teancom merged 1 commit into
mainfrom
feat/request-format-renegotiation-scenarios
Jul 15, 2026
Merged

feat: add client-initiated stream/request-format renegotiation scenarios#75
teancom merged 1 commit into
mainfrom
feat/request-format-renegotiation-scenarios

Conversation

@teancom

@teancom teancom commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

This won't be usable until Sendspin/sendspin-rs#63 is merged and released, and then we'll need to update the PR with the new version number. Opening basically to show that the work is done (and to be reviewed). Will mark as Draft until it can actually be merged.

Adds two client-initiated scenarios that exercise stream/request-format end-to-end against the aiosendspin server:

  • client-initiated-request-format-pcm: renegotiate pcm 24-bit -> 16-bit
  • client-initiated-request-format-flac: renegotiate pcm -> flac

A new format-renegotiation verification mode checks, from the client summary alone, that the server re-emitted stream/start (stream_start_count

= 2), the final format matches what the client requested, and it differs
from the initial format. Verification is handshake-only: it confirms the server honored the request, not that post-switch audio was re-encoded.

Capability is gated behind a supports_request_format flag (mirroring supports_opus); only the sendspin-rs client and aiosendspin server opt in, others fail-fast. The aiosendspin server adapter paces audio in real time for these scenarios so a mid-stream request has later chunks to flush the new stream/start; other scenarios are unchanged.

@teancom teancom self-assigned this Jun 4, 2026
@teancom teancom added the enhancement New feature or request label Jun 4, 2026
Adds two client-initiated scenarios that exercise stream/request-format
end-to-end against the aiosendspin server:

- client-initiated-request-format-pcm:  renegotiate pcm 24-bit -> 16-bit
- client-initiated-request-format-flac: renegotiate pcm -> flac

A new format-renegotiation verification mode checks, from the client
summary alone, that the server re-emitted stream/start (stream_start_count
>= 2), the final format matches what the client requested, and it differs
from the initial format. Verification is handshake-only: it confirms the
server honored the request, not that post-switch audio was re-encoded.

Capability is gated behind a supports_request_format flag (mirroring
supports_opus); only the sendspin-rs client and aiosendspin server opt in,
others fail-fast. The aiosendspin server adapter paces audio in real time
for these scenarios so a mid-stream request has later chunks to flush the
new stream/start; other scenarios are unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@teancom
teancom force-pushed the feat/request-format-renegotiation-scenarios branch from 9ec9534 to 074016f Compare July 15, 2026 17:15
@teancom
teancom marked this pull request as ready for review July 15, 2026 17:16
@teancom
teancom merged commit d34432e into main Jul 15, 2026
2 checks passed
@teancom
teancom deleted the feat/request-format-renegotiation-scenarios branch July 15, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant