Skip to content

Make OAuth callback failure and resume outcomes durable #840

Open

Description

@dcramer

Problem

OAuth callback outcomes do not consistently transition the blocked Slack turn.

  • MCP error=access_denied returns HTML without resolving the auth attempt, pending-auth state, or awaiting turn record.
  • Generic OAuth deletes callback state on provider error but leaves pending-auth/turn state unresolved.
  • Successful callbacks store credentials synchronously, then resume Slack through best-effort waitUntil work. The browser can report success even when the original request is never durably scheduled.
  • Duplicate callbacks can race token exchange and return inconsistent results.

Acceptance criteria

  • Callback state is atomically claimed before token exchange.
  • Duplicate completed callbacks return a stable, safe result.
  • Declined, expired, provider-error, exchange-failed, and scope-incomplete callbacks transition pending auth and the turn-session record.
  • Terminal callback outcomes produce an actionable private/Slack-visible result without exposing auth URLs or provider secrets.
  • Successful callbacks durably enqueue continuation before returning that the request is being processed.
  • Resume dispatch is idempotent and retryable.
  • Transient token-exchange failures have a bounded retry or recoverable attempt state.
  • Integration tests cover denial, expiry, duplicate delivery, callback retry, queue failure, and resume retry.

Related: #782.

Activity

  1. added
    bug
    on Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions