Fix missing Continue button for API-triggered Claude Code cloud runs (REMOTE-2206)#13903
Draft
seemeroland wants to merge 1 commit into
Draft
Fix missing Continue button for API-triggered Claude Code cloud runs (REMOTE-2206)#13903seemeroland wants to merge 1 commit into
seemeroland wants to merge 1 commit into
Conversation
For Claude Code runs started via the Oz REST API (not the Warp desktop
app), no local Oz conversation is ever created, so ConversationServerTokenAssigned
never fires and get_server_conversation_metadata_by_server_token returns None.
The existing fallback (task_creator_access) only grants Edit access when
task.creator.uid matches the logged-in Firebase UID, but API runs can be
created by service-account API keys whose UID differs from the viewer's
Firebase UID. This leaves access as Unknown, so the tombstone resolver
falls back to Tombstone { cta: None } — the 'Continue' button never
appears after sandbox idle timeout.
Fix: in BlocklistAIHistoryModel, add
fetch_server_conversation_metadata_if_needed. This kicks off a background
list_ai_conversation_metadata request and stores the result in
all_conversations_metadata keyed by the server token. On success it emits
UpdatedConversationMetadata, which re-triggers
maybe_insert_tombstone_for_non_running_shared_ambient_task in TerminalView.
The tombstone then re-resolves via the server metadata path (instead of
the creator-UID fallback), using the conversation's actual access grants to
show the Continue CTA.
Call this from maybe_insert_tombstone_for_non_running_shared_ambient_task
whenever the task has a conversation_id but no metadata in the model.
Deduplication prevents redundant in-flight fetches.
Add a test that verifies the end-to-end fix: a Claude Code run created by
a service-account API key (creator UID ≠ current user) initially returns
MissingServerConversationMetadata, then shows ContinueInCloud once
the fetched metadata (with the current user as space owner) is stored.
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
Fixes the missing "Continue" button for Claude Code cloud runs started via the Oz REST API after sandbox idle timeout.
Root cause: For Claude Code runs started via API (not from the Warp desktop app), no local Oz conversation is ever created. This means
ConversationServerTokenAssignednever fires, andget_server_conversation_metadata_by_server_tokenalways returnsNone. The existing fallback checkstask.creator.uid == current_user_uid, but for API-triggered runs created with service-account API keys, these UIDs can differ — leavingaccess = Unknownand the tombstone resolver returningTombstone { cta: None }(no Continue button).Fix:
BlocklistAIHistoryModel::fetch_server_conversation_metadata_if_needed— new method that starts a backgroundlist_ai_conversation_metadatarequest for the conversation token when no metadata is cached. On success it stores the result inall_conversations_metadataand emitsUpdatedConversationMetadata. Concurrent calls for the same token are no-ops while a fetch is in-flight.TerminalView::maybe_insert_tombstone_for_non_running_shared_ambient_task— now calls the new method whenever the task has aconversation_idbut no server metadata is in the model. When the fetch completes,UpdatedConversationMetadatare-triggers this function, which re-resolves the tombstone CTA using the server-supplied access grants — correctly showing the "Continue" button for run owners.Linked Issue
Testing
Added
api_triggered_third_party_run_shows_continue_cta_after_metadata_fetch— a unit test that:creator.uidis a service-account UID (≠ current user's Firebase UID), reproducing the API-trigger scenario.MissingServerConversationMetadata(no CTA).insert_server_metadata_for_testtest helper.Tombstone { cta: Some(ContinueInCloud { .. }) }../script/runConversation: https://staging.warp.dev/conversation/aac448c1-51c3-47a4-98bd-390462e16d56
Run: https://oz.staging.warp.dev/runs/019f7177-66c8-7b02-83f8-3870a6344b83
This PR was generated with Oz.