<span id="访客事件流与文件边界"></span>

# Visitor event streams and file boundaries

Streaming messages, attachment staging, and task artifact reads have distinct completion conditions. HTTP success alone is insufficient.

<span id="消息与流"></span>

## Messages and streams

Public A2A registers POST only and accepts JSON-RPC2.0 message/stream. Messages must reference a previously created contextId. message.parts must be nonempty and contain nonempty text or file/image attachments. MCP context data alone is insufficient. text, file, image, and designated MCP application context data branches each have validation. Arbitrary data, Provider interaction responses, runtime control, and feedback branches are not public message capabilities.

configuration.blocking=true is rejected, as is locale in params or message/runtime metadata. Same-named values in params.metadata override message.metadata.

Before opening streams, the service validates the current link, session, and conversation binding. After opening, execution failures return JSON-RPC error frames. Determine successful termination from task states and terminal frames. Browser disconnection does not cancel persistently admitted tasks; reread conversation messages/task events. Admission timeouts may race with persistence. Read using returned contextId rather than immediately creating another task.

Event rereads revalidate the link. Disabling/rotation may deny further projections on the next read. This read boundary does not guarantee immediate cancellation of background execution.

<span id="附件"></span>

## Attachments

Upload using multipart file. Actual file limit 200 MiB; handler caps the full request at 201 MiB. Unknown Content-Length reserves201 MiB rather than actual file bytes for billing. Current publications share a24-hour1 GiB upload budget and100 reservation attempts. Failed/abandoned attempts retain reserved usage;429/code 18 means insufficient budget.

Uploads return a staged file and file_token. Message submission must provide all of: moi://files/{file_id} in parts, workspace_id/volume_id/file_id in metadata.attachments, and the corresponding file_token per file_id in metadata.webapp_file_credentials. Visitors, workspaces, files, and expired credentials are not interchangeable. Legacy metadata.files is rejected. Arbitrary file URLs grant no file authorization.

file_token binds visitor, publication, and file, with a separate signing purpose/expiry. Successful upload does not mean the file was submitted to execution.

<span id="任务产物"></span>

## Task artifacts

Download/preview requires source=agent_tool and source_session_id/source_task_id matching the current conversation/task. Arbitrary uploaded files are rejected. Downloads use attachment; previews use inline and actual metadata response types.

Unsupported preview, oversized content, and conversion failures return 415,413/code 19, and422/code 20 respectively. Download may be used if still available and admission passes. Errors after preview streaming begins interrupt the connection; a complete JSON error envelope is not guaranteed.
