Skip to content

chore(auth): diagnose unexpected managed OAuth callback failures - #7896

Merged
icecrasher321 merged 1 commit into
stagingfrom
codex/github-oauth-diagnostics
Sep 16, 2026
Merged

icecrasher321 merged 1 commit into
stagingfrom
codex/github-oauth-diagnostics

Conversation

@icecrasher321

Copy link
Copy Markdown
Collaborator

GitHub Search account connections on dev fail in both the installation setup and individual enrollment paths, but the callback currently records only errorClass: unexpected. This hides the distinction between session authentication, enrollment authentication, and authorization completion failures.

Add the failing callback stage, an allowlisted underlying error type, a message fingerprint, and a bounded database error code to unexpected-error diagnostics. Reuse the shared cause-chain describer; raw messages, SQL parameters, provider responses, and credentials are not logged. Tests cover wrapped database errors, arbitrary private error metadata, and both installation callback stages.

This is a diagnostic change. It needs a dev deployment and another connection attempt before the underlying authorization failure can be identified.

Validation: 52 focused callback/redirect tests passed; app type check, API validation audit, Biome, and diff checks passed.

@vercel

vercel Bot commented Sep 16, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 16, 2026 10:36pm UTC

Request Review

@icecrasher321
icecrasher321 marked this pull request as ready for review September 16, 2026 22:36

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no actionable correctness, security, or repository-rule failures remain.

Summary

This PR adds bounded diagnostics for unexpected managed OAuth callback failures without logging raw error messages or arbitrary metadata.

  • Distinguishes session authentication, setup completion, enrollment authentication, and enrollment completion stages.
  • Reports an allowlisted deepest-cause type, a truncated message fingerprint, and a constrained database error code.
  • Adds coverage for wrapped database failures, private metadata, and both installation callback stages.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
    Callback[Managed OAuth callback] --> Setup{Installation setup?}
    Setup -->|Yes| Session[Session authentication]
    Session --> SetupCompletion[Setup completion]
    Setup -->|No| EnrollmentAuth[Enrollment authentication]
    EnrollmentAuth --> EnrollmentCompletion[Enrollment completion]
    Session -->|Unexpected failure| Diagnostic[Bounded diagnostic]
    SetupCompletion -->|Unexpected failure| Diagnostic
    EnrollmentAuth -->|Unexpected failure| Diagnostic
    EnrollmentCompletion -->|Unexpected failure| Diagnostic
    Diagnostic --> Fields[Stage, allowlisted error type, fingerprint, optional database code]
    Fields --> Redirect[Failure redirect]
Loading

Reviews (1) · Last reviewed commit: "chore(auth): diagnose unexpected managed..."

@icecrasher321
icecrasher321 merged commit 294de5f into staging Sep 16, 2026
33 checks passed
@icecrasher321
icecrasher321 deleted the codex/github-oauth-diagnostics branch September 16, 2026 22:40

This branch was previously deployed

1 inactive deployment
Preview 012afd1c Deployed Sep 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant