Skip to content

session: own manager stop tasks - #923

Merged
yisding merged 3 commits into
agent/ws25-deepgram-scope-transferfrom
agent/ws25-session-manager-stop-cohort
Aug 7, 2026
Merged

session: own manager stop tasks#923
yisding merged 3 commits into
agent/ws25-deepgram-scope-transferfrom
agent/ws25-session-manager-stop-cohort

Conversation

@yisding

@yisding yisding commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Problem

SessionManager kept cancellation-surviving stop tasks in a keyed dictionary, but created them with raw asyncio.create_task(). That made the bookkeeping intent implicit and left the task outside the runtime ownership model being adopted across the bug-resistant refactor.

Changes

  • create keyed Session stop operations through a named RuntimeTaskScope
  • retain the existing per-key force-escalation and completion-callback behavior
  • assert that a stop remains strongly owned after its waiter is cancelled and leaves the scope after the force sweep settles
  • reduce the reviewed raw-task-spawn inventory from 36 to 35
  • document the named manager stop cohort in the production lifecycle guide

Why / impact

Cancelled API waiters no longer separate Session teardown from the repository's explicit task-ownership conventions. The existing force retry still targets the exact keyed task, while the scope now provides consistent ownership and terminal exception handling.

Root cause

The manager's keyed dictionary supplied strong references but predated RuntimeTaskScope, so the same lifecycle obligation was represented as an unclassified raw spawn.

Checks

  • SessionManager and source-inventory tests outside the sandbox — 25 passed
  • Ruff on changed Python files — passed
  • mypy on session_manager.py — passed
  • pre-commit hooks — passed
  • parent stack just check — 8,580 passed / 309 skipped

@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: 2d24614f-257e-46f7-98e6-2e67f9a32b9d

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: 4912db56e2

ℹ️ 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/session_manager.py
@yisding
yisding merged commit dea751c into agent/ws25-task-scope-policy Aug 7, 2026
5 checks passed
@yisding
yisding deleted the agent/ws25-session-manager-stop-cohort 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