Skip to content

feat: retry Cloud Mode initial runs after GitHub auth#10973

Merged
captainsafia merged 5 commits into
masterfrom
safia/app-4458-github-auth-deeplink
May 15, 2026
Merged

feat: retry Cloud Mode initial runs after GitHub auth#10973
captainsafia merged 5 commits into
masterfrom
safia/app-4458-github-auth-deeplink

Conversation

@captainsafia
Copy link
Copy Markdown
Contributor

Description

Implements APP-4458: when an initial Cloud Mode spawn requires GitHub auth, the auth URL now deep-links back into Warp, focuses the Cloud Mode pane, and retries the original initial-run request after auth completes.

This also centralizes GitHub auth redirect URL construction so the environment form and Cloud Mode setup flow share the same redirect-target/source handling.

Linked Issue

Linear: https://linear.app/warpdotdev/issue/APP-4458/deep-link-back-into-warp-after-authenticating-github-from-initial

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Testing

  • cargo fmt
  • cargo test -p warp terminal::view::ambient_agent::model::tests:: --lib
  • cargo test -p warp test_build_auth_url_with_next --lib
  • cargo fmt --check
  • I have manually tested my changes locally with ./script/run

Screenshots / Videos

Demo video: https://www.loom.com/share/ac33da8156eb4949a14575c95209b6b9

Agent Mode

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

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

@cla-bot cla-bot Bot added the cla-signed label May 15, 2026
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 15, 2026

@captainsafia

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR centralizes GitHub auth redirect URL construction and adds Cloud Mode retry handling after GitHub auth completes.

Concerns

  • The added ambient-agent model test helper constructs SpawnAgentRequest without the required snapshot_disabled field, so the test target will not compile against the current request struct.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/terminal/view/ambient_agent/model_tests.rs
captainsafia and others added 4 commits May 14, 2026 18:30
Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
@captainsafia captainsafia force-pushed the safia/app-4458-github-auth-deeplink branch from ef891b5 to 7c1af4a Compare May 15, 2026 01:43
@captainsafia
Copy link
Copy Markdown
Contributor Author

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 15, 2026

@captainsafia

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR centralizes GitHub auth redirect URL construction and adds a Cloud Mode initial-run retry after GitHub auth completes.

Concerns

  • The auth-completed event is broadcast through the singleton notifier to every AmbientAgentViewModel, so one OAuth callback can retry multiple panes that are waiting for GitHub auth instead of only the original/focused pane.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

me.validate_selected_harness(ctx);
});

ctx.subscribe_to_model(&GitHubAuthNotifier::handle(ctx), |me, event, ctx| {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] This subscribes every Cloud Mode pane to a global auth-completed broadcast, so one OAuth callback will retry every pane in NeedsGithubAuth with a cached initial request. Scope the retry to the pane/conversation selected by the deeplink, or carry an auth attempt id through the callback before spawning.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good point. I dunno how likely it is that we'll actually run into a situation where a user has two cloud mode panes pending and executes an auth refresh in one. In that case, it might be surprising for the retry to occur in each pane. It does increase the size of the PR. Curious to hear what folks things about relative value vs. likelihood for this case.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems pretty unlikely, and even if it were to happen I'm not sure its that undesirable. I'm assuming this is the easier approach to take? if so Im fine with it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I thought about it a bit more and I think it might actually be nicer if the retry did trigger on every pane so you didn't have to go and figure out how to recover in every session.

request: Option<SpawnAgentRequest>,

/// Request needed to retry an initial run after GitHub auth completes.
initial_run_retry_request: Option<SpawnAgentRequest>,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this actually need to be stored separately from request?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strictly, no. I thought it would be helpful to separate out the request we retry from the one we persist. But how about I continue a cloud session and change this 😄

Copy link
Copy Markdown
Contributor

@zachbai zachbai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that was quick - thanks for taking this!

Remove the duplicate initial-run retry request field and rely on the existing stored spawn request when retrying after GitHub auth completes.

Co-Authored-By: Oz <oz-agent@warp.dev>
@captainsafia captainsafia merged commit 4c3c95a into master May 15, 2026
25 checks passed
@captainsafia captainsafia deleted the safia/app-4458-github-auth-deeplink branch May 15, 2026 19:37
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.

2 participants