-
-
Notifications
You must be signed in to change notification settings - Fork 13.5k
🐛 fix: improve mcp tracing with user config #8827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis pull request enforces user opt-in for MCP tracing by short-circuiting reportPluginCall based on user preference, removes server-config gating from telemetry notifications and settings to streamline the UI, and cleans up deprecated fields in the market and MCP tracing schemas. Sequence diagram for plugin call reporting with user opt-in tracingsequenceDiagram
participant User
participant DiscoverService
participant UserStore
participant LambdaClient
User->>DiscoverService: Initiate plugin call
DiscoverService->>UserStore: Check userAllowTrace
alt User has not opted in
DiscoverService-->>User: Skip reporting
else User has opted in
DiscoverService->>LambdaClient: Report plugin call
LambdaClient-->>DiscoverService: Response
end
Entity relationship diagram for updated market and MCP tracing schemaserDiagram
MARKET_REPORT {
callDurationMs int
clientId string
customPluginInfo any
errorCode string
errorMessage string
identifier string
isCustomPlugin boolean
metadata object
methodName string
methodType enum
platform string
requestSizeBytes int
responseSizeBytes int
}
MCP_TRACE {
errorCode string
errorMessage string
identifier string
isCustomPlugin boolean
metadata object
methodName string
methodType enum
requestSizeBytes int
responseSizeBytes int
sessionId string
}
Class diagram for DiscoverService and MCPService tracing changesclassDiagram
class DiscoverService {
+reportPluginCall(reportData: CallReportRequest)
- Skips reporting if !userAllowTrace
}
class MCPService {
+trace(...)
- inputParams removed
- outputResult removed
}
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
👍 @arvinxx Thank you for raising your pull request and contributing to our Community |
Claude encountered an error —— View job I'll analyze this and get back to you. |
TestGru AssignmentSummary
Files
Tip You can |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- Move the permission check out of the service class instead of calling
useUserStore
insideDiscoverService
—consider passing anallowTrace
flag intoreportPluginCall
so you’re not using a React hook in a non-component context. - Since the Analytics section is now always visible, double-check that this change aligns with the intended UX and doesn’t reintroduce unwanted telemetry prompts for users who should be gated by server or product settings.
- After removing deprecated fields from the tracing schemas, ensure any downstream consumers or analytics pipelines gracefully handle the absence of
clientIp
,inputParams
, andoutputResult
.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Move the permission check out of the service class instead of calling `useUserStore` inside `DiscoverService`—consider passing an `allowTrace` flag into `reportPluginCall` so you’re not using a React hook in a non-component context.
- Since the Analytics section is now always visible, double-check that this change aligns with the intended UX and doesn’t reintroduce unwanted telemetry prompts for users who should be gated by server or product settings.
- After removing deprecated fields from the tracing schemas, ensure any downstream consumers or analytics pipelines gracefully handle the absence of `clientIp`, `inputParams`, and `outputResult`.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
❤️ Great PR @arvinxx ❤️ The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world. |
### [Version 1.112.5](v1.112.4...v1.112.5) <sup>Released on **2025-08-17**</sup> #### 🐛 Bug Fixes - **misc**: Improve mcp tracing with user config. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's fixed * **misc**: Improve mcp tracing with user config, closes [#8827](#8827) ([5cab2ee](5cab2ee)) </details> <div align="right"> [](#readme-top) </div>
🎉 This PR is included in version 1.112.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [Version 1.113.0](v1.112.0...v1.113.0) <sup>Released on **2025-08-18**</sup> #### ♻ Code Refactoring - **misc**: Refactor const folder to a new package, refactor prompts folder to the `@lobechat/prompts` pacakge, 重构ArgsInput组件. #### ✨ Features - **provider**: Add BFL provider support for image generation. #### 🐛 Bug Fixes - **db**: Desktop local db can't vectorization. - **misc**: Improve mcp tracing with user config. #### 💄 Styles - **misc**: Add Imagen 4 GA models, style improve auth sign in box loading. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### Code refactoring * **misc**: Refactor const folder to a new package, closes [lobehub#8756](https://github.com/jaworldwideorg/OneJA-Bot/issues/8756) ([30a4734](30a4734)) * **misc**: Refactor prompts folder to the `@lobechat/prompts` pacakge, closes [lobehub#8810](https://github.com/jaworldwideorg/OneJA-Bot/issues/8810) ([d82e7bb](d82e7bb)) * **misc**: 重构 ArgsInput 组件, closes [lobehub#8765](https://github.com/jaworldwideorg/OneJA-Bot/issues/8765) ([0905559](0905559)) #### What's improved * **provider**: Add BFL provider support for image generation, closes [lobehub#8806](https://github.com/jaworldwideorg/OneJA-Bot/issues/8806) ([519e03e](519e03e)) #### What's fixed * **db**: Desktop local db can't vectorization, closes [lobehub#8830](https://github.com/jaworldwideorg/OneJA-Bot/issues/8830) ([a00fd9d](a00fd9d)) * **misc**: Improve mcp tracing with user config, closes [lobehub#8827](https://github.com/jaworldwideorg/OneJA-Bot/issues/8827) ([5cab2ee](5cab2ee)) #### Styles * **misc**: Add Imagen 4 GA models, closes [lobehub#8799](https://github.com/jaworldwideorg/OneJA-Bot/issues/8799) ([2e9ad20](2e9ad20)) * **misc**: Style improve auth sign in box loading, closes [lobehub#8805](https://github.com/jaworldwideorg/OneJA-Bot/issues/8805) ([62f5a1b](62f5a1b)) </details> <div align="right"> [](#readme-top) </div>
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
📝 补充信息 | Additional Information
Summary by Sourcery
Enhance MCP tracing by enforcing user opt-in, simplifying telemetry gating, and cleaning up trace payloads
Enhancements: