fix(azure_ai): annotate cast() with cast-ok reason for LIT006 budget

The PR's unchecked cast(dict, message) added a LIT006 violation
(type_discipline_gate.py), pushing the LIT006 total to 1117 over the 1111
ceiling. This gate runs after the UP006 gate and was not reached in prior
runs because the UP006 gate failed first; now that UP006 passes it runs and
catches this. Add a cast-ok suppression with a reason, as the gate requires
(AllMessageValues is a union of TypedDicts and pop/strip need a mutable
mapping).
This commit is contained in:
vrlo 2026-07-20 16:07:28 +02:00
parent 727206405d
commit e747b4d6ce

View file

@ -70,7 +70,7 @@ def _strip_unsupported_message_fields(message: AllMessageValues) -> None:
the adapter attaches inside ``tool_calls[].function``) are stripped
recursively so nested tool-call signatures are removed too.
"""
m = cast(dict, message)
m = cast(dict, message) # cast-ok: AllMessageValues is a union of TypedDicts; pop/strip need a mutable mapping
for field in _RECURSIVELY_STRIPPED_FIELDS:
filter_value_from_dict(m, field)
for field in _TOP_LEVEL_OUTPUT_ONLY_FIELDS: