Skip to content

nes: xtab: refactor: extract _performFetch from _streamEditsImpl#308778

Merged
ulugbekna merged 1 commit intomainfrom
ulugbekna/tense-buzzard
Apr 9, 2026
Merged

nes: xtab: refactor: extract _performFetch from _streamEditsImpl#308778
ulugbekna merged 1 commit intomainfrom
ulugbekna/tense-buzzard

Conversation

@ulugbekna
Copy link
Copy Markdown
Contributor

Separate the HTTP fetch lifecycle (FetchStreamSource setup, makeChatRequest2, initial error handling, line stream construction with cursor-tag removal and latency logging) into a dedicated _performFetch method.

This makes the fetch infrastructure self-contained and returns a clean AsyncIterable line stream + getFetchFailure callback for downstream format handlers, matching the pattern already used by XtabCustomDiffPatchResponseHandler.

_streamEditsImpl is now a coordinator: it calls _performFetch, then dispatches to format handlers, then post-processes edit-window results.

Part of #308744

Separate the HTTP fetch lifecycle (FetchStreamSource setup, makeChatRequest2,
initial error handling, line stream construction with cursor-tag removal and
latency logging) into a dedicated _performFetch method.

This makes the fetch infrastructure self-contained and returns a clean
AsyncIterable<string> line stream + getFetchFailure callback for downstream
format handlers, matching the pattern already used by
XtabCustomDiffPatchResponseHandler.

_streamEditsImpl is now a coordinator: it calls _performFetch, then dispatches
to format handlers, then post-processes edit-window results.

Part of #308744
Copilot AI review requested due to automatic review settings April 9, 2026 13:37
@ulugbekna ulugbekna enabled auto-merge (squash) April 9, 2026 13:37
@ulugbekna ulugbekna self-assigned this Apr 9, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

Screenshot Changes

Base: 9f03a14a Current: 36c2c3d8

Changed (1)

editor/inlineChatAffordance/InlineChatOverlay/Light
Before After
before after

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors XtabProvider’s NES streaming flow by extracting the HTTP fetch/stream setup from _streamEditsImpl into a dedicated _performFetch helper, so downstream response format handlers operate on a clean AsyncIterable<string> line stream and fetch-failure callback.

Changes:

  • Introduced a FetchResult result union to represent either a line stream, a model-not-found retry signal, or a fetch error.
  • Added _performFetch(...) to encapsulate makeChatRequest2 lifecycle, stream wiring, cursor-tag removal, and latency logging.
  • Simplified _streamEditsImpl into a two-phase coordinator: fetch → dispatch to response-format handlers → post-process edits.
Show a summary per file
File Description
extensions/copilot/src/extension/xtab/node/xtabProvider.ts Extracts fetch lifecycle into _performFetch and updates _streamEditsImpl to consume a standardized fetch result/line stream.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 2

Comment thread extensions/copilot/src/extension/xtab/node/xtabProvider.ts
Comment thread extensions/copilot/src/extension/xtab/node/xtabProvider.ts
@ulugbekna ulugbekna merged commit c5ac25e into main Apr 9, 2026
27 checks passed
@ulugbekna ulugbekna deleted the ulugbekna/tense-buzzard branch April 9, 2026 17:50
@vs-code-engineering vs-code-engineering bot added this to the 1.116.0 milestone Apr 9, 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.

3 participants