fix(guardrails): drop Final from a loop-assigned local

basedpyright rejects a Final assigned inside a loop, and
reportGeneralTypeIssues sits one over its budget ceiling.
This commit is contained in:
Ninad Phalak 2026-09-03 19:41:46 -05:00
parent 47421b7541
commit f3eb108f86
No known key found for this signature in database
GPG key ID: 59119ED515433744

View file

@ -99,7 +99,7 @@ def _collect_content(container: MutableRequest, slots: _SlotSink) -> None:
def _collect_tool_arguments(message: MutableRequest, slots: _SlotSink) -> None:
"""Tool arguments carry the values a user asked the model to act on."""
for tool_call in message.get("tool_calls") or ():
function: Final = tool_call.get("function") if isinstance(tool_call, dict) else None
function = tool_call.get("function") if isinstance(tool_call, dict) else None # rebind-ok: loop variable.
if isinstance(function, dict):
_collect(function, "arguments", slots)
legacy: Final = message.get("function_call")