Skip to content

[REMOTE-1326] Link shared sessions to local interactive Oz runs#9516

Draft
jasonkeung wants to merge 6 commits intomasterfrom
jason/remote-1326-link-shared-sessions-to-local-interactive-oz-runs
Draft

[REMOTE-1326] Link shared sessions to local interactive Oz runs#9516
jasonkeung wants to merge 6 commits intomasterfrom
jason/remote-1326-link-shared-sessions-to-local-interactive-oz-runs

Conversation

@jasonkeung
Copy link
Copy Markdown

@jasonkeung jasonkeung commented Apr 29, 2026

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:

  • Added a LinkSharedSessionToLocalOzRun feature flag (enabled in dogfood builds).
  • In TerminalManager, when a shared session is created successfully, the Oz task ID is resolved from the active conversation's task_id (set when the first StreamInit response arrives). If found, update_agent_task is called to associate the shared session ID with the Oz run.
  • In the Oz webapp, the "View session" button links to the conversation, which then redirects to the session if there is one that is active.

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 of run_internal, while the prompt is dispatched at step 5). This means active_conversation() returns None at 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 from BlocklistAIController.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

  • Is this change necessary to make the client compatible with a desired server API breaking change?
  • Does this change rely on a new server API?
    • The use of the shared_session_id field on update_agent_task is restricted to dogfood builds via the LinkSharedSessionToLocalOzRun feature flag.
  • Is this change enabling the use of a server API on client channels that rely on the production server?

Agent Mode

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

Changelog Entries for Stable

Co-Authored-By: Oz oz-agent@warp.dev

jasonkeung and others added 4 commits April 29, 2026 15:23
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>
@cla-bot cla-bot Bot added the cla-signed label Apr 29, 2026
jasonkeung and others added 2 commits April 29, 2026 19:47
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
@jasonkeung jasonkeung requested a review from abhishekp106 April 30, 2026 00:07
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.

1 participant