refactor(opencode): coalesce code mode progress updates#37813
Open
flowluap wants to merge 1 commit into
Open
Conversation
Contributor
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
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.
Issue for this PR
Closes #37812
Type of change
What does this PR do?
Coalesces cumulative Code Mode child-call metadata on a 100 ms interval instead of publishing once at every start and completion. Long calls still expose
runningstate, while normal completion publishes one reliable terminal snapshot after stopping the progress fiber. Progress failures are bounded and logged once, and abort races cannot leave execution blocked on metadata.For a 20-call burst, updates dropped from 40 to 1 and serialized event payload dropped from 9,156 to 3,128 bytes (65.8%).
How did you verify your code works?
bun test test/tool/code-mode.test.ts test/tool/code-mode-integration.test.ts(59 pass)bun run typecheckinpackages/opencodebun turbo typecheck(30/30 packages)git diff --checkTests cover quick and long calls, burst coalescing, transient metadata failures, in-flight publisher shutdown, cancellation, stalled metadata, and late abort during final publication.
Screenshots / recordings
Not applicable; behavior is covered by metadata integration tests.
Checklist