Skip to content

Conversation

@zerob13
Copy link
Collaborator

@zerob13 zerob13 commented Nov 26, 2025

https://www.npmjs.com/package/markstream-vue

Summary by CodeRabbit

  • Chores
    • Switched the project's markdown rendering dependency to a new package; UI markdown display and styles remain unchanged.
    • Updated internal typing/implementation details in a backend component; no changes to observable behavior or public APIs.
    • No user-facing functionality was altered.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 26, 2025

Walkthrough

Replaces devDependency vue-renderer-markdown with markstream-vue and updates all imports (NodeRenderer, MermaidBlockNode, getLanguageIcon, workers, Tailwind/CSS). Also tightens a type: handleToolCall now accepts CallToolRequest instead of a zod-inferred type.

Changes

Cohort / File(s) Change Summary
Dependency Migration
package.json
Replaced devDependency vue-renderer-markdown@0.0.63-beta.2 with markstream-vue@^0.0.1.
Markdown renderer imports
src/renderer/settings/components/AboutUsSettings.vue, src/renderer/src/components/markdown/MarkdownRenderer.vue, src/renderer/src/components/think-content/ThinkContent.vue, src/renderer/src/components/ui/UpdateDialog.vue
Swapped import source from vue-renderer-markdownmarkstream-vue for NodeRenderer and related exports (setCustomComponents, CodeBlockNode, ReferenceNode, getUseMonaco, etc.).
Artifact / helper imports
src/renderer/src/components/artifacts/CodeArtifact.vue
Swapped import source for MermaidBlockNode and getLanguageIcon from vue-renderer-markdownmarkstream-vue.
Worker & asset imports
src/renderer/src/components/markdown/MarkdownRenderer.vue, src/renderer/src/assets/style.css
Updated worker import paths (KatexWorker, MermaidWorker) and Tailwind/CSS imports from vue-renderer-markdown/...markstream-vue/....
Type tightening
src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
Added type CallToolRequest import and changed handleToolCall parameter from z.infer<typeof CallToolRequestSchema> to CallToolRequest (no logic changes).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify markstream-vue exposes the same public API used (NodeRenderer, MermaidBlockNode, CodeBlockNode, ReferenceNode, setCustomComponents, setKaTeXWorker, setMermaidWorker, getUseMonaco, getLanguageIcon).
  • Confirm worker files (katexRenderer.worker, mermaidParser.worker) exist at the new package paths and bundler resolves them.
  • Check Tailwind/CSS import paths in style.css resolve and produce expected styling.
  • Review autoPromptingServer.ts type change for compatibility where handleToolCall is invoked.

Possibly related PRs

Suggested reviewers

  • yyhhyyyyyy

Poem

🐰 From old renderer to new I leap and chew a clue,
I swap the packages cleanly, hop through every view.
Imports lined up tidy, workers find their way,
A tiny hop, a tidy swap — hooray for markstream-vue! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: rename vue markdown renderer' accurately describes the main change: replacing the vue-renderer-markdown dependency with markstream-vue across multiple files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/rename-renderer-deps-pack

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6b06736 and 02d5029.

📒 Files selected for processing (1)
  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (14)
**/*.{ts,tsx,js,jsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

Use English for logs and comments (Chinese text exists in legacy code, but new code should use English)

Files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Enable and maintain strict TypeScript type checking for all files

**/*.{ts,tsx}: Always use try-catch to handle possible errors in TypeScript code
Provide meaningful error messages when catching errors
Log detailed error logs including error details, context, and stack traces
Distinguish and handle different error types (UserError, NetworkError, SystemError, BusinessError) with appropriate handlers in TypeScript
Use structured logging with logger.error(), logger.warn(), logger.info(), logger.debug() methods from logging utilities
Do not suppress errors (avoid empty catch blocks or silently ignoring errors)
Provide user-friendly error messages for user-facing errors in TypeScript components
Implement error retry mechanisms for transient failures in TypeScript
Avoid logging sensitive information (passwords, tokens, PII) in logs

