Skip to content

fix bug where the agent view was empty when joining shared sessions#10670

Merged
harryalbert merged 4 commits into
masterfrom
harry/fix-empty-blocklist-session-sharing-bug
May 11, 2026
Merged

fix bug where the agent view was empty when joining shared sessions#10670
harryalbert merged 4 commits into
masterfrom
harry/fix-empty-blocklist-session-sharing-bug

Conversation

@harryalbert
Copy link
Copy Markdown
Contributor

@harryalbert harryalbert commented May 11, 2026

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:

  1. AgentResponseEvent::Initon_shared_init creates an exchange with the optimistic root task ID → AppendedExchange event emitted (deferred)
  2. AgentResponseEvent::ClientActionsapply_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

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

Screenshots / Videos

https://www.loom.com/share/5ae0c49e08ef4d79989a58409e1ecae9

Agent Mode

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

CHANGELOG-BUG-FIX: Fixed a bug where cloud conversations were sometimes empty on-join.

@cla-bot cla-bot Bot added the cla-signed label May 11, 2026
Copy link
Copy Markdown
Contributor Author

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

@harryalbert harryalbert force-pushed the harry/fix-empty-blocklist-session-sharing-bug branch from 977af36 to 9300d3f Compare May 11, 2026 21:14
@harryalbert harryalbert marked this pull request as ready for review May 11, 2026 21:28
@harryalbert harryalbert requested review from liliwilson and zachbai May 11, 2026 21:28
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 11, 2026

@harryalbert

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

@harryalbert harryalbert changed the title fix bug where the agnet view was empty when joining shared sessoins fix bug where the agent view was empty when joining shared sessions May 11, 2026
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 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::get now changes exact lookup semantics: a removed old root ID can resolve to the replacement task. That conflicts with the existing set_root_task contract/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

Comment thread app/src/ai/agent/task_store.rs
Comment thread app/src/ai/agent/task_store.rs Outdated
Comment thread app/src/ai/agent/task_store.rs Outdated
@harryalbert harryalbert enabled auto-merge (squash) May 11, 2026 21:44
@harryalbert harryalbert merged commit a75cfe0 into master May 11, 2026
25 of 26 checks passed
@harryalbert harryalbert deleted the harry/fix-empty-blocklist-session-sharing-bug branch May 11, 2026 22:07
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.
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.

3 participants