Skip to content

runtime: expose retryable finalizer runs - #883

Merged
yisding merged 2 commits into
agent/ws2-tts-queue-racefrom
agent/ws2-runtime-finalizer-invoke
Aug 7, 2026
Merged

runtime: expose retryable finalizer runs#883
yisding merged 2 commits into
agent/ws2-tts-queue-racefrom
agent/ws2-runtime-finalizer-invoke

Conversation

@yisding

@yisding yisding commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Problem

Some resource owners need concurrent callers to share one retryable cleanup transaction before the Session root itself begins closing. Modeling that transaction as an ordinary task would fail after task admission closes and would duplicate the finalizer's ownership semantics.

Changes

  • add RuntimeScope.run_finalizer(name) for explicit registered-finalizer invocation
  • reuse the same in-flight attempt across root and child callers
  • keep ordinary task admission open during explicit cleanup
  • retain failed attempts and retry the factory on the next invocation
  • make later root close observe completed cleanup without rerunning it
  • document the explicit finalizer path in the lifecycle textbook

Validation

  • just check — 8526 passed, 308 skipped
  • focused RuntimeScope and ratchet matrix — 82 passed
  • focused Ruff and mypy checks
  • source and teardown-budget ratchets unchanged

@coderabbitai

coderabbitai Bot commented Aug 5, 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: 480bcb5c-32b4-489f-88e2-3f67a13748f9

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.

@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: 61890a2c55

ℹ️ 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/runtime/scope.py
@yisding
yisding force-pushed the agent/ws2-runtime-finalizer-invoke branch from 61890a2 to cb6cd68 Compare August 5, 2026 16:42
@yisding
yisding merged commit 9ed4d4e into agent/ws2-session-stop-mapping Aug 7, 2026
2 checks passed
@yisding
yisding deleted the agent/ws2-runtime-finalizer-invoke branch August 7, 2026 04:15
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