Convert AI assistant from batch to streaming API#165
Draft
Conversation
…ect access Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
…ssues Fix useProject hook state isolation bug and AI chat space race condition
…load Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
…load fix(i18n): Cache initial locale to prevent repeated warnings on page load
Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
…uote-handling Fix inline highlighter quote handling for Shell and JS/TS nested expressions
…emes Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
… use 500px Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
…rowing Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
…tead of fileRepository listener Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
… EditorTab Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
…support both editor and diff tabs Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Fix DiffTab and AIReviewTab Monaco theme handling, layout, and tab reuse
- Changed from defining separate pyxis-dark/pyxis-light themes to a single pyxis-custom theme
- pyxis-custom theme now dynamically adapts based on colors (light/dark detection)
- Added cache key based on editor-related color properties to avoid unnecessary re-definitions
- Theme is only re-defined when relevant color properties change
- setTheme('pyxis-custom') is called on every mount to ensure consistency
Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
- Use LIGHT_THEMES list to determine light/dark theme - Accept themeName parameter instead of computing from colors - Remove getColorsCacheKey function and use themeName for caching - Update all callers to pass themeName from useTheme() Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Fix Monaco theme handling for DiffTab consistency
- Remove batch API functions (generateCodeEdit, generateChatResponse) - Add streaming functions (streamCodeEdit, streamChatResponse) - Update useAI hook to use streaming with real-time content updates - Add streaming content display in ChatContainer with markdown rendering - Update AIPanel to pass streaming content to ChatContainer Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
- Remove unused streamingMessageId state variable - Verify translation keys exist (ai.chatContainer.generating) Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update ai assistant to use stream format
Convert AI assistant from batch to streaming API
Dec 8, 2025
Owner
|
@copilot |
- Gemini streaming API doesn't use SSE format with &alt=sse - Parse JSON objects directly from newline-delimited stream - Process remaining buffer at end of stream - Follows Google AI API documentation for streamGenerateContent Co-authored-by: Stasshe <133995608+Stasshe@users.noreply.github.com>
Contributor
Author
Fixed in b8f4c4d. The issue was that Gemini's streaming API doesn't use the |
576b8e0 to
1bcd144
Compare
1e8a41c to
a412fb3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI Assistant Streaming Implementation
✅ 完了した実装内容:
1. ストリーミングAPI関数の実装
streamChatResponse: Askモード用のストリーミング関数streamCodeEdit: Editモード用のストリーミング関数generateCodeEdit,generateChatResponse)の削除2. useAIフックの更新
streamingContent)の追加3. ChatContainerコンポーネントの更新
4. 品質保証
5. バグ修正
&alt=sseパラメータを削除技術的な詳細:
streamGenerateContentエンドポイントを使用変更ファイル:
src/engine/ai/fetchAI.ts(修正: ストリーミングAPI実装)src/hooks/ai/useAI.ts(43行変更)src/components/AI/chat/ChatContainer.tsx(98行変更)src/components/AI/AIPanel.tsx(2行変更)Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.