Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest streaming changes#281

Merged
andrewpareles merged 37 commits intomainfrom
model-selection
Feb 13, 2025
Merged

Latest streaming changes#281
andrewpareles merged 37 commits intomainfrom
model-selection

Conversation

@andrewpareles
Copy link
Contributor

@andrewpareles andrewpareles commented Feb 13, 2025

Important

Refactor and restructure the void platform by moving files, updating services, and enhancing message handling and tool management.

  • File Restructuring:
    • Moved several files from src/vs/platform/void to src/vs/workbench/contrib/void.
    • Deleted void.contribution.ts in src/vs/platform/void/browser.
  • Service Updates:
    • Updated LLMMessageService, MetricsService, VoidUpdateService, and RefreshModelService to use new paths and imports.
    • Added ToolService for AI tool management in toolsService.ts.
  • Functionality Changes:
    • Implemented sendLLMMessage in sendLLMMessage.ts to handle different providers like openAI, ollama, anthropic, etc.
    • Updated LLMMessageChannel to handle new message types and abort functionality.
  • Miscellaneous:
    • Updated workbench.common.main.ts to include new void contributions.
    • Added comments and TODOs for future improvements and testing needs.

This description was created by Ellipsis for 0dfa81f. It will automatically update as commits are pushed.

@andrewpareles andrewpareles merged commit 7fbe8d9 into main Feb 13, 2025
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 0dfa81f in 2 minutes and 45 seconds

More details
  • Looked at 2995 lines of code in 43 files
  • Skipped 0 files when reviewing.
  • Skipped posting 21 drafted comments based on config settings.
1. src/vs/workbench/contrib/void/electron-main/voidUpdateMainService.ts:23
  • Draft comment:
    Good use of fetch with a try/catch in check(). Consider logging errors or adding minimal error details (even in dev mode) to aid debugging when no update data is returned.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
2. src/vs/workbench/contrib/void/electron-main/llmMessage/anthropic.ts:41
  • Draft comment:
    Consider verifying that maxTokens is properly set by anthropicMaxPossibleTokens() before continuing. The onError is correctly used.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
3. src/vs/workbench/contrib/void/electron-main/llmMessage/groq.ts:20
  • Draft comment:
    In the for-await loop processing the chunks, ensure that error handling in the stream is robust. The use of async iteration looks correct.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
4. src/vs/workbench/contrib/void/electron-main/llmMessage/mistral.ts:27
  • Draft comment:
    The log for lack of support for interrupt is clear. Consider whether informing the user in the UI instead of just logging might be beneficial.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
5. src/vs/workbench/contrib/void/electron-main/llmMessage/openai.ts:38
  • Draft comment:
    The newOpenAI helper clearly switches between providers. Ensure that the baseURL and API keys are validated externally. Also, consider using performance.now() for more accurate duration timings in telemetry rather than new Date().getMilliseconds().
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
6. src/vs/workbench/contrib/void/electron-main/llmMessage/sendLLMMessage.ts:109
  • Draft comment:
    The duration is computed using getMilliseconds(), which returns the millisecond portion of the current second. Consider using a high-resolution timer (e.g. performance.now()) to accurately measure duration.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
7. src/vs/workbench/contrib/void/electron-main/llmMessageChannel.ts:69
  • Draft comment:
    The channel’s call() method dispatches commands based on string matching. This is straightforward but consider error handling if an unknown command is passed.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
8. src/vs/workbench/contrib/void/electron-main/metricsMainService.ts:30
  • Draft comment:
    The method _memoStorage correctly generates and caches unique IDs. Ensure that storing IDs with generateUuid() meets your privacy requirements.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
9. src/vs/workbench/contrib/void/common/refreshModelService.ts:146
  • Draft comment:
    The refresh polling logic uses setTimeout to re-trigger refreshing models. Consider debouncing if rapid changes occur, although expected data volume is small.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
10. src/vs/workbench/contrib/void/common/toolsService.ts:150
  • Draft comment:
    The context tools are defined clearly. Verify that the usage of spread operator for pagination works as intended. Overall, code is clear and functional.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
11. src/vs/workbench/contrib/void/common/voidSettingsService.ts:168
  • Draft comment:
    The service reads, decrypts, and validates settings state correctly. Review the somewhat nested _updatedValidatedState function for potential performance impact if settings grow very large; however, it's likely acceptable.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
12. src/vs/workbench/contrib/void/common/voidSettingsTypes.ts:268
  • Draft comment:
    The default provider settings and recognized models mapping look complete. The switch in displayInfoOfProviderName uses fall-through error handling for unknown providers which is good.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
