a2aproject / a2aproject/a2a-tck

TCK sends v0.3 file part format {"file": {...}} but v1.0 Part uses flat oneof (url/raw)

Đang mở Phù hợp với người mới
#144 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
50
Fork
40
Merge trung bình
7 ngày 1 giờ
Pull request đã merge (30 ngày)
1

Mô tả

## Summary

The TCK's `valid_file_message_params` fixture sends a file part in v0.3 format using a nested `file` object. The A2A v1.0 spec defines `Part` as a flat protobuf `oneof` with `text`, `raw`, `url`, and `data` fields — there is no `file` wrapper.

## Spec Reference

**File:** `specification/a2a.proto`
```protobuf
message Part {
oneof content {
string text = 1;
bytes raw = 2; // For binary file content (base64 in JSON)
string url = 3; // For file reference by URL
google.protobuf.Value data = 4; // For structured JSON data
}
string filename = 6;
string media_type = 7;
}
```

There is no `file` field. The v0.3 `FilePart` with nested `fileWithBytes`/`fileWithUri` objects was replaced by the flat `raw`/`url` fields.

## TCK Bug Location

```python
# tests/conftest.py, fixture valid_file_message_params
return {
"message": {
"parts": [
{
"file": { # ← v0.3 format, not v1.0!
"name": "test.txt",
"mediaType": "text/plain",
"fileWithUri": "https://example.com/test.txt",
}
}
]
}
}
```

## Expected v1.0 Format

```python
# File referenced by URL:
{"url": "https://example.com/test.txt", "filename": "test.txt", "mediaType": "text/plain"}

# File with inline binary content:
{"raw": "", "filename": "test.txt", "mediaType": "text/plain"}
```

## Reproduction

```bash
# Start any a2a-sdk 1.0.0a0 agent (port 9995-9998)
curl -s -X POST http://localhost:9998 \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"SendMessage","params":{"message":{"messageId":"msg-1","role":"ROLE_USER","parts":[{"file":{"name":"test.txt","mediaType":"text/plain","fileWithUri":"https://example.com/test.txt"}}]}},"id":"1"}'

# Expected per spec: -32602 because 'file' is not a valid Part field
# Actual (confirmed): {'error': {'code': -32602, 'data': "Message type 'lf.a2a.v1.Part' has no field named 'file'..."}}
```

The SDK correctly rejects this (the `file` field doesn't exist in v1.0 `Part`), confirming the TCK fixture is stale v0.3 format.

## Tests Affected

- `tests/conftest.py::valid_file_message_params` fixture
- `tests/optional/capabilities/test_message_send_capabilities.py::test_message_send_valid_file_part`
- `tests/optional/capabilities/test_message_send_capabilities.py::test_message_send_valid_multiple_parts`
- Any test using `valid_file_message_params`

## Fix

Replace the `file` nested format with v1.0 flat format. For a URL reference:
```python
{"url": "https://example.com/test.txt", "filename": "test.txt", "mediaType": "text/plain"}
```

## Classification

**TCK bug**: Stale v0.3 file part format in TCK fixtures. v1.0 agents correctly reject this per spec, causing TCK tests to fail on compliant implementations.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Issue nằm trong fixture `valid_file_message_params` ở `tests/conftest.py`. Kiểm tra fixture và các test sử dụng nó được liệt kê trong issue. Cập nhật fixture để sử dụng định dạng Part v1.0 phẳng với các trường `url` hoặc `raw` thay vì đối tượng `file` lồng nhau. Chạy các test bị ảnh hưởng, chẳng hạn như các test trong `tests/optional/capabilities/test_message_send_capabilities.py`, để xác minh rằng chúng pass với định dạng mới.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Lĩnh vực
api, testing-qa
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
65/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.