Repository navigation
Reduce activity-write and observability overhead - #682
Merged
Merged
Conversation
ronak-guliani
marked this pull request as ready for review
October 4, 2026 22:58
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.
Summary
Reduce SQLite write amplification, background cleanup bursts, and aggregate provider-log growth while preserving ordered activity delivery.
Problem
The reported profile contains 9,204 activity appends in the latest 10,000 events. Tool lifecycle appends currently commit individually, and per-thread provider-log rotation does not constrain total disk usage across old threads. Cleanup recovery sweeps can also enqueue every due job at once.
Solution
ProviderRuntimeIngestionnow enqueues tool activity commands without awaiting each commit, so its serialized event worker can feed the engine's FIFO batch window. Source-event acknowledgement and checkpoint handoff wait for the activity tickets to commit. The engine batches only contiguous, same-threadtool.started,tool.updated, andtool.completedappends (up to 32); errors, approvals, and turn/message completion boundaries remain immediate. Failed batches fall back to individual dispatch.Validation: formatting, lint, typecheck, and provider lifecycle tests pass. The producer-path regression test verifies six serialized provider events produce a persisted batch. The full workspace suite still times out in two desktop
localDevRebuildtests under parallel load; that file passes when run in isolation.