Send retained message IDs to server when forking at exchange boundary#11064
Closed
harryalbert wants to merge 1 commit into
Closed
Send retained message IDs to server when forking at exchange boundary#11064harryalbert wants to merge 1 commit into
harryalbert wants to merge 1 commit into
Conversation
When forking a conversation at a specific exchange, the client truncates locally to only include messages up to that exchange. However, the server's ForkConversation endpoint copies the entire GCS conversation data, including exchanges after the fork point. This causes transcript corruption during cloud-to-cloud handoff replay. Fix: Add an optional message_ids field to ForkConversationRequest. When provided, the server truncates each task's messages to only retain those with matching IDs. The client computes the flattened set of retained message IDs from the conversation's exchange structure before calling the server fork endpoint. Changes: - Add message_ids to ForkConversationRequest and AIClient::fork_conversation - Add BlocklistAIHistoryModel::compute_retained_message_ids() helper - Thread message_ids through fork_ai_conversation in workspace/view.rs - Pass None for full forks (handoff, rewind backup) Co-Authored-By: Oz <oz-agent@warp.dev>
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
When forking a conversation at a specific exchange boundary (e.g. "Fork from exact exchange"), the client truncates the conversation locally to only include messages up to that exchange. However, the server's
ForkConversationendpoint copies the entire GCS conversation data — including exchanges after the fork point. This mismatch causes the server-side fork to have more exchanges than the local fork, leading toTaskNotFounderrors and transcript corruption during cloud-to-cloud handoff session sharing replay.This PR adds an optional
message_idsfield to theForkConversationRequest. When the client forks at an exchange boundary, it computes the flattened set of retained message IDs and sends them to the server so the server can truncate its copy to match.Changes
ForkConversationRequest: Added optionalmessage_ids: Option<Vec<String>>field (serialized withskip_serializing_if)AIClient::fork_conversation: Addedmessage_idsparameter to the trait method and implementationBlocklistAIHistoryModel::compute_retained_message_ids: New helper that computes the flat list of message IDs to retain when forking at a specific exchange — mirrors the truncation logic infork_conversation_at_exchangefork_ai_conversation(workspace/view.rs): Computesmessage_ids_for_serverfrom the source conversation before the async server fork callNonesince they copy the entire conversationLinked Issue
ready-to-specorready-to-implement.Testing
Server-side counterpart required to actually truncate. This PR only sends the IDs; the server needs to read and filter them.
./script/runAgent Mode
Conversation: https://staging.warp.dev/conversation/e0c9487c-9002-412e-a111-d9bcc83c1532
Run: https://oz.staging.warp.dev/runs/019e2dae-62d5-7985-b442-bdb183f9508e
This PR was generated with Oz.