fix(a2a): type _scan's part parameter as _A2ATextPart, not dict[str, Any]

basedpyright's reportArgumentType flagged _scan (called with elements of
Sequence[_A2ATextPart]) still typed to accept dict[str, Any], a stricter
mismatch than the sibling _scan_input_part, which is called with real
dict[str, Any] parts and had no such mismatch. Matching the real element
type also clears 3 cascading reportUnknownArgumentType/
reportUnknownVariableType errors downstream of the call.
This commit is contained in:
STiFLeR7 2026-10-13 12:41:16 +05:30
parent 459efd00b9
commit e4cd222fd9
No known key found for this signature in database

View file

@ -444,7 +444,7 @@ class A2AGuardrailHandler(BaseTranslation):
if depth >= max_depth:
return ()
def _scan(part_idx: int, part: dict[str, Any]) -> tuple[tuple[str, tuple[str, ...], int, str], ...]:
def _scan(part_idx: int, part: _A2ATextPart) -> tuple[tuple[str, tuple[str, ...], int, str], ...]:
kind: Final = part.get("kind")
if kind == "text":
text: Final = part.get("text", "")