Fail fast on deploy integration auth errors#115
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughconnectIntegrations now captures isConnected errors, classifies 401/403 as auth failures, logs them, records a failed outcome for the provider, and skips prompting or connect attempts. requestJson throws dedicated 401/403 messages and isIntegrationAuthFailure detects auth-related failures. Tests added to cover this flow. ChangesIntegration Auth Failure Handling
Estimated Code Review Effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/deploy/src/connect.test.ts`:
- Around line 105-143: The test currently only checks that connect() wasn't
called but doesn't explicitly assert that no prompt was shown; after calling
connectIntegrations and alongside the existing assertions, add an explicit
assertion that the buffered IO emitted no confirm prompts (i.e., assert that io
recorded zero confirm calls or that io.messages contains no confirm-type
entries) so the test fails if any confirm prompt is produced; reference the
createBufferedIO() instance named io and the connectIntegrations invocation when
adding this assertion.
In `@packages/deploy/src/connect.ts`:
- Around line 300-307: The 401/403 error messages thrown when checking
res.status omit the cloud session URL; update the two Error messages (the
unauthorized branch that throws when res.status === 401 and the forbidden branch
for res.status === 403) to include the cloud session URL
"https://origin.agentrelay.cloud/cloud" in the remediation text so users can
visit that page to validate/fix cloud session state; locate the throw new
Error(...) calls in connect.ts that reference 'cloud integration request failed:
unauthorized' and 'cloud integration request failed: forbidden' and append or
interpolate the URL into each message.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c0fc34ad-61d8-403d-bb6a-99f56db93008
📒 Files selected for processing (2)
packages/deploy/src/connect.test.tspackages/deploy/src/connect.ts
Summary
Auth source: token
Subject type: cli
User: Khaliq Gant khaliq@agentrelay.com
Organization: Khaliq Gant's Workspace
Workspace: Default
Scopes: cli:auth
Token file: /Users/khaliqgant/.agent-relay/cloud-auth.json and active workspace refresh instead of a generic login retry.
Verification
Notes
This does not touch cloud production or merge anything. Current main already includes the functional shared-auth reuse from #113; this PR fixes the confusing follow-on behavior that produced repeated connect prompts after an auth failure.