Skip to content

perf(workflows): child 启动会同步 hydrate 全部 foreign workflow artifacts #183

Closed

Description

@tt-a1i

问题

每个 child Session 启动时,Workflow extension 会同步枚举并 hydrate agent directory 下所有持久化 Workflow,再在 hydrate 之后判断哪些 run 属于当前 Session。多数 run 对 child 是 foreign,但其文件读取和 JSON parse 成本已经发生。

证据

  • extensions/workflows/index.ts:992-998:启动期恢复 persisted runs;
  • extensions/workflows/dashboard.ts:87-127,142-156:同步读取、parse 和 normalize workflow artifacts;
  • ownership/session 过滤晚于 hydration。

成本近似:O(child starts × 全部 persisted workflow bytes)。历史 run 越多,Direct/Workflow child 启动越慢,并同步阻塞事件循环。

期望

  • 在读取完整 artifact 前使用可信、轻量、可验证的 owner/session index 过滤;
  • child-safe capability binding 不恢复与该 child 无关的 operator history;
  • index 缺失或损坏时 fail closed,不把不可信 metadata 当 ownership;
  • benchmark:0/100/1,000 个 foreign runs 下启动 1/4/8 children,测同步阻塞、读取 bytes、parse 次数和 startup latency;
  • restore/replay/dashboard 的 canonical artifacts 语义保持不变。

Activity

  1. added
    bug
    on Aug 25, 2026
  2. Sun-GLiang commented on Aug 28, 2026

    @Sun-GLiang
    Contributor

    I'd like to do it

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions