Skip to content

[3/5] Reduce duplicate remote codebase index status pushes#11093

Open
moirahuang wants to merge 2 commits into
moira/remote-codebase-indexing-telemetryfrom
moira/reduce-duplicate-status-pushes
Open

[3/5] Reduce duplicate remote codebase index status pushes#11093
moirahuang wants to merge 2 commits into
moira/remote-codebase-indexing-telemetryfrom
moira/reduce-duplicate-status-pushes

Conversation

@moirahuang
Copy link
Copy Markdown
Contributor

@moirahuang moirahuang commented May 16, 2026

Description

Reduces duplicate codebase indexing notifications by 1) updating push_all_codebase_index_statuses to instead only push for 1 repo as push_codebase_index_status_update 2) dedupe on the status sent

Testing

Added unit tests + locally tested

  • I have manually tested my changes locally with ./script/run

Screenshots / Videos

https://www.loom.com/share/d20fe6af4a2e40acbbf0fb8f2194aeaa

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

@cla-bot cla-bot Bot added the cla-signed label May 16, 2026
@moirahuang moirahuang changed the title Reduce duplicate remote codebase index status pushes [1/3] Reduce duplicate remote codebase index status pushes May 16, 2026
@moirahuang moirahuang marked this pull request as ready for review May 16, 2026 05:00
@moirahuang moirahuang requested a review from kevinyang372 May 16, 2026 05:00
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 16, 2026

@moirahuang

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

/// state again, while all three events serialize to the same remote
/// `Stale` status. This cache keeps that internal event fan-out from
/// becoming duplicate remote pushes.
last_pushed_codebase_index_statuses: HashMap<String, CodebaseIndexStatusPushKey>,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here i thought about if we can avoid emitting multiple events that are triggering the logs but since each of the events are important, i landed on it being better to dedupe so we only log once per change

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main thing I think that's worth thinking through here is whether this dedupe logic should actually live in the codebase index manager layer rather than the server model

Like should we instead check if the codebase index state has changed in the manager before emitting SyncStateUpdated? That will better solve this case but prevent other unnecessary re-rendering cases when the state actually hasn't changed too

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR changes codebase indexing events so remote status pushes are per-repo and deduplicated by semantic status rather than timestamp. The supplemental security pass did not identify security concerns.

Concerns

  • The Code settings page still only reacts to SyncStateUpdated, so it misses newly created local codebase indexes now that creation emits NewIndexCreated.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz


ctx.subscribe_to_model(&index_manager, |me, index, event, ctx| {
if let CodebaseIndexManagerEvent::SyncStateUpdated = event {
if let CodebaseIndexManagerEvent::SyncStateUpdated { .. } = event {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] index_directory now emits NewIndexCreated instead of SyncStateUpdated, so this page no longer resizes/notifies when a new local codebase appears. Include NewIndexCreated { .. } here as well.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems valid?

@moirahuang moirahuang changed the title [1/3] Reduce duplicate remote codebase index status pushes [3/5] Reduce duplicate remote codebase index status pushes May 16, 2026
@moirahuang moirahuang force-pushed the moira/reduce-duplicate-status-pushes branch from a5a05f9 to a103d4c Compare May 16, 2026 05:29
@moirahuang moirahuang force-pushed the moira/remote-codebase-indexing-telemetry branch from 2d7fd80 to 382a3af Compare May 16, 2026 05:29
Copy link
Copy Markdown
Contributor Author

moirahuang commented May 16, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@moirahuang moirahuang force-pushed the moira/remote-codebase-indexing-telemetry branch from 382a3af to ad36bb2 Compare May 16, 2026 05:41
@moirahuang moirahuang force-pushed the moira/reduce-duplicate-status-pushes branch from a103d4c to 3dce8a8 Compare May 16, 2026 05:41
@moirahuang moirahuang force-pushed the moira/reduce-duplicate-status-pushes branch from 3dce8a8 to ddfaa78 Compare May 16, 2026 07:21
@moirahuang moirahuang force-pushed the moira/remote-codebase-indexing-telemetry branch from ad36bb2 to 2add2fe Compare May 16, 2026 07:21
moirahuang and others added 2 commits May 16, 2026 00:33
@moirahuang moirahuang force-pushed the moira/remote-codebase-indexing-telemetry branch from 2add2fe to 7b397d9 Compare May 16, 2026 07:36
@moirahuang moirahuang force-pushed the moira/reduce-duplicate-status-pushes branch from ddfaa78 to 8e1987d Compare May 16, 2026 07:36
Copy link
Copy Markdown
Member

@kevinyang372 kevinyang372 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving to unblock


ctx.subscribe_to_model(&index_manager, |me, index, event, ctx| {
if let CodebaseIndexManagerEvent::SyncStateUpdated = event {
if let CodebaseIndexManagerEvent::SyncStateUpdated { .. } = event {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems valid?

/// state again, while all three events serialize to the same remote
/// `Stale` status. This cache keeps that internal event fan-out from
/// becoming duplicate remote pushes.
last_pushed_codebase_index_statuses: HashMap<String, CodebaseIndexStatusPushKey>,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main thing I think that's worth thinking through here is whether this dedupe logic should actually live in the codebase index manager layer rather than the server model

Like should we instead check if the codebase index state has changed in the manager before emitting SyncStateUpdated? That will better solve this case but prevent other unnecessary re-rendering cases when the state actually hasn't changed too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants