Skip to content

Commit ecdea3f

Browse files
James Changclaude
andcommitted
docs: add reconnection error scenarios per review feedback
Add NOT_FOUND and FAILED_PRECONDITION error cases to reconnection docs in specification.md and streaming-and-async.md per gemini-code-assist suggestions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c1446a3 commit ecdea3f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/specification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ The operation MUST establish a bidirectional streaming connection. The stream MU
248248

249249
**Reconnection:**
250250

251-
A client may reconnect to an ongoing task by specifying a `taskId` with empty message parts. If the task is in a terminal state, the agent returns the task and half-closes. If the task is active, the agent sends the current state and begins sending updates.
251+
A client may reconnect to an ongoing task by specifying a `taskId` with empty message parts. If the task is in a terminal state, the agent returns the task and half-closes. If the task is active, the agent sends the current state and begins sending updates. If no task exists with the specified ID, the agent SHOULD return a `NOT_FOUND` error. If another client already has an active stream for the task and the agent does not support multiple connections, the agent MAY return a `FAILED_PRECONDITION` error.
252252

253253
#### 3.1.4. Get Task
254254

docs/topics/streaming-and-async.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ For tasks that require human-in-the-loop interactions — such as multi-step app
6464

6565
- **Stream Termination:** The agent MUST half-close the connection when the task reaches a terminal state (`COMPLETED`, `FAILED`, `CANCELED`, `REJECTED`).
6666

67-
- **Reconnection:** A client can reconnect to an ongoing task by calling `SendLiveMessage` with a `taskId` and empty message parts. If the task is active, the agent sends the current state and resumes streaming updates.
67+
- **Reconnection:** A client can reconnect to an ongoing task by calling `SendLiveMessage` with a `taskId` and empty message parts. If the task is active, the agent sends the current state and resumes streaming updates. If the task is already in a terminal state, the agent returns the final task details and half-closes the stream. If the task ID is not found, or if another stream is already active and the agent doesn't support multiplexing, an error (`NOT_FOUND` or `FAILED_PRECONDITION`) is returned.
6868

6969
### When to Use Bidirectional Streaming
7070

0 commit comments

Comments
 (0)