Skip to content

MAINT: Type adversarial placeholder factory with Self - #3411

Merged
Roman Lutz (romanlutz) merged 2 commits into
microsoft:mainfrom
huong8373tt-beep:fix/p311-01-message-piece-adversarial-placeholder-self
Oct 21, 2026
Merged

Roman Lutz (romanlutz) merged 2 commits into
microsoft:mainfrom
huong8373tt-beep:fix/p311-01-message-piece-adversarial-placeholder-self

Conversation

@huong8373tt-beep

@huong8373tt-beep Slai.life (huong8373tt-beep) commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • annotate MessagePiece.adversarial_placeholder with typing.Self because it constructs through cls
  • add focused subclass runtime and assert_type regression coverage

Validation

  • .venv\Scripts\python.exe -m pytest tests/unit/models/test_message_piece.py
  • .venv\Scripts\python.exe -m ruff check pyrit/models/messages/message_piece.py tests/unit/models/test_message_piece.py
  • .venv\Scripts\python.exe -m ty check pyrit/models/messages/message_piece.py tests/unit/models/test_message_piece.py
  • git -c core.whitespace=cr-at-eol diff --cached --check

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

@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Oct 21, 2026
Merged via the queue into microsoft:main with commit 1d5f83a Oct 21, 2026
96 of 100 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