Skip to content

refactor(opencode): coalesce code mode progress updates#37813

Open
flowluap wants to merge 1 commit into
anomalyco:devfrom
flowluap:code-mode-progress
Open

refactor(opencode): coalesce code mode progress updates#37813
flowluap wants to merge 1 commit into
anomalyco:devfrom
flowluap:code-mode-progress

Conversation

@flowluap

Copy link
Copy Markdown

Issue for this PR

Closes #37812

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

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 running state, 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 typecheck in packages/opencode
  • commit hook bun turbo typecheck (30/30 packages)
  • Prettier and git diff --check

Tests 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

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

Hey! Your PR title perf(opencode): coalesce code mode progress updates doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@flowluap flowluap changed the title perf(opencode): coalesce code mode progress updates refactor(opencode): coalesce code mode progress updates Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Coalesce Code Mode progress metadata updates

1 participant