Commit Graph
3 Commits
Author SHA1 Message Date
chenweiandClaude 1f78587bbd fix(mcp): 异常面适配真实 bleak——重试/错误码映射覆盖异常全家
- C1: _run_with_retry 捕获面 TransportError → (base+local 两个 TransportError,
  BleakError, OSError, asyncio.TimeoutError);真实掉线 bleak 裸抛
  BleakError("Not connected") 不再绕过重连重试
- C2/I1a: _map_transport_error 接受异常全家,类型优先(asyncio.TimeoutError、
  BleakDeviceNotFoundError → CONNECT_TIMEOUT)再按中英文消息映射;_call /
  scan_devices / device_status 的 except 同步扩展,device_status 不再把传输层
  错误兜底成 INTERNAL
- I2: _ensure_connected 的 __aenter__ 半途失败补 __aexit__,防半开连接泄漏
- M1: status() 先算 idle_seconds 再 _touch(),读数不再被自身归零
- docstring 校准:scan_devices 返回形状 data.devices;device_status 注明
  触发连接守候且刷新空闲计时
- 新测试 8 个(先红后绿):raw BleakError 重连成功/耗尽上抛、aenter 清理、
  idle_seconds 语义、local 中文 TransportError 两条映射、raw BleakError 映射、
  device_status 传输错误映射

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-30 23:55:31 +00:00
chenweiandClaude bb3dbcb06a fix(mcp): decode_image_source 非图片输入 OSError 归一 ValueError,守 INVALID_PARAM 契约
评审 fix round 1:Image.open 两处(路径/base64 分支)包 try/except OSError,
合法 base64 或存在文件但非可识别图片时不再让 PIL.UnidentifiedImageError
逃逸出 upload_image 炸 MCP 会话;补 decode 层与工具层覆盖测试各一。

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-30 16:29:44 +00:00
chenweiandClaude 22402a508d feat(mcp): 13 个高层 MCP 工具 + 图源解码 + 统一输出契约
Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-30 16:19:52 +00:00