Skip to content

Conversation

@Emt-lin
Copy link
Collaborator

@Emt-lin Emt-lin commented Jan 15, 2026

Summary

This PR adds streaming response support for GitHub Copilot integration and improves overall robustness of the provider.

Changes

Streaming Support

  • Add streaming response with SSE (Server-Sent Events) parsing using eventsource-parser
  • Add Accept: text/event-stream header and content-type validation
  • Implement _streamResponseChunks method in GitHubCopilotChatModel

Robustness Improvements

  • Add empty output detection to prevent silent failures
  • Unify token expiry logic between getAuthState() and getValidCopilotToken()
  • Add proper resource cleanup with reader.cancel()
  • Add request cancellation handling in GitHubCopilotAuth component
  • Extract HTTP_STATUS_MESSAGES constant for better error messages

Simplification

  • Remove fallback mechanism for simpler error handling

Files Changed

  • src/LLMProviders/githubCopilot/GitHubCopilotChatModel.ts - Add streaming support
  • src/LLMProviders/githubCopilot/GitHubCopilotProvider.ts - Improve token handling and SSE parsing
  • src/settings/v2/components/GitHubCopilotAuth.tsx - Add request cancellation handling

- Add streaming response with SSE parsing (eventsource-parser)
- Add Accept: text/event-stream header and content-type validation
- Add empty output detection to prevent silent failures
- Unify token expiry logic between getAuthState() and getValidCopilotToken()
- Add proper resource cleanup with reader.cancel()
- Add request cancellation handling in GitHubCopilotAuth component
- Extract HTTP_STATUS_MESSAGES constant
- Remove fallback mechanism for simpler error handling
@Emt-lin
Copy link
Collaborator Author

Emt-lin commented Jan 15, 2026

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. 🚀

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@Emt-lin Emt-lin requested a review from logancyang January 15, 2026 08:13
@logancyang logancyang merged commit 5bfb6fb into master Jan 15, 2026
2 checks passed
@logancyang logancyang deleted the fix-github-copilot branch January 15, 2026 19:31
@logancyang logancyang mentioned this pull request Jan 15, 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