Skip to content

fix: make repeat token dispatch exhaustive - #3654

Merged
Roman Lutz (romanlutz) merged 5 commits into
microsoft:mainfrom
huong8373tt-beep:fix/p311-03-repeat-token-dispatch
Oct 31, 2026
Merged

Roman Lutz (romanlutz) merged 5 commits into
microsoft:mainfrom
huong8373tt-beep:fix/p311-03-repeat-token-dispatch

Conversation

@huong8373tt-beep

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

Copy link
Copy Markdown
Contributor

Summary

  • name the supported repeat-token insertion modes as a closed Literal alias
  • add an assert_never guard to the validated mode dispatch
  • preserve existing defaults, validation, output, and identifier behavior

Part of #3166 (P311-03).

Validation

  • pytest -q tests/unit/converter/test_repeat_token_converter.py — 30 passed
  • ruff check pyrit/converter/repeat_token_converter.py tests/unit/converter/test_repeat_token_converter.py
  • ruff format --check pyrit/converter/repeat_token_converter.py tests/unit/converter/test_repeat_token_converter.py
  • ty check pyrit/converter/repeat_token_converter.py
  • git diff --check

Disclosure and authorization

Slai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content.

@romanlutz Roman Lutz (romanlutz) changed the title fix(converter): make repeat token dispatch exhaustive fix: make repeat token dispatch exhaustive Oct 30, 2026
@huong8373tt-beep

Copy link
Copy Markdown
Contributor Author

Addressed the coverage feedback in 0a05cb3: kept the assert_never(mode) exhaustiveness check and marked only the validated-unreachable fallback with the repository's existing # pragma: no cover pattern. Verified locally with tests/unit/converter/test_repeat_token_converter.py (30 passed), Ruff check/format, and git diff --check.

Slai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content.

@romanlutz
Roman Lutz (romanlutz) merged commit d3446e0 into microsoft:main Oct 31, 2026
65 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