Skip to content

Use AsyncIterableProducer for document diff changes#318296

Open
aydinomer00 wants to merge 1 commit into
microsoft:mainfrom
aydinomer00:codex-async-iterable-producer-document-diff
Open

Use AsyncIterableProducer for document diff changes#318296
aydinomer00 wants to merge 1 commit into
microsoft:mainfrom
aydinomer00:codex-async-iterable-producer-document-diff

Conversation

@aydinomer00
Copy link
Copy Markdown

@aydinomer00 aydinomer00 commented May 26, 2026

Part of #256854

This migrates the getTextDiff changes iterable from AsyncIterableObject to AsyncIterableProducer.

The document diff API currently computes all changes once and emits them once, so the iterable does not need to retain emitted values for later re-iteration. Using AsyncIterableProducer avoids keeping those emitted values in the async iterable implementation.

Validation:

  • nvm use && npm run compile-check-ts-native

Notes:

  • Dependency installation requires Node 22. After switching to Node 22.22.1, the main TypeScript compile check completed successfully.
  • Full npm install stopped while installing remote/node_modules because the local machine ran out of disk space (ENOSPC), but this change only touches src/ and the targeted compile check passed.

Copilot AI review requested due to automatic review settings May 26, 2026 06:21
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

Note

Copilot was unable to run its full agentic suite in this review.

Updates the async iterable implementation used for streaming text diff changes in the extension host API to use the newer AsyncIterableProducer utility.

Changes:

  • Swapped AsyncIterableObject for AsyncIterableProducer in imports.
  • Updated the cancellation/empty-stream return to use AsyncIterableProducer.EMPTY.
  • Updated the diff change stream construction to instantiate AsyncIterableProducer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants