Problem
ServerHandlerLogicTests 直接呼叫 parseGetChatHistoryArgs(),但 handler glue code(Server.swift:351-364)負責:
HandlerArgError/DateParseError → errorResult(e.description) 轉換
CallTool.Result.isError = true 旗標
- 從
GetChatHistoryArgs 的 6 個欄位 wire 到 tdlib.getChatHistory(...)
From verification of #7 by Codex (MEDIUM):
「這批新增測試沒有真正測到 handler 行為,只測到抽出的 parser。現在的測試沒有驗證 CallTool.Result.isError、錯誤訊息內容、也沒有驗證 handler 層的參數轉接,因此若之後是 handler glue 壞掉而不是 parser 壞掉,這組測試仍會全綠。」
Type
enhancement
Expected
加 handler-level integration test 類 fixture:
- Mock 或 stub
TDLibClient.getChatHistory spy call 參數
- 驗證
errorResult 的 isError: true + message 格式
- 驗證
GetChatHistoryArgs 6 個欄位正確傳到 tdlib 呼叫
- 可考慮用 protocol-based mock 或 Swift 的
@MainActor test helper
Code Reference
Sources/CheTelegramAllMCPCore/Server.swift:348-366 (handler glue)
Tests/CheTelegramAllMCPTests/ServerHandlerLogicTests.swift (只測 parser)
Related: #7
Implementation history
Current Status
Phase: closed-partial
Last updated: 2026-04-27 by idd-close
Key Decisions
Scope Changes
Blocking
(none — accepting PARTIALLY closure with explicit follow-up #27)
Test counts
- Batch total: 163 → 180 (+17)
- HandlerGlueTests: 6 + 2 (verify-DA F2) = 8 tests
Commits
Subsumed
Follow-up (verify-DA)
Problem
ServerHandlerLogicTests直接呼叫parseGetChatHistoryArgs(),但 handler glue code(Server.swift:351-364)負責:HandlerArgError/DateParseError→errorResult(e.description)轉換CallTool.Result.isError = true旗標GetChatHistoryArgs的 6 個欄位 wire 到tdlib.getChatHistory(...)Type
enhancement
Expected
加 handler-level integration test 類 fixture:
TDLibClient.getChatHistoryspy call 參數errorResult的isError: true+ message 格式GetChatHistoryArgs6 個欄位正確傳到 tdlib 呼叫@MainActortest helperCode Reference
Sources/CheTelegramAllMCPCore/Server.swift:348-366(handler glue)Tests/CheTelegramAllMCPTests/ServerHandlerLogicTests.swift(只測 parser)Related: #7
Implementation history
errorResultFromParse(_:) -> CallTool.Resultshared helper (commitd0750a2)HandlerGlueTests.swiftwith 6 catch-chain tests67451ef) — extended message truncation + CHANGELOG precedence noteServer.handleToolCall). Real handler integration test → follow-up Real Server.handleToolCall integration test (HandlerGlueTests is structural mimicry only) #27Current Status
Phase: closed-partial
Last updated: 2026-04-27 by idd-close
Key Decisions
errorResultFromParse(_:)module-level helperHandlerGlueTests.swift67451efScope Changes
Blocking
(none — accepting PARTIALLY closure with explicit follow-up #27)
Test counts
Commits
d0750a2refactor: extract errorResultFromParse + handler glue tests (Test: handler glue integration (errorResult conversion + tdlib wiring) #14, subsumes Catch chain integration tests for handler error wiring (#7/#13 follow-up) #18)67451effix: cap errorResultFromParse messages + document precedence change (Test: handler glue integration (errorResult conversion + tdlib wiring) #14 verify DA F2+F3)Subsumed
Follow-up (verify-DA)
Server.handleToolCallintegration test (HIGH priority — addresses DA F1 + Codex independent confirmation that HandlerGlueTests is structural mimicry)