fix bug where the agent view was empty when joining shared sessions#10670
Merged
harryalbert merged 4 commits intoMay 11, 2026
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
977af36 to
9300d3f
Compare
Contributor
|
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 Powered by Oz |
Contributor
There was a problem hiding this comment.
Overview
This PR adds an upgraded root-task ID alias so deferred shared-session events can resolve after the optimistic root task is replaced by the server task.
Concerns
TaskStore::getnow changes exact lookup semantics: a removed old root ID can resolve to the replacement task. That conflicts with the existingset_root_taskcontract/tests and can make unrelated callers treat a stale task ID as present.
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
zachbai
approved these changes
May 11, 2026
liliwilson
approved these changes
May 11, 2026
cephalonaut
pushed a commit
that referenced
this pull request
May 12, 2026
…10670) ## Description <!-- Please remember to add your design buddy onto the PR for review, if it contains any UI changes! --> There was a bug where, when opening an in-progress cloud conversation from the shared session link, the conversation would sometimes be completely empty. The root cause here is was a race condition in the event loop, triggered by a change from last week to optimistically create the shared conversation's task Id in `on_shared_init`. The race is as follows: 1. `AgentResponseEvent::Init` → `on_shared_init` creates an exchange with the optimistic root task ID → `AppendedExchange` event emitted (deferred) 2. `AgentResponseEvent::ClientActions` → `apply_client_actions` processes `CreateTask` → replaces the optimistic root task with a server-assigned task that has a different ID (`conversation.rs:2253-2280`) 3. Deferred events dispatch → `AppendedExchange` handler runs → `conversation.get_task(optimistic_id)` returns None → AI block is never inserted → pane is blank ## Testing <!-- How did you test this change? What automated tests did you add? If you didn't add any new tests, what's your justification for not adding any? Manual testing is required for changes that can be manually tested, and almost all changes can be manually tested. If your change can be manually tested, please include screenshots or a screen recording that show it working end to end. You can run the app locally using `./script/run` - see WARP.md for more details on how to get set up. --> - [x] I have manually tested my changes locally with `./script/run` ### Screenshots / Videos <!-- Attach screenshots or a short video demonstrating the change, where appropriate. Remove this section if it is not relevant to your PR. --> https://www.loom.com/share/5ae0c49e08ef4d79989a58409e1ecae9 ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode <!-- ## Changelog Entries for Stable The entries below will be used when constructing a soft-copy of the stable release changelog. Leave blank or remove the lines if no entry in the stable changelog is needed. Entries should be on the same line, without the `{{` `}}` brackets. You can use multiple lines, even of the same type. The valid suffixes are: - NEW-FEATURE: for new, relatively sizable features. Features listed here will likely have docs / social media posts / marketing launches associated with them, so use sparingly. - IMPROVEMENT: for new functionality of existing features. - BUG-FIX: for fixes related to known bugs or regressions. - IMAGE: the image specified by the URL (hosted on GCP) will be added to Dev & Preview releases. For Stable releases, see the pinned doc in the #release Slack channel. - OZ: Oz-related updates. Use `CHANGELOG-OZ`. At most 4 Oz updates are shown in-app per release. CHANGELOG-NEW-FEATURE: {{text goes here...}} CHANGELOG-IMPROVEMENT: {{text goes here...}} CHANGELOG-BUG-FIX: {{text goes here...}} CHANGELOG-BUG-FIX: {{more text goes here...}} CHANGELOG-IMAGE: {{GCP-hosted URL goes here...}} CHANGELOG-OZ: {{text goes here...}} --> CHANGELOG-BUG-FIX: Fixed a bug where cloud conversations were sometimes empty on-join.
dagmfactory
pushed a commit
that referenced
this pull request
May 12, 2026
…10670) ## Description <!-- Please remember to add your design buddy onto the PR for review, if it contains any UI changes! --> There was a bug where, when opening an in-progress cloud conversation from the shared session link, the conversation would sometimes be completely empty. The root cause here is was a race condition in the event loop, triggered by a change from last week to optimistically create the shared conversation's task Id in `on_shared_init`. The race is as follows: 1. `AgentResponseEvent::Init` → `on_shared_init` creates an exchange with the optimistic root task ID → `AppendedExchange` event emitted (deferred) 2. `AgentResponseEvent::ClientActions` → `apply_client_actions` processes `CreateTask` → replaces the optimistic root task with a server-assigned task that has a different ID (`conversation.rs:2253-2280`) 3. Deferred events dispatch → `AppendedExchange` handler runs → `conversation.get_task(optimistic_id)` returns None → AI block is never inserted → pane is blank ## Testing <!-- How did you test this change? What automated tests did you add? If you didn't add any new tests, what's your justification for not adding any? Manual testing is required for changes that can be manually tested, and almost all changes can be manually tested. If your change can be manually tested, please include screenshots or a screen recording that show it working end to end. You can run the app locally using `./script/run` - see WARP.md for more details on how to get set up. --> - [x] I have manually tested my changes locally with `./script/run` ### Screenshots / Videos <!-- Attach screenshots or a short video demonstrating the change, where appropriate. Remove this section if it is not relevant to your PR. --> https://www.loom.com/share/5ae0c49e08ef4d79989a58409e1ecae9 ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode <!-- ## Changelog Entries for Stable The entries below will be used when constructing a soft-copy of the stable release changelog. Leave blank or remove the lines if no entry in the stable changelog is needed. Entries should be on the same line, without the `{{` `}}` brackets. You can use multiple lines, even of the same type. The valid suffixes are: - NEW-FEATURE: for new, relatively sizable features. Features listed here will likely have docs / social media posts / marketing launches associated with them, so use sparingly. - IMPROVEMENT: for new functionality of existing features. - BUG-FIX: for fixes related to known bugs or regressions. - IMAGE: the image specified by the URL (hosted on GCP) will be added to Dev & Preview releases. For Stable releases, see the pinned doc in the #release Slack channel. - OZ: Oz-related updates. Use `CHANGELOG-OZ`. At most 4 Oz updates are shown in-app per release. CHANGELOG-NEW-FEATURE: {{text goes here...}} CHANGELOG-IMPROVEMENT: {{text goes here...}} CHANGELOG-BUG-FIX: {{text goes here...}} CHANGELOG-BUG-FIX: {{more text goes here...}} CHANGELOG-IMAGE: {{GCP-hosted URL goes here...}} CHANGELOG-OZ: {{text goes here...}} --> CHANGELOG-BUG-FIX: Fixed a bug where cloud conversations were sometimes empty on-join.
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.

Description
There was a bug where, when opening an in-progress cloud conversation from the shared session link, the conversation would sometimes be completely empty.
The root cause here is was a race condition in the event loop, triggered by a change from last week to optimistically create the shared conversation's task Id in
on_shared_init. The race is as follows:AgentResponseEvent::Init→on_shared_initcreates an exchange with the optimistic root task ID →AppendedExchangeevent emitted (deferred)AgentResponseEvent::ClientActions→apply_client_actionsprocessesCreateTask→ replaces the optimistic root task with a server-assigned task that has a different ID (conversation.rs:2253-2280)AppendedExchangehandler runs →conversation.get_task(optimistic_id)returns None → AI block is never inserted → pane is blankTesting
./script/runScreenshots / Videos
https://www.loom.com/share/5ae0c49e08ef4d79989a58409e1ecae9
Agent Mode
CHANGELOG-BUG-FIX: Fixed a bug where cloud conversations were sometimes empty on-join.