Skip to content

Fix a number of bugs that lead to duplicate requests on shared session load. - #15829

Open
vorporeal wants to merge 6 commits into
masterfrom
david/fix-duplicate-requests-on-wasm-session-load
Open

Fix a number of bugs that lead to duplicate requests on shared session load.#15829
vorporeal wants to merge 6 commits into
masterfrom
david/fix-duplicate-requests-on-wasm-session-load

Conversation

@vorporeal

@vorporeal vorporeal commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Description

Loading an agent shared session in the WASM client could issue many equivalent requests while reconstructing the session. A captured page load included 37 identical ancestor-list requests, 4–5 detail requests per run, and 9 identical conversation-metadata requests.

Several load-time events could re-enter these request paths before their first asynchronous response updated local state. Historical exchange replay also caused each completed exchange to attempt the same conversation-level metadata fetch.

This change coalesces requests at the narrowest existing ownership points:

  • Track ancestor seed and task-harness requests while they are in progress.
  • Emit seeded child events only for newly discovered runs.
  • Make the legacy viewer metadata-fetch set act as an in-flight guard.
  • Track conversation metadata requests per conversation until completion.

The task-harness path keeps its direct server request. The shared task cache does not provide request-specific completion callbacks or explicit freshness semantics, so using it here would expand the change and could return stale task state.

Each commit contains one independent fix to simplify review.

Linked Issue

No linked issue.

  • The linked issue is labeled ready-to-spec or ready-to-implement. — No linked issue.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes). — Not applicable; this PR changes request coordination only.

Testing

  • cargo fmt -p warp -- --check

  • cargo check -p warp

  • No automated tests were added. These changes add narrow in-flight guards to existing request paths.

  • Manual validation is pending. The planned check is to reload the same shared session and compare a new HAR with the original request counts.

  • I have manually tested my changes locally with ./script/run — Pending HAR-based validation in the WASM client.

Agent Mode

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

CHANGELOG-BUG-FIX: Fixed duplicate network requests when loading agent shared sessions.

vorporeal and others added 5 commits September 4, 2026 19:32
Co-Authored-By: Warp <agent@warp.dev>
Co-Authored-By: Warp <agent@warp.dev>
Co-Authored-By: Warp <agent@warp.dev>
Co-Authored-By: Warp <agent@warp.dev>
Co-Authored-By: Warp <agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

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

@vorporeal
vorporeal marked this pull request as ready for review September 5, 2026 00:19
@warp-for-oss

warp-for-oss Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

@vorporeal

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 /warp-agent-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

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

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.

Overview

This PR adds in-flight guards to coalesce duplicate shared-session load requests across server metadata fetches, ancestor seed fetches, task harness fetches, and legacy viewer metadata fetches.

Concerns

  • The request-deduplication regression is not covered by automated tests, and the PR description says manual HAR validation is still pending. These paths are model-level and already have nearby test hooks, so this should have a regression test before merge.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

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

Powered by Oz

return;
}
self.metadata_fetches.insert(task_id);
if !self.metadata_fetches.insert(task_id) {

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] This bug fix is reachable at the model level and metadata_fetch_dispatch_count is already available below, but the PR adds no regression test for duplicate triggers before the first request completes. Please add coverage that calls this path twice before completion and asserts only one metadata request is dispatched.

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.

added tests

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.

1 participant