Skip to content

Cut off Anthropic Messages stream after 5 min max duration (#321432)#321679

Draft
meganrogge wants to merge 2 commits into
mainfrom
meganrogge/messages-api-stream-max-duration
Draft

Cut off Anthropic Messages stream after 5 min max duration (#321432)#321679
meganrogge wants to merge 2 commits into
mainfrom
meganrogge/messages-api-stream-max-duration

Conversation

@meganrogge

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings June 16, 2026 21:35
@meganrogge meganrogge marked this pull request as draft June 16, 2026 21:35
@meganrogge meganrogge self-assigned this Jun 16, 2026
@meganrogge meganrogge added this to the 1.126.0 milestone Jun 16, 2026
@meganrogge

Copy link
Copy Markdown
Collaborator Author

/requires-eval-assessment terminalbench2 gpt-5.5,claude-opus-4.6,claude-opus-4.7 vscode-copilot-cli

@meganrogge meganrogge added the ~requires-eval-assessment Evals will be run and will generate a report upon completion label Jun 16, 2026
@vs-code-engineering

Copy link
Copy Markdown
Contributor

⏳ Queued vscode build for d948744512738e616795dc36f138b3bb9fafae40 (step 1/2).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 AsyncIterable and 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

Comment thread extensions/copilot/src/platform/endpoint/node/messagesApi.ts Outdated
Comment thread extensions/copilot/src/platform/endpoint/node/messagesApi.ts
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@meganrogge meganrogge added ~requires-eval-assessment Evals will be run and will generate a report upon completion and removed ~requires-eval-assessment Evals will be run and will generate a report upon completion labels Jun 16, 2026
@vs-code-engineering

Copy link
Copy Markdown
Contributor

⏳ Queued vscode build for 878695a89d12a1e78839921fec2b12e4a9bcbb99 (step 1/2).

@vs-code-engineering

Copy link
Copy Markdown
Contributor

🚀 Queued eval-assessment publish build for d36275542e98716b882a87908aec1b37e875da58 (step 2/2).

@vs-code-engineering

Copy link
Copy Markdown
Contributor

🔬 Queued eval-assessment benchmark for 7cc2487963.

Results will be posted back here when the run completes.

@vs-code-engineering

Copy link
Copy Markdown
Contributor

✅ Eval-assessment build published.

@vs-code-engineering vs-code-engineering Bot removed the ~requires-eval-assessment Evals will be run and will generate a report upon completion label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants