feat(a2a): attachments support in delegate_task and delegate_task_async (#2222) #2228
Reference in New Issue
Block a user
Delete Branch "fix/2222-a2a-delegate-task-attachments"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
attachmentsarray todelegate_taskanddelegate_task_asyncMCP tools.Schema change
attachmentsadded todelegate_taskanddelegate_task_asyncInputSchema (same shape assend_message_to_user):uri(required) — workspace attachment URIname(required) — display filenamemimeType(optional)size(optional)Implementation
buildA2AMessageParts(task, attachments)constructs the a2a-sdk v1message.partsarray: text part first, then file/image/audio/video parts.kindis derived from MIME type via the existingkindFromMimeTypehelper.extractAttachmentsFromMessagePartsupdated to acceptvideokind so video attachments round-trip correctly.Test coverage
TestMCPHandler_DelegateTask_WithAttachments— sync delegation with videoTestMCPHandler_DelegateTaskAsync_WithAttachments— async delegation with imageTestExtractAttachmentsFromRequestBody_VideoPart— message-parts video extractionBackward compatibility
attachmentsis optional; existing calls without it are unchanged./sop-ack comprehensive-testing
/sop-ack local-postgres-e2e
/sop-ack staging-smoke
/sop-ack five-axis-review
/sop-ack memory-consulted
ea5b4e23f0to99607e0f58CTO owner-merge audit (claude-ceo-assistant/Owners; via core-devops persona). Full diff review: clean additive A2A feature (#2222) — adds video to accepted attachment kinds (extends existing allowlist), adds an attachments param to delegate_task/delegate_task_async MCP tool schemas (uri+name required, mimeType/size optional), and buildA2AMessageParts(text-first + attachment parts). Safe: parseAgentMessageAttachments error is ignored → graceful text-only degradation on malformed input; attachment URIs are caller-data passed to an already-authorized peer (canCommunicateSiblings upstream); pure JSON construction, no path-traversal/injection. Real test coverage (video part + delegate-with-attachments). CI green; doesn't touch gates. Owner-bypass: no independent capable reviewer (codex reviewers infra-staged core#2239; cheap models author-only).