Add feature flag, API binding scaffolding for cloud->cloud handoff.#9313
Add feature flag, API binding scaffolding for cloud->cloud handoff.#9313
Conversation
de84226 to
e809b83
Compare
004a070 to
6c976cb
Compare
e809b83 to
c1e697d
Compare
9f26d7d to
7ebd2fc
Compare
c1e697d to
da4fcc6
Compare
73f4edc to
c7794fd
Compare
|
I'm starting a first review of this pull request. You can follow along in the session on Warp. I completed the review and posted feedback on this pull request. Comment I completed the review and posted feedback on this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds disabled cloud-to-cloud handoff scaffolding: a new feature flag/Cargo feature, a typed follow-up API request and path helper, and run/execution-aware accessors that preserve the current flattened ambient task behavior.
Concerns
- The Rust code changes look behavior-preserving and the new API call goes through the existing authenticated public API helper.
- The PR body does not document testing performed; the author should fill that in before merge.
- The added spec has a broken internal spec path reference.
Security
- The added specs include local home-directory worktree paths. Replace them with portable references to avoid exposing local user/path details and to keep the spec usable by other developers.
Verdict
Found: 0 critical, 0 important, 2 suggestions
Approve with nits
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| Cloud Mode ambient conversations currently treat one ambient task/run as one shared-session execution. The first Cloud Mode pane is created as a deferred shared-session viewer in `app/src/terminal/view/ambient_agent/mod.rs:35`; the ambient model emits `SessionReady`, and the viewer manager joins the session. This branch adds the foundation needed to reuse that same terminal view/model for later sessions: `TerminalManager::attach_followup_session` can replace the active viewer `Network` and join a fresh shared session in append mode in `app/src/terminal/shared_session/viewer/terminal_manager.rs:338`. | ||
| The hotswap foundation is documented separately in `specs/REMOTE-1478/TECH.md`. The important shipped boundary is that session IDs are transport-scoped, while the visible ambient conversation, terminal view, terminal model, and task/run identity remain stable across follow-up executions. The event loop already has a follow-up load mode, and `TerminalModel::append_followup_shared_session_scrollback` appends only unknown block IDs instead of replacing the blocklist in `app/src/terminal/shared_session/viewer/event_loop.rs:29`, `app/src/terminal/model/terminal_model.rs:1481`, and `app/src/terminal/model/blocks.rs:759`. | ||
| The remaining client work is broader than a small change. It touches the public API client, ambient task/run data models, ambient spawn/follow-up state transitions, the cloud conversation tombstone, terminal input behavior, and tests. This should be implemented as a stack of mergeable PRs rather than one large PR. | ||
| The server-side public API now exposes `POST /api/v1/agent/runs/{runId}/followups`, which accepts `RunFollowupRequest { message }` and returns an empty success object when the follow-up is accepted. The server contract says clients should observe readiness by fetching `GET /api/v1/agent/runs/{runId}` until the run exposes an active shared session. The route and handler are in `/Users/zachbai/.warp-dev/worktrees/warp-server/cloud-agent-task-name/router/handlers/public_api/agent_webhooks.go:181` and `/Users/zachbai/.warp-dev/worktrees/warp-server/cloud-agent-task-name/router/handlers/public_api/agent_webhooks.go:608`; the OpenAPI schema is in `/Users/zachbai/.warp-dev/worktrees/warp-server/cloud-agent-task-name/public_api/openapi.yaml:644`. |
There was a problem hiding this comment.
💡 [SUGGESTION] [SECURITY] Avoid checking in local worktree paths that include a developer home directory; replace these with repo-relative references, server PR links, or stable source references so the spec is portable and does not expose local user/path details.
There was a problem hiding this comment.
seems like a fine call
| The master cloud-to-cloud handoff plan needs an initial mergeable PR that adds the scaffolding required by later follow-up orchestration and UI work without changing end-user behavior. PR 1 should make the client aware of the `HandoffCloudCloud` rollout boundary, add a typed client method for the server follow-up API, and start isolating task/run identity from execution/session-scoped data in the client model. | ||
| This PR intentionally does not add the tombstone Continue entrypoint, does not submit follow-ups from the UI, and does not attach a follow-up shared session to an existing terminal. Those behaviors belong in later PRs after the foundational APIs exist. | ||
| ## Current state | ||
| The current branch already adds the UI/model layer needed to attach a new backing shared session to an existing shared-session viewer; that foundation is documented in `specs/REMOTE-1478/TECH.md`. The broader sequencing and intended user flow are documented in `specs/handoff-cloud-cloud/TECH.md`. |
There was a problem hiding this comment.
💡 [SUGGESTION] This references specs/handoff-cloud-cloud/TECH.md, but the PR adds the master spec as specs/APP-4318/TECH.md; update the path or add the referenced file.
There was a problem hiding this comment.
Overview
This PR adds disabled cloud-to-cloud handoff scaffolding: the new feature flag, a typed follow-up API client method, run/execution-aware accessors, targeted tests, and tech specs for the stack.
Concerns
- The implementation changes look behavior-preserving and I found no blocking correctness or security issues in the changed code.
- Two added specs still refer to the hotswap/base work as the current branch or point at a spec path that is not present, which can misdirect follow-up implementers.
Verdict
Found: 0 critical, 0 important, 2 suggestions
Approve with nits
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| 13. Steps 5-12 can repeat for additional follow-up executions. | ||
| ## Increment plan | ||
| ### PR 0: shared-session hotswap foundation | ||
| This is the current branch and can stand alone. It keeps reusable viewer resources across networks, adds `attach_followup_session`, adds append-mode scrollback loading, and prevents ambient `SessionEnded` from permanently poisoning the pane. The existing `specs/REMOTE-1478/TECH.md` covers this increment. |
There was a problem hiding this comment.
💡 [SUGGESTION] This branch is PR 1; describe PR 0 as the base hotswap branch so the increment plan stays accurate.
| This is the current branch and can stand alone. It keeps reusable viewer resources across networks, adds `attach_followup_session`, adds append-mode scrollback loading, and prevents ambient `SessionEnded` from permanently poisoning the pane. The existing `specs/REMOTE-1478/TECH.md` covers this increment. | |
| This is the base hotswap foundation branch and can stand alone. It keeps reusable viewer resources across networks, adds `attach_followup_session`, adds append-mode scrollback loading, and prevents ambient `SessionEnded` from permanently poisoning the pane. The existing `specs/REMOTE-1478/TECH.md` covers this increment. |
| The master cloud-to-cloud handoff plan needs an initial mergeable PR that adds the scaffolding required by later follow-up orchestration and UI work without changing end-user behavior. PR 1 should make the client aware of the `HandoffCloudCloud` rollout boundary, add a typed client method for the server follow-up API, and start isolating task/run identity from execution/session-scoped data in the client model. | ||
| This PR intentionally does not add the tombstone Continue entrypoint, does not submit follow-ups from the UI, and does not attach a follow-up shared session to an existing terminal. Those behaviors belong in later PRs after the foundational APIs exist. | ||
| ## Current state | ||
| The current branch already adds the UI/model layer needed to attach a new backing shared session to an existing shared-session viewer; that foundation is documented in `specs/REMOTE-1478/TECH.md`. The broader sequencing and intended user flow are documented in `specs/handoff-cloud-cloud/TECH.md`. |
There was a problem hiding this comment.
💡 [SUGGESTION] Point this PR-specific spec at the master spec this PR adds instead of a path that is not in the diff.
| The current branch already adds the UI/model layer needed to attach a new backing shared session to an existing shared-session viewer; that foundation is documented in `specs/REMOTE-1478/TECH.md`. The broader sequencing and intended user flow are documented in `specs/handoff-cloud-cloud/TECH.md`. | |
| The base branch already adds the UI/model layer needed to attach a new backing shared session to an existing shared-session viewer; that foundation is documented in `specs/REMOTE-1478/TECH.md`. The broader sequencing and intended user flow are documented in `specs/APP-4318/TECH.md`. |
| 5. emit a setup/loading event so the terminal shows the existing Cloud Mode setup UI; | ||
| 6. call the follow-up API; | ||
| 7. poll for the new session; | ||
| 8. emit `FollowupSessionReady { session_id }` when ready; |
There was a problem hiding this comment.
not sure if this is already implemented, but it would probably make sense to have some timeout + error in case it hangs indefinitely
fadd66b to
5b9c748
Compare
c7794fd to
a488b58
Compare
5b9c748 to
873ccb3
Compare
873ccb3 to
ca42aac
Compare
a488b58 to
757d5b5
Compare
757d5b5 to
61b3a3c
Compare
61b3a3c to
9e0ab1e
Compare

Description
Add feature flag and scaffolding for cloud->cloud handoff, incl bindings for follow-up API and abstracting formerly-task-specific public API on AmbientAgentViewModel into getters backed by now-execution-specific data.