Skip to content

server: own WebSocket close fan-out - #927

Merged
yisding merged 2 commits into
agent/ws25-standalone-webrtc-sweep-scopefrom
agent/ws25-voice-server-ws-close-scope
Aug 7, 2026
Merged

server: own WebSocket close fan-out#927
yisding merged 2 commits into
agent/ws25-standalone-webrtc-sweep-scopefrom
agent/ws25-voice-server-ws-close-scope

Conversation

@yisding

@yisding yisding commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Problem

When VoiceServer escalated a natural drain, it spawned one raw close task per active WebSocket and kept only the hard-timeout boolean from a gather(return_exceptions=True). Completed connection-close failures were silently discarded, and cancellation-resistant closes had no named owner.

Changes

  • run raw-WebSocket connection closes in a dedicated RuntimeTaskScope
  • assign stable per-connection task names
  • inspect completed gather results and log unexpected exceptions with the exact task identity
  • preserve the hard deadline and existing timeout warning
  • add success/failure regression coverage for task naming, quiet success, and observable close failure
  • reduce the reviewed raw-task-spawn inventory from 32 to 31

Why / impact

A broken connection close is now attributable to easycat-raw-ws-close-<key>, while a close that resists the hard-timeout cancellation remains scope-owned after teardown advances.

Root cause

The close fan-out used return_exceptions=True to isolate sibling failures but discarded the returned list, and its manual raw spawns predated WS2.5 task scopes.

Checks

  • focused close/result-policy and source-inventory tests — 11 passed
  • full VoiceServer lifecycle file outside the sandbox — 22 passed / 4 skipped
  • Ruff on changed Python files — passed
  • mypy on voice_server.py — passed
  • pre-commit hooks — passed

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5be40313-402b-4a05-99cc-b3bc1b62eeb1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@yisding
yisding marked this pull request as ready for review August 7, 2026 02:44

@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: 1d5f55349c

ℹ️ 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 src/easycat/server/voice_server.py
@yisding
yisding force-pushed the agent/ws25-voice-server-ws-close-scope branch from 1d5f553 to bab1273 Compare August 7, 2026 03:09
@yisding
yisding force-pushed the agent/ws25-voice-server-ws-close-scope branch from bab1273 to ec524f3 Compare August 7, 2026 03:48
@yisding
yisding merged commit dea751c into agent/ws25-task-scope-policy Aug 7, 2026
2 checks passed
@yisding
yisding deleted the agent/ws25-voice-server-ws-close-scope branch August 7, 2026 04:12
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