feat: enrich oauth login failure telemetry for diagnosis#501
Merged
Conversation
On OAuth callback failure the wizard captured a generic exception with no context, and the resulting Error Tracking issues fragmented across each user's install path in the stack trace, so the same failure showed up as many low-signal issues. Attach oauth_error_code, client_id, and requested_scopes, and set a stable $exception_fingerprint (wizard_oauth_<code>) so failures of the same kind collapse into one alertable issue. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Results will be posted here when complete. |
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.
Problem
On OAuth login failure the wizard captured a generic exception with no context beyond the error message. Because the stack trace includes each user's install path (local source checkout, npx cache, bundled
dist), the same underlying failure fragmented into many separate Error Tracking issues, with each failed run reporting as a new anonymous user. That made OAuth failures hard to triage and impossible to alert on cleanly.This matters because the platform's per-app OAuth scope ceiling can reject the wizard's requested scopes at
/authorizewithinvalid_scopewhen an app's ceiling isn't seeded with everything the wizard asks for. When that happens, the wizard is the failing client but the telemetry doesn't say which client, which scopes, or why.Changes
In
performOAuthFlow's failure path, attachoauth_error_code(parsed from the callbackerror),client_id, andrequested_scopesto the captured exception, and set a stable$exception_fingerprint(wizard_oauth_<code>) so failures of the same kind collapse into one issue regardless of where the wizard is installed. No change to the auth flow itself.Test plan
pnpm build(typecheck + smoke test) andpnpm testpass;pnpm fixclean.captureExceptioncall in the catch block; no new control flow.Related
LLM context
Authored by Claude Code (Opus 4.8) as follow-up observability, paired with the server-side log linked above.
regionwas intentionally not added (the wizard can't know it until after auth succeeds, and this fires pre-auth); the runbook link rides on the downstream alert rather than being hardcoded into source.