Skip to content

server: own listener cleanup tasks - #929

Merged
yisding merged 36 commits into
agent/ws25-voice-server-handler-scopefrom
agent/ws25-voice-server-listener-scope
Aug 7, 2026
Merged

server: own listener cleanup tasks#929
yisding merged 36 commits into
agent/ws25-voice-server-handler-scopefrom
agent/ws25-voice-server-listener-scope

Conversation

@yisding

@yisding yisding commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Problem

VoiceServer retained cancellation-resistant HTTP site/runner cleanup operations in a stage-keyed dictionary, but created them with raw asyncio.ensure_future(). The retry ledger prevented duplicate cleanup calls, yet the surviving task itself remained outside named runtime ownership.

Changes

  • create listener cleanup operations through a dedicated RuntimeTaskScope
  • preserve the existing stage-keyed mapping and exact retry behavior
  • invoke each cleanup callable inside the named owner task, supporting the existing generic awaitable contract
  • name stages such as easycat-voice-server-listener-cleanup-http-site-stop
  • assert a timed-out site cleanup remains in both the retry ledger and scope, then leaves the scope after retry
  • reduce the reviewed raw-task-spawn inventory from 31 to 30

Why / impact

A site or runner cleanup that survives its hard deadline now has one explicit task owner as well as a stable retry key. Later stop() calls still await the original operation instead of racing a second listener teardown.

Root cause

The retry-safe listener ledger was added before the shared runtime task-scope abstraction and had not yet been migrated in WS2.5.

Checks

  • focused timeout/retry and source-inventory tests — 11 passed
  • full VoiceServer lifecycle file outside the sandbox — 24 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: 7783c72c-51fd-46cb-825a-3a5b8542e921

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:45

@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: fbeba9db3f

ℹ️ 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-listener-scope branch from fbeba9d to ba37a59 Compare August 7, 2026 03:13
@yisding
yisding force-pushed the agent/ws25-voice-server-listener-scope branch from ba37a59 to 56e3c3a Compare August 7, 2026 03:48
@yisding
yisding merged commit dea751c into agent/ws25-task-scope-policy Aug 7, 2026
4 checks passed
@yisding
yisding deleted the agent/ws25-voice-server-listener-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