Files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
src/main/presenter/**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Organize core business logic into dedicated Presenter classes, with one presenter per functional domain

Files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
src/main/**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Use EventBus from src/main/eventbus.ts for main-to-renderer communication, broadcasting events via mainWindow.webContents.send()

src/main/**/*.ts: Use EventBus pattern for inter-process communication within the main process to decouple modules
Use Electron's built-in APIs for file system and native dialogs instead of Node.js or custom implementations

src/main/**/*.ts: Electron main process code belongs in src/main/ with presenters in presenter/ (Window/Tab/Thread/Mcp/Config/LLMProvider) and eventbus.ts for app events
Use the Presenter pattern in the main process for UI coordination

Files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
src/main/presenter/mcpPresenter/**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Register new MCP tools in mcpPresenter/index.ts after implementing them in inMemoryServers/

Files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Do not include AI co-authoring information (e.g., 'Co-Authored-By: Claude') in git commits

Files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
**/*.{js,ts,jsx,tsx,mjs,cjs}

📄 CodeRabbit inference engine (.cursor/rules/development-setup.mdc)

Write logs and comments in English

Files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
{src/main/presenter/**/*.ts,src/renderer/**/*.ts}

📄 CodeRabbit inference engine (.cursor/rules/electron-best-practices.mdc)

Implement proper inter-process communication (IPC) patterns using Electron's ipcRenderer and ipcMain APIs

Files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
src/**/*

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

New features should be developed in the src directory

Files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
src/main/**/*.{js,ts}

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

Main process code for Electron should be placed in src/main

Files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
src/**/*.{ts,tsx,vue,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use Prettier with single quotes, no semicolons, and 100 character width

Files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use OxLint for linting JavaScript and TypeScript files

Files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.{ts,tsx}: Use camelCase for variable and function names in TypeScript files
Use PascalCase for type and class names in TypeScript
Use SCREAMING_SNAKE_CASE for constant names

Files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Use EventBus for inter-process communication events

Files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
🧠 Learnings (9)
📓 Common learnings
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-11-25T05:27:26.648Z
Learning: Applies to src/renderer/**/*.{vue,js,ts} : Renderer process code should be placed in `src/renderer` (Vue 3 application)
Learnt from: neoragex2002
Repo: ThinkInAIXYZ/deepchat PR: 807
File: src/renderer/src/components/markdown/MarkdownRenderer.vue:58-58
Timestamp: 2025-08-28T08:07:05.182Z
Learning: In src/renderer/src/components/markdown/MarkdownRenderer.vue, the unscoped <style> tag is intentionally used for global prose styles and the anchor .markdown-renderer fix, as confirmed by user neoragex2002.
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-11-25T05:28:04.439Z
Learning: Applies to src/renderer/**/*.vue : Use Shadcn Vue, Radix Vue, and Tailwind for components and styling
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-11-25T05:28:04.440Z
Learning: Applies to src/renderer/**/*.{ts,vue} : Use Iconify/Vue for icon implementation
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-11-25T05:28:04.439Z
Learning: Applies to src/renderer/**/*.vue : Use template syntax for declarative rendering
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-11-25T05:26:43.498Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx} : All user-facing strings must use i18n keys with vue-i18n framework in the renderer
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T05:28:20.500Z
Learning: Applies to src/renderer/src/components/**/*.vue : Use Tailwind for styles in Vue components
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T05:28:20.500Z
Learning: Applies to src/renderer/src/**/*.{ts,tsx,vue} : Use TypeScript with Vue 3 Composition API for the renderer application
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-11-25T05:28:04.440Z
Learning: Applies to src/renderer/**/*.{ts,vue} : Use provide/inject for dependency injection when appropriate
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-11-25T05:28:04.439Z
Learning: Applies to src/renderer/**/*.vue : Structure files: exported component, composables, helpers, static content, types
📚 Learning: 2025-11-25T05:26:11.297Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T05:26:11.297Z
Learning: Applies to src/main/presenter/mcpPresenter/**/*.ts : Register new MCP tools in `mcpPresenter/index.ts` after implementing them in `inMemoryServers/`

