Give GUI startup auth the TUI's non-blocking IAP treatment - #15344
Draft
warp-agent-staging[bot] wants to merge 1 commit into
Draft
Give GUI startup auth the TUI's non-blocking IAP treatment#15344warp-agent-staging[bot] wants to merge 1 commit into
warp-agent-staging[bot] wants to merge 1 commit into
Conversation
authenticate_user_after_iap_access blocked on an IAP token for every front-end except the TUI. In an Oz cloud sandbox that token comes from a bootstrap JWT that lives ~15-60 minutes; once it expires, the WIF self-mint that would refresh it needs IAP access itself, so the GUI waits forever with no visible signal why (#15342). - Extend startup_auth_is_non_blocking to LaunchMode::App, matching the TUI: authenticate optimistically and let IAP resolve out of band. CommandLine already never reaches this function; Test, RemoteServerProxy, and RemoteServerDaemon are left blocking since nothing shows they hit the same deadlock. - Log a warning when non-blocking startup auth's IAP access ultimately times out, so the log an operator is already reading can tell "IAP never came online" apart from "the key was bad". - Fix the test-warp-ui skill's stale launch check (`provided but IGNORED` never existed in app source) and its wrong env var names (WARP_API_KEY is a non-user key in these sandboxes; TUI_AUTH_KEY holds the usable one).
Contributor
Author
|
This PR was generated with Warp. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Fixes the client-side portion of #15342: the Warp GUI blocks startup auth on an IAP token in
authenticate_user_after_iap_access, which deadlocks once a cloud sandbox's bootstrap JWT expires (~15-60 min in) — the WIF self-mint that would refresh it needs IAP access itself, so a missing token means no login, indefinitely, with no visible signal why.startup_auth_is_non_blockingnow coversLaunchMode::Appin addition toTui: the GUI authenticates optimistically and lets IAP resolve out of band, instead of waiting forever.CommandLinealready never reaches this function (it establishes IAP synchronously in its own dispatch path).Test,RemoteServerProxy, andRemoteServerDaemonare left blocking — nothing in this investigation showed they hit the same deadlock, and widening them without evidence risks masking a real auth failure in a headless/test context.warnwhen IAP access ultimately times out, so the log an operator/agent is already reading can tell "IAP never came online" apart from "the key was bad" (RefreshFailedis already logged per-attempt byIapManageritself).test-warp-uiskill fix. Replaced the stale launch check (provided but IGNOREDdoesn't exist anywhere in the app source, so it always trivially passed) with a check on the actual startup log line (channel: Dev/channel: Localvschannel: Oss). Also fixed the skill's env var guidance:WARP_API_KEYis frequently a non-user (service-account/team) key in an Oz cloud sandbox that the GUI's startup auth rejects;STAGING_USER_WARP_API_KEY(referenced but never actually set in these sandboxes) is replaced withTUI_AUTH_KEY, which does hold a usable user key.Descoped: breaking the WIF-mint deadlock itself
The issue also asks for a way for the WIF self-mint to get a fresh subject token that doesn't itself require IAP, and flags a contradiction: the issue's own verified workaround (
oz federate issue-token ...from a sandbox with a dead bootstrap JWT) working, versus a comment iniap.rsclaiming childozprocesses need to transit IAP.I resolved this empirically in-sandbox rather than guessing:
https://staging.warp.dev/graphql/v2answers real GraphQL responses from this sandbox with no IAP header at all — IAP is not actually gating network access here, matching the issue's own observation.missing authentication credentialserror:resolve_wif_identity_token's minter fallback runs as part of establishing IAP access, before the process has authenticated a user, so there's no bearer token to attach yet.OZ_RUN_IDstampingX-Warp-Cloud-Agent-IDonto the request, which a user key isn't allowed to use) — a warp-server-side authorization issue in a different repo, out of scope for this PR and not something a client-only change can fix.Given that, there's no viable in-band, client-only fix for the mint itself. I'm descoping it here; the remaining piece is server-side (warp-server) work, which I'm reporting back separately rather than stretching this PR into another repo.
Linked Issue
Testing
app/src/lib_tests.rs: extendedstartup_auth_is_non_blocking_only_for_tui(renamedstartup_auth_is_non_blocking_for_gui_and_tui) to assertLaunchMode::Appis now non-blocking alongsideTui, whileCommandLine/Test/RemoteServerProxy/RemoteServerDaemonstay blocking. This is a direct regression test for the widened scope../script/formatandcargo clippy -p warp --bin warp --tests -- -D warningspass clean.cargo test -p warp --lib(targeted + full run) andcargo test -p warp_server_client --lib(existingiaptests, unmodified) pass; the only pre-existing failures inwarp_server_clientare unrelatednsc-binary-missing failures inbase_client/public_apitests, reproducible on an unmodified checkout in this sandbox.cargo build --bin warpsucceeds.End-to-end: built and launched
./target/debug/warpin this cloud sandbox with a user API key (TUI_AUTH_KEY). Reproduced the onboarding-instead-of-terminal symptom first (withOZ_RUN_IDset, "cause 2" 403s as expected — out of scope here). Then, following the issue's own documented workaround (unsetOZ_RUN_ID, supply a freshly-minted IAP token via a shimmedgcloud) to isolate the GUI/IAP behavior from cause 2, the app authenticated in the background and the onboarding wizard led straight into a working terminal — no login screen — where a typed command executed and produced output. See screenshots below.I have manually tested my changes locally (
cargo build --bin warp+ running the resulting binary;./script/runrequires interactive channel-config setup not available in this environment, see PR for details)Screenshots / Videos
The last screenshot below is the target end state: a working, authenticated terminal reached without a login screen, in this cloud sandbox. The earlier ones show the onboarding screen (both the "cause 2" 403 case and, per the issue's own noted caveat, the first-run onboarding wizard that a fresh profile shows regardless of auth state) before the workaround.
Computer-use screenshots (10)
Desktop state after attempting to launch Warp: no application window opened; only the desktop wallpaper and empty Tint2 taskbar are visible, since the warp process panicked and exited immediately before creating any UI.
Warp application window showing the onboarding "Welcome to Warp" screen with a "Get started" button and "Already have an account? Log in" link, instead of an authenticated terminal prompt.
Warp onboarding screen after clicking into the window and typing "echo hello" — no terminal prompt or text input appeared; the screen remains unchanged, showing no evidence of an interactive shell.
The Warp application window showing the onboarding screen with "Welcome to Warp" heading, a "Get started" button, and a "Log in" link — no terminal prompt is present.
Screen 1: Welcome to Warp screen with "Get started" button and "Already have an account? Log in" link.
Screen 2: "Customize your Warp" onboarding screen showing Tab styling, Tools panel, and Code review options, with "Back" and "Next" buttons.
Screen 3: "Choose a theme" onboarding screen with Phenomenon, Dark (selected), Light, Adeberry theme options and "Back"/"Next" buttons.
Screen 4: Terminal session view with "Welcome to terminal mode" tooltip overlay explaining terminal mode, with a "Next" button to continue the tour.
Screen 5: "You're in agent mode" tooltip explaining agent mode conversation, with "Back to terminal" and "Finish" buttons.
Final screen: Terminal session showing the executed command "echo hello-from-verification" with its output "hello-from-verification" displayed, confirming a working authenticated terminal was reached without requiring login.
Agent Mode