13. src/vs/workbench/contrib/void/electron-main/llmMessage/openai.ts:109
  • Draft comment:
    The sendOpenAIFIM function currently returns a placeholder. Confirm if this is expected or if implementation is pending.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 40% <= threshold 50%
    The comment is asking the PR author to confirm if the placeholder return value is expected or if the implementation is pending. This is a request for confirmation, which violates the rule against asking the author to confirm their intention. However, it does point out a potential issue with the function returning a placeholder, which could be useful information. The comment could be rephrased to suggest that the placeholder return value might be an issue, without asking for confirmation.
14. src/vs/workbench/contrib/void/electron-main/llmMessage/sendLLMMessage.ts:138
  • Draft comment:
    The switch-case for providerName invokes different send functions appropriately. Ensure that the FIM branches returning 'TODO' for Anthropic, Gemini, Groq, and Mistral are intentionally unimplemented.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    The comment is asking the author to ensure that certain branches returning 'TODO' are intentionally unimplemented. This is a request for confirmation of intention, which violates the rule against asking the PR author to confirm their intention. Therefore, this comment should be removed.
15. src/vs/workbench/contrib/void/electron-main/metricsMainService.ts:92
  • Draft comment:
    The client identification using PostHog is well defined. Verify that logging sensitive identifiers complies with privacy policies.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
16. src/vs/workbench/contrib/void/electron-main/voidUpdateMainService.ts:24
  • Draft comment:
    The check() method fetches update information; consider handling network errors more verbose if needed and ensuring that non-production modes return no update.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
17. src/vs/workbench/contrib/void/electron-main/voidUpdateMainService.ts:24
  • Draft comment:
    Consider explicitly annotating the return type of the async check() method to clearly match the interface definition. This improves readability and type safety.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
18. src/vs/workbench/contrib/void/electron-main/voidUpdateMainService.ts:31
  • Draft comment:
    Before calling res.json(), check if the response is OK (e.g. using res.ok) to handle HTTP errors gracefully. This follows best practices with fetch.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
19. src/vs/workbench/contrib/void/electron-main/voidUpdateMainService.ts:41
  • Draft comment:
    The expression (downloadMessage || '') + '' is redundant. Consider simplifying it to String(downloadMessage || '') for clarity.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
20. src/vs/workbench/contrib/void/electron-main/voidUpdateMainService.ts:44
  • Draft comment:
    In the catch block, consider logging the error (e.g. via console.error) before returning null. This will help with debugging update failures.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
21. src/vs/workbench/contrib/void/electron-main/voidUpdateMainService.ts:37
  • Draft comment:
    The check for hasUpdate === undefined is a safeguard. Consider adding a comment explaining why returning null in that case is the desired behavior.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.

Workflow ID: wflow_FdxsZpK5Ox3i7wYv


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@wrench1997
Copy link

Uncaught TypeError: Cannot read properties of undefined (reading 'threadId')", source: file:///D:/voidproject/void/src/vs/workbench/contrib/void/browser/react/out/sidebar-tsx/index.js (29181)
[17092:0214/105322.181:INFO:CONSOLE(16001)] "The above error occurred in the component:

at RenderToken (file:///D:/voidproject/void/src/vs/workbench/contrib/void/browser/react/out/sidebar-tsx/index.js:29172:22)
at ChatMarkdownRender (file:///D:/voidproject/void/src/vs/workbench/contrib/void/browser/react/out/sidebar-tsx/index.js:29318:29)
at span
at li
at ol
at RenderToken (file:///D:/voidproject/void/src/vs/workbench/contrib/void/browser/react/out/sidebar-tsx/index.js:29172:22)
at ChatMarkdownRender (file:///D:/voidproject/void/src/vs/workbench/contrib/void/browser/react/out/sidebar-tsx/index.js:29318:29)
at div
at div
at ChatBubble (file:///D:/voidproject/void/src/vs/workbench/contrib/void/browser/react/out/sidebar-tsx/index.js:30078:21)
at div
at ScrollToBottomContainer (file:///D:/voidproject/void/src/vs/workbench/contrib/void/browser/react/out/sidebar-tsx/index.js:29920:34)
at div
at SidebarChat (file:///D:/voidproject/void/src/vs/workbench/contrib/void/browser/react/out/sidebar-tsx/index.js:30230:49)
at ErrorBoundary (file:///D:/voidproject/void/src/vs/workbench/contrib/void/browser/react/out/sidebar-tsx/index.js:30378:5)
at div
at div
at div
at Sidebar (file:///D:/voidproject/void/src/vs/workbench/contrib/void/browser/react/out/sidebar-tsx/index.js:30418:18)

Using this version of the content will cause a thread error.

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