Cut off Anthropic Messages stream after 5 min max duration (#321432)#321679
Cut off Anthropic Messages stream after 5 min max duration (#321432)#321679meganrogge wants to merge 2 commits into
Conversation
|
/requires-eval-assessment terminalbench2 gpt-5.5,claude-opus-4.6,claude-opus-4.7 vscode-copilot-cli |
|
⏳ Queued vscode build for
|
There was a problem hiding this comment.
Pull request overview
This PR adds a hard maximum duration for Anthropic Messages API streaming responses in the Copilot extension’s node endpoint implementation, preventing requests from hanging indefinitely when the server returns 200 and then stops producing SSE chunks.
Changes:
- Introduces a module-level constant defining a 5-minute maximum streaming duration.
- Adds a timer-based cutoff that rejects the returned
AsyncIterableand destroys the streaming body when the limit is exceeded. - Ensures the cutoff timer is cleared when streaming finishes (successfully or not).
Show a summary per file
| File | Description |
|---|---|
| extensions/copilot/src/platform/endpoint/node/messagesApi.ts | Adds a max-duration cutoff for Anthropic Messages SSE streaming to avoid indefinite hangs. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 2
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
⏳ Queued vscode build for
|
|
🚀 Queued eval-assessment publish build for
|
|
🔬 Queued eval-assessment benchmark for
Results will be posted back here when the run completes. |
|
✅ Eval-assessment build published.
|
No description provided.