Repository navigation
perf(workflows): incrementally project child progress - #217
Merged
Merged
Conversation
agnitum2009
pushed a commit
to agnitum2009/openpi
that referenced
this pull request
Aug 28, 2026
Co-authored-by: tt-a1i <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Workflow child progress currently rebuilds usage, preview, transcript, tool renderer state, and context occupancy from the complete Pi message history on every finalized message and tool lifecycle event. A long tool loop therefore repeatedly traverses an ever-growing history and becomes quadratic. This closes #179.
Value
Long-running Workflow agents keep responsive progress reporting without spending progressively more CPU on derived UI state. The improvement grows with the run: a 10,000-message benchmark visits canonical source messages 10,000 times instead of the 100,005,000 visits required by a conservative one-full-scan-per-progress lower bound.
Approach
AgentProgressProjectionthat folds each finalized Pi message once and produces the existing full progress snapshot shape.This intentionally does not add a persisted cross-activation checkpoint. Reusing an operator still performs one linear startup hydration per activation.
Validation
node --test --experimental-strip-types tests/extensions/workflows/progress-projection.test.ts tests/extensions/workflows/runner.test.ts— 33/33 passed.node --test --experimental-strip-types tests/extensions/workflows/*.test.ts— 246/246 passed.bun run check— passed. The 12 existing Effect diagnostics remain tracked by file-search: 修复 Effect failure channel 与多次 provide 诊断 #170.bun run test— Node 926/926 and Vitest 30/30 passed.bun benchmarks/workflow-progress.ts:Impact