Skip to content

MAINT: Add Copilot cleanup phase context - #3351

Merged
Roman Lutz (romanlutz) merged 1 commit into
microsoft:mainfrom
huong8373tt-beep:fix/p311-08-copilot-cleanup-phase-context
Oct 20, 2026
Merged

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

Conversation

@huong8373tt-beep

Copy link
Copy Markdown
Contributor

Description

Implements the remaining focused P311-08 Copilot cleanup-phase investigation from #3166.

GitHubCopilotTarget._cleanup_owned_resources_async now adds safe static phase-name notes when failures arise during session release, active-client stop, or failed-startup-client stop. The change preserves the original exception objects, types, tracebacks, existing notes, release ordering, retry ownership, cancellation behavior, and established single-error / BaseExceptionGroup shape.

The notes contain only static lifecycle phase names; they do not include conversation/session identifiers, working directories, tokens, prompts, seed content, or other runtime content.

Tests and Documentation

  • uv run --frozen --no-sync pytest -q --basetemp=D:\oss_contrib\pyrit-p311-08\.pytest-tmp-copilot-cleanup tests/unit/prompt_target/target/test_github_copilot_target.py — 98 passed.
  • uv run --frozen --no-sync pre-commit run --files pyrit/prompt_target/github_copilot_target.py tests/unit/prompt_target/target/test_github_copilot_target.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 20, 2026
Merged via the queue into microsoft:main with commit 6e9c4b4 Oct 20, 2026
64 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