Applied to files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
📚 Learning: 2025-11-25T05:27:12.201Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-11-25T05:27:12.201Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : In Provider implementations, handle native tool support by converting MCP tools to Provider format using `convertToProviderTools` and including them in the API request; for Providers without native function call support, prepare messages using `prepareFunctionCallPrompt` before making the API call

Applied to files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
📚 Learning: 2025-11-25T05:27:12.201Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-11-25T05:27:12.201Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : In `src/main/presenter/llmProviderPresenter/index.ts`, listen for standardized events yielded by `coreStream` and handle them accordingly: buffer text content (`currentContent`), handle `tool_call_start/chunk/end` events by collecting tool details and calling `presenter.mcpPresenter.callTool`, send frontend events via `eventBus` with tool call status, format tool results for the next LLM call, and set `needContinueConversation = true`

Applied to files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
📚 Learning: 2025-11-25T05:26:11.297Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-25T05:26:11.297Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : Convert MCP tools to provider-specific formats and normalize streaming responses to standard events in each provider implementation

Applied to files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
📚 Learning: 2025-11-25T05:27:12.201Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-11-25T05:27:12.201Z
Learning: Implement separation of concerns where `src/main/presenter/llmProviderPresenter/index.ts` manages the Agent loop and conversation history, while Provider files handle LLM API interactions, Provider-specific request/response formatting, tool definition conversion, and native vs non-native tool call mechanisms

Applied to files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
📚 Learning: 2025-11-25T05:27:12.201Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-11-25T05:27:12.201Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : In Provider implementations, include helper methods for Provider-specific operations such as `formatMessages`, `convertToProviderTools`, `parseFunctionCalls`, and `prepareFunctionCallPrompt`

Applied to files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
📚 Learning: 2025-11-25T05:27:12.201Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-11-25T05:27:12.201Z
Learning: Applies to src/main/presenter/llmProviderPresenter/**/*.ts : Define the standardized `LLMCoreStreamEvent` interface with fields: `type` (text | reasoning | tool_call_start | tool_call_chunk | tool_call_end | error | usage | stop | image_data), `content` (for text), `reasoning_content` (for reasoning), `tool_call_id`, `tool_call_name`, `tool_call_arguments_chunk` (for streaming), `tool_call_arguments_complete` (for complete arguments), `error_message`, `usage` object with token counts, `stop_reason` (tool_use | max_tokens | stop_sequence | error | complete), and `image_data` object with Base64-encoded data and mimeType

Applied to files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
📚 Learning: 2025-11-25T05:27:39.191Z
Learnt from: CR
Repo: ThinkInAIXYZ/deepchat PR: 0
File: .cursor/rules/provider-guidelines.mdc:0-0
Timestamp: 2025-11-25T05:27:39.191Z
Learning: Applies to **/*Provider**/index.ts : Tool call events: strictly follow sequence `tool_call_start → tool_call_chunk* → tool_call_end`, ensure `tool_call_id` is required and stable

Applied to files:

  • src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-check (x64)
🔇 Additional comments (2)
src/main/presenter/mcpPresenter/inMemoryServers/autoPromptingServer.ts (2)

2-6: LGTM: Type import added for explicit typing.

The addition of the explicit CallToolRequest type import improves type clarity and reduces coupling to the schema implementation. Using the type keyword for type-only imports is best practice.


130-130: Verified: Type refactoring is correct, but review comment contains incorrect SDK version information.

The change from inferred Zod type to explicit CallToolRequest is sound. Both CallToolRequestSchema and type CallToolRequest are imported from @modelcontextprotocol/sdk/types.js, and the parameter destructuring (request.params) at line 131 confirms the type is used correctly.

However, the review comment incorrectly states SDK version 0.5.1 when the actual version in package.json is ^1.22.0. This discrepancy should be corrected.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zerob13 zerob13 merged commit f1c7dde into dev Nov 26, 2025
2 checks passed
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.

2 participants