Skip to content

feat(cli): Use device approval for remote agent handoffs - #2479

Merged
evanpurkhiser merged 1 commit into
mainfrom
git/feat-cli-use-device-approval-for-remote-agent-handoffs
Nov 24, 2026
Merged

evanpurkhiser merged 1 commit into
mainfrom
git/feat-cli-use-device-approval-for-remote-agent-handoffs

Conversation

@evanpurkhiser

@evanpurkhiser evanpurkhiser commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Cloud agents and browsers on different networks need a way to finish onboarding while the user stays in control of sign-in.

When the handoff claim omits its setup code, use the CLI's existing device flow with the handoff email. Print the approval URL and code for the agent to relay to the user, then continue setup after login succeeds.

Release this CLI change through the installer before Sentry starts omitting the setup code.

@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Nov 24, 2026 12:05am UTC
1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Nov 24, 2026 12:05am UTC

Request Review

test.each([
{ email: "[email protected]", slug: "example-org", accepted: true },
{ email: "[email protected]", slug: "example-org", accepted: false },
{ email: null, slug: "example-org", accepted: false },

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

why would email be null in this case then though?

Comment thread packages/cli/src/lib/agent-handoff.ts Resolved
Comment thread packages/cli/src/lib/agent-handoff.ts Outdated

if (normalizeHttpOrigin(parsed.output.sentryUrl) !== host) {
throw new HostScopeError(
"The handoff response names a different Sentry instance.",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Let's use some less AI-sounding thing here

Suggested change
"The handoff response names a different Sentry instance.",
"The handoff response is for a different Sentry instance.",

@evanpurkhiser
evanpurkhiser force-pushed the git/feat-cli-use-device-approval-for-remote-agent-handoffs branch from a6c6bdf to 72ecbe2 Compare November 23, 2026 23:24
@vercel
vercel Bot temporarily deployed to Preview – sentry-local November 23, 2026 23:24 Inactive

@cursor cursor Bot left a comment

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.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 72ecbe2. Configure here.

Comment thread packages/cli/src/lib/agent-handoff.ts Resolved
Comment thread packages/cli/src/lib/agent-handoff.ts Resolved
@evanpurkhiser
evanpurkhiser force-pushed the git/feat-cli-use-device-approval-for-remote-agent-handoffs branch from 72ecbe2 to 8a2002f Compare November 23, 2026 23:34
@vercel
vercel Bot temporarily deployed to Preview – sentry-local November 23, 2026 23:34 Inactive
@evanpurkhiser
evanpurkhiser force-pushed the git/feat-cli-use-device-approval-for-remote-agent-handoffs branch from 8a2002f to 5f8b53d Compare November 24, 2026 00:05
@vercel
vercel Bot temporarily deployed to Preview – sentry-local November 24, 2026 00:05 Inactive
@evanpurkhiser
evanpurkhiser merged commit ef6d172 into main Nov 24, 2026
28 checks passed
@evanpurkhiser
evanpurkhiser deleted the git/feat-cli-use-device-approval-for-remote-agent-handoffs branch November 24, 2026 01:37
evanpurkhiser added a commit to getsentry/sentry that referenced this pull request Nov 24, 2026
Onboarding handoffs should work when a user and their agent are on
different networks, with the user approving sign-in in their browser.

Matching IPs continue to get a one-time CLI setup code. A mismatch or
missing IP now consumes the handoff and returns the setup context with
the code omitted. Device OAuth owns consent on that path. The prompt
endpoint still accepts the legacy setting during the frontend rollout,
and the claim never uses it to decide whether to mint credentials.

Merge after the compatible stable CLI is available through the installer
linked by the handoff guide.

[Toolkit CLI device approval
PR](getsentry/toolkit#2479)

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – cli — 5f8b53d8 Deployed Nov 24, 2026 by vercel[bot]
Preview – sentry-local — 5f8b53d8 Deployed Nov 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant