fix: MCP 工具统一错误边界 / MCP tool error boundary - #1222
Open
mfurkanakinci wants to merge 16 commits into
Open
mfurkanakinci wants to merge 16 commits into
mfurkanakinci wants to merge 16 commits into
Conversation
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常 - Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged - 平台配置无法读取时返回配置错误,不再静默放行 - An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常 - Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged - 平台配置无法读取时返回配置错误,不再静默放行 - An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常 - Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged - 平台配置无法读取时返回配置错误,不再静默放行 - An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常 - Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged - 平台配置无法读取时返回配置错误,不再静默放行 - An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常 - Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged - 平台配置无法读取时返回配置错误,不再静默放行 - An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常 - Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged - 平台配置无法读取时返回配置错误,不再静默放行 - An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常 - Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged - 平台配置无法读取时返回配置错误,不再静默放行 - An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常 - Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged - 平台配置无法读取时返回配置错误,不再静默放行 - An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常 - Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged - 平台配置无法读取时返回配置错误,不再静默放行 - An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常 - Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged - 平台配置无法读取时返回配置错误,不再静默放行 - An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常 - Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged - 平台配置无法读取时返回配置错误,不再静默放行 - An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常 - Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged - 平台配置无法读取时返回配置错误,不再静默放行 - An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常 - Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged - 平台配置无法读取时返回配置错误,不再静默放行 - An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常 - Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged - 平台配置无法读取时返回配置错误,不再静默放行 - An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常 - Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged - 平台配置无法读取时返回配置错误,不再静默放行 - An unreadable platform config returns a configuration error instead of allowing every platform
- 增加 tool_boundary,把 MCPError 转成结构化错误并记录未预期异常 - Add tool_boundary so MCPError becomes a structured error and unexpected exceptions are logged - 平台配置无法读取时返回配置错误,不再静默放行 - An unreadable platform config returns a configuration error instead of allowing every platform
This branch has not been deployed
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.
中文
MCP 工具各自处理异常。平台配置读失败时会返回空列表,校验因此放行所有平台。通知配置读失败则被
except: pass吞掉。SQLite 打不开时也只打印警告并返回空数据。tool_boundary:MCPError转成结构化错误,其他异常记录日志后返回INTERNAL_ERRORNone,validate_platforms抛出ConfigurationError,不再静默放行FileParseError,不再当成没有数据English
Each MCP tool handled exceptions on its own. A failed platform-config read returned an empty list, so validation then allowed every platform. Notification config failures were swallowed with
except: pass. A SQLite open failure was printed and reported as empty data.tool_boundary.MCPErrorbecomes a structured error. Any other exception is logged and returned asINTERNAL_ERRORNone, andvalidate_platformsraisesConfigurationErrorinstead of allowing every platformFileParseErrorinstead of looking like missing data