Skip to content

Commit d8eab37

Browse files
bokelleyclaude
andcommitted
fix(a2a): export Checkpoint, switch _process_task_response to TaskState enum
- Export ``Checkpoint`` TypedDict from the top-level ``adcp`` package so callers can ``from adcp import Checkpoint`` instead of reaching into ``adcp.client`` for the persistence-key type. - Compare ``task.status.state`` against ``TaskState.completed`` / ``TaskState.failed`` in ``_process_task_response`` to match the enum-based membership check in ``_NONTERMINAL_TASK_STATES`` — an upstream rename in a2a-sdk now fails as a type error instead of a silent classification drift. Also flips the in-progress release-please PR from 5.0.0 to 4.0.1. The prior commit (#258) landed breaking-style changes (``pending_task_id`` → ``active_task_id``, ``ValueError`` → ``TypeError`` on non-A2A) but 4.0.0 shipped under 48h earlier with no known A2A adopters — the salesagent migration is on MCP, and A2A adoption is deferred behind pluggable TaskStore / push-notification work. Treating those as pre-adoption corrections rather than a major bump. Release-As: 4.0.1 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 14e7925 commit d8eab37

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/adcp/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
build_synthetic_capabilities,
2828
validate_capabilities,
2929
)
30-
from adcp.client import ADCPClient, ADCPMultiAgentClient
30+
from adcp.client import ADCPClient, ADCPMultiAgentClient, Checkpoint
3131
from adcp.exceptions import ( # noqa: F401
3232
AdagentsNotFoundError,
3333
AdagentsTimeoutError,
@@ -566,6 +566,7 @@ def get_adcp_version() -> str:
566566
# Client classes
567567
"ADCPClient",
568568
"ADCPMultiAgentClient",
569+
"Checkpoint",
569570
"RegistryClient",
570571
"PropertyRegistry",
571572
"RegistrySync",

src/adcp/protocols/a2a.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ def _process_task_response(self, task: Task, debug_info: DebugInfo | None) -> Ta
523523
"""Process a Task response from A2A into our TaskResult format."""
524524
task_state = task.status.state
525525

526-
if task_state == "completed":
526+
if task_state == TaskState.completed:
527527
# Extract the result from the artifacts array
528528
result_data = self._extract_result_from_task(task)
529529

@@ -542,7 +542,7 @@ def _process_task_response(self, task: Task, debug_info: DebugInfo | None) -> Ta
542542
},
543543
debug_info=debug_info,
544544
)
545-
elif task_state == "failed":
545+
elif task_state == TaskState.failed:
546546
# Protocol-level failure - extract error message from TextPart
547547
error_msg = self._extract_text_from_task(task) or "Task failed"
548548
return TaskResult[Any](

0 commit comments

Comments
 (0)