修改摘要

Agent: programmer (programmer)
Confidence: 46%
Cost: $1.0851
Duration: 3m 2s
Task ID: 59751491-c9f7-45e2-af84-7083e73847ba


修改摘要

改動內容

3 個檔案,+33 行 / -10 行

  1. src/telegram/helpers.ts — 新增 formatUserError() function(SPEC 提供的定義,因 Batch 5 尚未合併)
  2. src/documents/document-handler.ts — 5 處錯誤訊息統一:
    • Line 55: ❌ ${downloadResult.error}${fixHint}formatUserError('cli-error', downloadResult.error)
    • Line 63: ❌ ${parseResult.error}${fixHint}formatUserError('cli-error', parseResult.error)
    • Line 176: ❌ 檔案處理失敗: ${errMsg}formatUserError('system-error', errMsg)
    • Line 214: ❌ 分析失敗: ${errMsg}formatUserError('system-error', errMsg)
    • Line 250: ❌ AI 分析失敗: ${result.error}formatUserError('cli-error', result.error)
    • Line 308: return ❌ 分析失敗: ${result.error}formatUserError('cli-error', result.error)
  3. src/commands/remote.ts — 3 處錯誤訊息統一:
    • /files command: Error: ${result.error}formatUserError('cli-error', result.error)
    • /run command: Error: ${result.error}${fixHint}formatUserError('cli-error', result.error)
    • /git command: Error: ${result.error}formatUserError('cli-error', result.error)

設計決策

  • fixHint 不再單獨顯示 — formatUserError 已提供標準化的 suggestion,避免重複建議
  • catch block 例外用 'system-error' 類別(非預期錯誤),Result 失敗用 'cli-error' 類別(可預期的操作失敗)
  • tsgo --noEmit 通過,pre-commit hook 通過
  • Commit: a818699

—HANDOFF—
TO: reviewer
INTENT: handoff
ARTIFACT_TYPE: code-change
SUMMARY: SPEC-39 supplement — unified 8 old-format error messages in document-handler.ts and remote.ts to use formatUserError()