Sitelet https://github.com/a2aproject/a2a-python/issues/1211
Skip to content

[Bug]: ListTasks breaks the includeArtifacts=false spec "MUST omit" requirement #1211

Description

@lkk7

Specification (3.1.4)

When includeArtifacts is false (the default), the artifacts field MUST be omitted entirely from each Task object in the response. The field should not be present as an empty array or null value.

Actual behavior:

from google.protobuf.json_format import MessageToDict

from a2a.types import ListTasksResponse, Task, TaskState, TaskStatus

task = Task(
    id="task-1",
    context_id="context-1",
    status=TaskStatus(state=TaskState.TASK_STATE_WORKING),
)
task.ClearField("artifacts")

response = ListTasksResponse(tasks=[task])
data = MessageToDict(
    response,
    preserving_proto_field_name=False,
    always_print_fields_with_no_presence=True,
)

print(data["tasks"][0]["artifacts"]) 

Returns [].

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

component: coreIssues related to base data models, auth, gRPC interfaces, observability, and fundamental utilities.

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions