Skip to content

[Bug]: proto_utils.py task does not propagate metadata from python type to proto #541

Closed

Description

@konradkalita

What happened?

I wonder why metadata is not passed to proto object for a task, although it is passed for a message. Is it a bug or there is a reason for it?

Implementation for context:

    @classmethod
    def task(cls, task: types.Task) -> a2a_pb2.Task:
        return a2a_pb2.Task(
            id=task.id,
            context_id=task.context_id,
            status=cls.task_status(task.status),
            artifacts=(
                [cls.artifact(a) for a in task.artifacts]
                if task.artifacts
                else None
            ),
            history=(
                [cls.message(h) for h in task.history]  # type: ignore[misc]
                if task.history
                else None
            ),
        )

    @classmethod
    def message(cls, message: types.Message | None) -> a2a_pb2.Message | None:
        if message is None:
            return None
        return a2a_pb2.Message(
            message_id=message.message_id,
            content=[cls.part(p) for p in message.parts],
            context_id=message.context_id or '',
            task_id=message.task_id or '',
            role=cls.role(message.role),
            metadata=cls.metadata(message.metadata),
            extensions=message.extensions or [],
        )

Relevant log output

Code of Conduct

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

Activity

  1. added theissue type on Nov 13, 2025
  2. sokoliva commented on Nov 20, 2025

    @sokoliva
    Member

    Thank you @konradkalita for pointing this out. You are right, it is a bug and will be fixed.

  3. added a commit that references this issue on Nov 21, 2025
    fc31d03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions