Skip to content

server: retire hard-timeout ledger - #936

Merged
yisding merged 2 commits into
agent/ws25-voice-server-ws-listener-scopefrom
agent/ws25-retire-server-timeout-ledger
Aug 7, 2026
Merged

server: retire hard-timeout ledger#936
yisding merged 2 commits into
agent/ws25-voice-server-ws-listener-scopefrom
agent/ws25-retire-server-timeout-ledger

Conversation

@yisding

@yisding yisding commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Problem

After every server cleanup caller established explicit ownership, server/transports.py still contained the grandfathered _await_with_hard_timeout helper and _BACKGROUND_TIMEOUT_TASKS module-global ledger. The helper could create hidden work and kept survivors outside their lifecycle owners.

Changes

  • add wait_for_owned_future, a shared hard-bound primitive that never creates or retains work
  • migrate all server transport, VoiceServer, and WebRTC route deadline waits to caller-owned futures
  • preserve timeout cancellation requests and external caller-cancellation behavior
  • delete _await_with_hard_timeout, _track_background_timeout, and _BACKGROUND_TIMEOUT_TASKS
  • add primitive tests for cancellation-resistant timeout survivors and externally cancelled waiters
  • remove the final server raw task start and the repository's final module-global task ledger
  • refresh and classify both structural inventories
  • document the no-hidden-ledger ownership rule

Why / impact

Server teardown survivors now stay exclusively with their RuntimeTaskScope, SurvivorRegistry, or explicit handler owner. There is no cross-runtime module-global anchor and no timeout helper that can silently turn a coroutine into a task. Repository-wide raw production starts fall from 23 to 22 in this slice (29 to 22 across the post-#930 server sequence), and module_task_set falls from 1 to 0.

Checks

  • env UV_FROZEN=1 just check outside the sandbox because uv's cache lock is not sandbox-writable
    • pre-commit: passed
    • mypy: 288 source files passed
    • pytest: 8,591 passed, 309 skipped
  • .venv/bin/python -m pytest tests/runtime/test_task_scope.py tests/server/test_capacity_gate_drain.py tests/server/test_websocket_runtime_drain.py tests/server/test_voice_server_lifecycle.py tests/server/test_webrtc_routes.py -q (116 passed, 28 skipped)
  • .venv/bin/python -m pytest tests/ratchets/test_teardown_budget_inventory.py tests/ratchets/test_source_inventory.py -q (16 passed)
  • focused Ruff and mypy checks
  • commit-time pre-commit hooks

@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: d13dd9d4-1193-426c-bfc6-027115391db8

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: 4c12810b83

ℹ️ 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/webrtc_routes.py
@yisding
yisding force-pushed the agent/ws25-retire-server-timeout-ledger branch from 4c12810 to e3cca9b Compare August 7, 2026 03:19
@yisding
yisding force-pushed the agent/ws25-retire-server-timeout-ledger branch from e3cca9b to 13dea5f Compare August 7, 2026 03:49
@yisding
yisding merged commit bc36a53 into agent/ws25-voice-server-listener-scope Aug 7, 2026
2 checks passed
@yisding
yisding deleted the agent/ws25-retire-server-timeout-ledger branch August 7, 2026 04:11
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