[REMOTE-1326] Link shared sessions to local interactive Oz runs#9516
Draft
jasonkeung wants to merge 6 commits intomasterfrom
Draft
[REMOTE-1326] Link shared sessions to local interactive Oz runs#9516jasonkeung wants to merge 6 commits intomasterfrom
jasonkeung wants to merge 6 commits intomasterfrom
Conversation
Remove verbose info-level logs added during development (opening 'looking up task id' trace, 'linking session to task' trace, and success confirmation). Simplify the match to an if-let and drop the source-tracking variable that was only used for logging. The one remaining log::warn! on API failure is kept. Co-Authored-By: Oz <oz-agent@warp.dev>
Remove the ambient_agent_task_id() getter from BlocklistAIController and simplify the LinkSharedSessionToLocalOzRun block in terminal_manager to resolve task_id solely from the active conversation's task_id(). The controller getter is unnecessary for in-app interactive runs where the conversation already exists at session-share time. Co-Authored-By: Oz <oz-agent@warp.dev>
…ink-shared-sessions-to-local-interactive-oz-runs
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 Warp starts a shared agent session, we now link that shared session to the associated Oz run on the server. This enables the Oz run record to carry the replay session ID, so the session can be surfaced alongside the run.
How it works:
LinkSharedSessionToLocalOzRunfeature flag (enabled in dogfood builds).TerminalManager, when a shared session is created successfully, the Oz task ID is resolved from the active conversation'stask_id(set when the firstStreamInitresponse arrives). If found,update_agent_taskis called to associate the shared session ID with the Oz run.Note on CLI agent runs (
warp agent run):In the CLI agent driver, the shared session is established before the first AI prompt is sent (
wait_for_session_shared()completes at step 3 ofrun_internal, while the prompt is dispatched at step 5). This meansactive_conversation()returnsNoneat link time and the session-to-task link is silently skipped for this path. A follow-up will address linking for CLI agent runs — possible approaches include deferring the link call until after the first prompt is sent, or re-introducing a read fromBlocklistAIController.ambient_agent_task_id(which the driver sets before sharing begins).Implements REMOTE-1326.
Testing
Tested manually by running an in-app Oz agent session, sharing the terminal, and verifying the resulting Oz task record on the server has the shared session ID populated.
No automated tests added: the linking path requires a live server round-trip (shared session creation +
update_agent_task) and the happy-path success is silent by design; only failures are logged.Server API dependencies
shared_session_idfield onupdate_agent_taskis restricted to dogfood builds via theLinkSharedSessionToLocalOzRunfeature flag.Agent Mode
Changelog Entries for Stable
Co-Authored-By: Oz oz-agent@warp.dev