Commit 0ac090c
[REMOTE-1326] Link shared sessions to local interactive Oz runs (#9516)
## 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:**
- 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](https://linear.app/warpdotdev/issue/REMOTE-1326/link-shared-sessions-to-local-interactive-oz-runs).
## 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?
- [x] Does this change rely on a new server API?
- [ ] Is this change enabling the use of a server API on client channels
that rely on the production server?
## Agent Mode
- [x] 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>
---------
Co-authored-by: Oz <oz-agent@warp.dev>1 parent a7279b3 commit 0ac090c
1 file changed
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
| |||
1296 | 1297 | | |
1297 | 1298 | | |
1298 | 1299 | | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
1299 | 1309 | | |
1300 | 1310 | | |
1301 | 1311 | | |
| |||
1484 | 1494 | | |
1485 | 1495 | | |
1486 | 1496 | | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
1487 | 1531 | | |
1488 | 1532 | | |
1489 | 1533 | | |
| |||
0 commit comments