ADE-116: Add cross-machine session handoff#779
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
@copilot review but do not make fixes |
|
Warning Review limit reached
Next review available in: 11 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (9)
📒 Files selected for processing (34)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a6652cd5ae
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| providerSlashCommand, | ||
| forceClaudeUserMessage, | ||
| onDispatched, | ||
| onDispatched: onBackendDispatched ?? onDispatched, |
There was a problem hiding this comment.
Wait for Claude prompt acceptance before completing handoff
In the Claude path this maps awaitBackendDispatch onto the normal onDispatched callback; runClaudeTurn fires that callback when it appends the local user_message, before the Claude SDK has accepted the prompt. When a cross-machine handoff targets Claude and the SDK/query fails immediately afterwards (for example expired auth or startup failure), sendMessage({ awaitBackendDispatch: true }) still resolves and acceptCrossMachineHandoff marks the handoff complete even though the destination turn failed. Please resolve the backend ack only after the provider has accepted the prompt, as the Cursor/Droid paths do.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0a01e75c9e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d276bef4e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const capsule: AgentChatCrossMachineHandoffCapsule = { | ||
| version: 1, | ||
| handoffId, | ||
| createdAt: nowIso(), |
There was a problem hiding this comment.
Capture handoff snapshot time before building the brief
If the source chat receives any event while prepareCrossMachineHandoff is awaiting the brief generation, the capsule is built from the older transcript/artifact snapshot but createdAt is set after that activity. validateCrossMachineSource only rejects transcript entries with timestamp > capsule.createdAt, so final send can approve a stale capsule and continue on another machine without the latest user/assistant turn. Capture the snapshot timestamp before reading the transcript/generating the brief, or compare against the last included event, so mid-prepare activity forces a fresh handoff.
Useful? React with 👍 / 👎.
| }, { awaitBackendDispatch: true }); | ||
|
|
||
| record = { ...record, state: "dispatched", updatedAt: nowIso(), lastError: null }; |
There was a problem hiding this comment.
Make handoff prompt dispatch idempotent across retries
When the destination process dies after the backend has accepted the first handoff prompt but before the dispatched state is persisted, the record remains chat_ready with the deterministic session id. Retrying the same handoff then reuses that session and executes this send again, creating a duplicate first turn even though the UI presents retries as safe. Persist an idempotent prompt marker before dispatch, or skip dispatch when the transcript already contains this crossMachineHandoffId.
Useful? React with 👍 / 👎.
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
|
Deployment failed with the following error: Learn More: https://vercel.com/arul28s-projects?upgradeToPro=build-rate-limit |
|
@codex review |
21c25d4 to
34c54fb
Compare
Fixes ADE-116
Linked Linear issues
Greptile Summary
This PR adds cross-machine chat handoff for ADE sessions. The main changes are:
Confidence Score: 5/5
This PR appears safe to merge based on the reviewed paths.
No blocking correctness or security issues were identified in the changed handoff flow. Previously reported issues around Git token command arguments, unvalidated remote payload spreading, and skipped completion callback are addressed in the current diff.
No files require special attention.
What T-Rex did
Important Files Changed
Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant UI as Source Renderer participant Source as Source ADE Runtime participant Remote as Remote Runtime Bridge participant Dest as Destination ADE Runtime participant Git as Git Origin UI->>Source: prepareCrossMachineHandoff(sourceSessionId, target config) Source->>Git: verify clean published branch/head Source-->>UI: sanitized capsule + fingerprint UI->>Remote: listProjects / getHandoffStoragePreflight Remote->>Dest: projects preflight / clone if needed Dest->>Git: verify destination credentials and branch head Dest-->>UI: destination project + preflight result UI->>Source: validateCrossMachineSource(capsule, fingerprint) Source->>Git: revalidate branch/head and chat activity UI->>Remote: callAction(chat.acceptCrossMachineHandoff) Remote->>Dest: accept capsule under required route kind Dest->>Git: fetch source branch commit Dest->>Dest: import/reuse lane and create handoff chat Dest-->>UI: destination lane/session result UI->>Source: markCrossMachineHandoff(destination details) Source-->>UI: source chat marked complete%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant UI as Source Renderer participant Source as Source ADE Runtime participant Remote as Remote Runtime Bridge participant Dest as Destination ADE Runtime participant Git as Git Origin UI->>Source: prepareCrossMachineHandoff(sourceSessionId, target config) Source->>Git: verify clean published branch/head Source-->>UI: sanitized capsule + fingerprint UI->>Remote: listProjects / getHandoffStoragePreflight Remote->>Dest: projects preflight / clone if needed Dest->>Git: verify destination credentials and branch head Dest-->>UI: destination project + preflight result UI->>Source: validateCrossMachineSource(capsule, fingerprint) Source->>Git: revalidate branch/head and chat activity UI->>Remote: callAction(chat.acceptCrossMachineHandoff) Remote->>Dest: accept capsule under required route kind Dest->>Git: fetch source branch commit Dest->>Dest: import/reuse lane and create handoff chat Dest-->>UI: destination lane/session result UI->>Source: markCrossMachineHandoff(destination details) Source-->>UI: source chat marked completeReviews (6): Last reviewed commit: "ci: refresh handoff secret-scan fingerpr..." | Re-trigger Greptile