Skip to content

feat: 压缩重试倒计时 + 卡顿提示 (item 16, CC 2.1.228) #107

Closed

Description

@dahai80

背景

enhance-0819.md item 16 (CC 2.1.228): compact 期间用户只见 spinner 静态文本 "Compacting conversation" (REPL.tsx:3366), 无重试/耗时可见性。

后端有 PTL 截断重试循环 (compact.ts:702-776 主 + :1180-1278 partial, 各 MAX_PTL_RETRIES=3), 重试时仅 logEvent("tengu_compact_ptl_retry") 写遥测, 不 emit 用户可见 progress。

LLM-summary compact 单次流可合法 30s+ 无 token (MLX 大上下文摘要慢), 用户无法区分 "正常慢" vs "卡住重试中"。

落地

3 文件 (对齐 Tier-2/3 审计):

  1. Tool.ts — CompactProgressEvent 加 2 变体: compact_retry {attempt, maxRetries, reason} + compact_stall {elapsedMs}
  2. compact.ts — 2 重试循环 emit compact_retry (复用现有 isEmptyMlxOom/isMlxServerError/PTL 判定映射 reason); startCompactStallTimer helper + 两 compact 函数 try/finally 接 10s interval emit compact_stall
  3. REPL.tsx — onCompactProgress switch 加 compact_retry (spinner 显 "Compacting (retry N/3: reason)") + compact_stall (超 FUSION_COMPACT_STALL_HINT_MS default 30s 显耗时提示)

纯可见性增强, 不改 compact 逻辑/默认行为。无 feature-flag。

验证

typecheck 0 / compactProgress 单测 pass / 全测无回归 / lint clean / 手工 MLX 大对话触发重试验证

Co-Authored-By: Claude Fable 5 [email protected]

Activity

  1. added a commit that references this issue on Aug 20, 2026
    dd0e3b8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions