Skip to content

workflows: child 进度更新重复扫描完整历史导致超线性开销 #179

Closed

Description

@tt-a1i

问题

extensions/workflows/runner.ts 在 child 运行期间的多次进度更新中重复扫描完整 message/tool-call history,并重建派生状态。随着单个 Agent tool loop 变长,总工作量呈超线性增长;大 Workflow 会把 UI/progress persistence 开销放大到每个 child。

期望

  • 以增量 cursor/watermark 消费新增事件,或复用 Pi 已提供的 lifecycle 事件;
  • 不在每次 delta/update 上从 history 起点重新配对 tool calls/results;
  • compaction、late event、取消和恢复后 cursor 语义明确;
  • canonical transcript 不因性能优化丢事件;
  • benchmark 比较 100/1k/10k 条历史下的总扫描量或 wall time,证明接近线性;
  • UI 更新节流与执行事实持久化分开,不能因减少 repaint 而漏掉终态证据。

Activity

  1. self-assigned this
    on Aug 28, 2026
  2. tt-a1i commented on Aug 28, 2026

    @tt-a1i
    CollaboratorAuthor

    I’m taking this one.

    I’ll keep the implementation on the existing Pi lifecycle seam: hydrate once, incrementally consume message/tool lifecycle events, rebuild after compaction, and perform one authoritative final reconciliation. The change will preserve the current bounded transcript, usage, cancellation, operator reuse, and persistence semantics rather than merely throttling UI updates.

    Validation will include deterministic scan-count evidence across 100/1k/10k histories, focused lifecycle regressions for parallel/late events and compaction, the repository checks and full suite, plus independent design and final-diff reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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