Skip to content

Clean up failed login sessions - #36

Merged
tiankaima merged 1 commit into
masterfrom
agent/login-session-cleanup
Aug 9, 2026
Merged

Clean up failed login sessions#36
tiankaima merged 1 commit into
masterfrom
agent/login-session-cleanup

Conversation

@tiankaima

Copy link
Copy Markdown
Member

What changed

  • make USTCSession.__aenter__ clean up every successfully initialized Playwright resource when setup or login fails
  • share one cleanup path with __aexit__
  • add failure-injection coverage for browser launch and login failures

Why

Async context managers do not call __aexit__ when __aenter__ fails, so browser, context, page, and Playwright resources could leak.

Validation

  • 39 unittest tests
  • Ruff lint
  • Ruff format check

@tiankaima
tiankaima marked this pull request as ready for review August 9, 2026 16:18
@tiankaima
tiankaima merged commit 15553b5 into master Aug 9, 2026
3 checks passed
@tiankaima
tiankaima deleted the agent/login-session-cleanup branch August 9, 2026 16:19
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