Skip to content

MAINT: Add runtime shutdown phase context - #3333

Merged
Roman Lutz (romanlutz) merged 1 commit into
microsoft:mainfrom
huong8373tt-beep:fix/p311-08-runtime-shutdown-context
Oct 19, 2026
Merged

Roman Lutz (romanlutz) merged 1 commit into
microsoft:mainfrom
huong8373tt-beep:fix/p311-08-runtime-shutdown-context

Conversation

@huong8373tt-beep

Copy link
Copy Markdown
Contributor

Description

Implements the remaining focused P311-08 runtime-shutdown investigation from #3166.

RuntimeLifecycle._shutdown_runtime_async now adds static phase-name notes when either scenario-service shutdown or memory disposal fails. The change preserves the original exception objects, types, tracebacks, existing notes, cleanup order, cancellation behavior, and the established single-error / BaseExceptionGroup shape. It deliberately does not duplicate the service-close context added in #3281.

The notes contain only static lifecycle phase names; they do not include prompts, seeds, credentials, or other runtime content.

Tests and Documentation

  • uv run --frozen --no-sync pytest -q --basetemp=D:\oss_contrib\pyrit-p311-08\.pytest-tmp-runtime-lifecycle tests/unit/backend/test_runtime_lifecycle.py — 67 passed.
  • Focused shutdown cases — 12 passed.
  • uv run --frozen --no-sync pre-commit run --files pyrit/backend/services/runtime_lifecycle.py tests/unit/backend/test_runtime_lifecycle.py — passed, including Ruff and ty.
  • git diff --check — passed.
  • No documentation changes were needed.

Slai Agent Runtime assisted with investigation, implementation, and tests. The account owner reviewed and authorized this contribution.

@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Oct 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 19, 2026
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Oct 19, 2026
Merged via the queue into microsoft:main with commit a55899a Oct 19, 2026
98 of 99 checks passed
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.

2 participants