Skip to content

Commit 2eed580

Browse files
committed
fix: use empty-text sentinel in ArtifactStreamer.finalize for spec compliance
Revert unrelated changes to .pre-commit-config.yaml, pyproject.toml, and uv.lock. Use Part(text='') instead of empty parts list in finalize() to satisfy the spec's "at least one part" requirement.
1 parent b2ba630 commit 2eed580

4 files changed

Lines changed: 773 additions & 606 deletions

File tree

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ repos:
3131
# ===============================================
3232
# Python Hooks
3333
# ===============================================
34-
3534
# Ruff for linting and formatting
3635
- repo: https://github.com/astral-sh/ruff-pre-commit
3736
rev: v0.12.0

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ dev = [
117117
"types-protobuf",
118118
"types-requests",
119119
"pre-commit",
120-
121120
"trio",
122121
"uvicorn>=0.35.0",
123122
"pytest-timeout>=2.4.0",

src/a2a/utils/artifact.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ def finalize(self) -> TaskArtifactUpdateEvent:
163163
artifact=Artifact(
164164
artifact_id=self._artifact_id,
165165
name=self._name,
166-
parts=[],
166+
# Spec requires >= 1 part; use empty-text sentinel since
167+
# finalize carries no new content.
168+
# https://github.com/a2aproject/A2A/issues/1231
169+
parts=[Part(text='')],
167170
),
168171
)

0 commit comments

Comments
 (0)