fix: improve register command reliability and error handling#395
fix: improve register command reliability and error handling#395ragurubhaarath merged 15 commits intomainfrom
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…command Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Detect database constraint violation from the API and display a clean user-facing message instead of raw error details. Raw details are still available with --verbose. Also demote ValidateResponseAsync body-level errors to debug so callers control the user-facing message. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… error, correlation ID at warning Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ate failures to errors All post-registration Graph calls (redirect URIs, API permissions) now retry up to 3 times with exponential backoff (2s, 4s, 8s) to handle transient failures like throttling, replication lag, and network blips. Failures are now logged at Error level instead of Warning to prevent silent misconfiguration of Entra apps. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ents-redirect-uris # Conflicts: # src/Microsoft.Agents.A365.DevTools.Cli/Commands/RegisterCommandExecutor.cs
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Improves reliability of the register flow by adding retry/backoff and promoting Graph API misconfiguration from warnings to errors, especially around redirect URIs and API permissions.
Changes:
- Introduce a
RetryHelperand wrap post-registration Graph API mutations with retries. - Add additional redirect URIs for the Public Clients Entra app and improve failure handling/log levels.
- Escalate several Graph API failures from warning to error during redirect URI + permission configuration.
Post-registration Entra app configuration (redirect URIs + API permissions) now runs all independent Graph calls concurrently via Task.WhenAll with ConcurrentBag for thread-safe warning collection. Retry increased to 5 attempts with 3s base delay (max 93s) to match Entra replication patterns. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
- Log full redirect URI count and list instead of singular URI - Add scope name and resource app ID to RemoteProxy permission error message Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… lookups - Remove unnecessary Task.Run wrappers around async I/O operations; extracted to dedicated async methods called directly for parallelism - Split RemoteProxy else-if warning into separate messages for missing redirect URI vs missing ObjectId - Wrap GetOAuth2PermissionScopeIdAsync calls in RetryHelper for transient failure resilience - Extract AddPpmiPermissionAsync for reuse across A365 and PublicClients apps Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
RetryHelper throws RetryExhaustedException when shouldRetry keeps returning true and the final result is null. For Guid? scope lookups this caused an unhandled crash instead of a graceful warning. Replaced shouldRetry-based retry with exception-only overload wrapped in try/catch for both PPMI and remote scope lookups. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pass context.GetCancellationToken() from DevelopMcpCommand SetHandler through ExecuteAsync, ConfigureEntraAppsAsync, and all helper methods to RetryHelper. Ctrl+C now cancels in-flight retries instead of burning through all 5 attempts (up to 93s). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Scope lookups can return null due to Entra replication lag after app creation. Re-added shouldRetry predicate (result => !result.HasValue) while keeping try/catch for RetryExhaustedException when scope truly does not exist after all retries. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
ValidateResponseAsyncbody-level errors to debug so callers control the user-facing messageTest plan
🤖 Generated with Claude Code