From c7605a05469c1e839e0a876bfe6b1e1d90393d97 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 21:35:41 +0000 Subject: [PATCH] Fix pyright type narrowing issue for dataclass check Co-authored-by: TaoChenOSU <12570346+TaoChenOSU@users.noreply.github.com> --- .../core/agent_framework/_workflows/_checkpoint_encoding.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/packages/core/agent_framework/_workflows/_checkpoint_encoding.py b/python/packages/core/agent_framework/_workflows/_checkpoint_encoding.py index 97ef4caab5..d50270f152 100644 --- a/python/packages/core/agent_framework/_workflows/_checkpoint_encoding.py +++ b/python/packages/core/agent_framework/_workflows/_checkpoint_encoding.py @@ -185,10 +185,10 @@ def decode_checkpoint_value(value: Any) -> Any: if module is None: module = importlib.import_module(module_name) cls_dc: Any = getattr(module, class_name) - # Verify the class is actually a dataclass - if not is_dataclass(cls_dc): + # Verify the class is actually a dataclass type (not an instance) + if not isinstance(cls_dc, type) or not is_dataclass(cls_dc): logger.debug( - f"Class {type_key_dc} is not a dataclass; returning raw value" + f"Class {type_key_dc} is not a dataclass type; returning raw value" ) return decoded_raw constructed = _instantiate_checkpoint_dataclass(cls_dc, decoded_raw)