Canonicalize local conversation ID mapping to task ID for cloud agent tasks.#10801
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
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 |
b850b7e to
c012060
Compare
There was a problem hiding this comment.
Overview
This PR strengthens canonical local conversation ID selection for cloud/ambient agent conversations, including server-token lookup, restored run IDs, and metadata deduplication.
Concerns
- Manual testing is required for changes that can be manually tested. Please include screenshots or a screen recording that show the cloud/ambient conversation restoration flow working end to end, or justify why manual testing is not possible.
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
c012060 to
5c86e23
Compare

Description
Fixes APP-4460.
There are a host of issues arising from a lack of consistent mapping between conversation ID and task ID in the client. It is currently possible to have multiple local conversations map to the same ambient agent task. In many cases task ID is treated with conversation-like semantics, and we assume that task ID is unique for a given coverastion object.
This PR implements a much stronger 1:1 association between task and coversation ID, though does not go so far as to claim it is an invariant that always holds.
The history model maintains a map of canonical local conversation to server conversation id, which is used in each place where we need to resolve a server conversation id to a local id. Previously we did not consistently use this map, and in certain cases could end up minting new local conversations unnecessarily.
In cases where we end up with multiple local conversation ids mapping to the same ambient task, we could easily end up in a state where the cloud mode pane for a given ambient task assumes conversation ID A is the local conversation ID, while there also exists conversation B which maps to the same task. Then, since conversation ID drives AI block visibility in the agent view, we could end up with an empty looking agent view.