Skip to content

fix: show connection error screen when org auth fails @W-22584848@#211

Merged
marcelinollano merged 6 commits into
mainfrom
marcelinollano/W-22584848-agent-connection-error-screen
May 22, 2026
Merged

fix: show connection error screen when org auth fails @W-22584848@#211
marcelinollano merged 6 commits into
mainfrom
marcelinollano/W-22584848-agent-connection-error-screen

Conversation

@marcelinollano
Copy link
Copy Markdown
Collaborator

@marcelinollano marcelinollano commented May 20, 2026

What does this PR do?

When the org connection fails (expired token, deleted org, invalid cross-reference) or Agentforce is not enabled, the agent preview panel now shows a dedicated error screen instead of silently displaying "No agents available".

Connection errors: Shows "Unable to connect to org" with a "Select Another Org" button.

Agentforce not enabled: Shows "Agentforce is not enabled" with an "Enable Agentforce" button (opens the org's Setup page) and a "Select Another Org" button, laid out side by side.

Title bar icons are hidden during the error state. The panel auto-recovers when the user switches orgs or when VS Code regains focus after the user resolves the issue externally.

What issues does this PR fix or reference?

@W-22584848@

Functionality Before

Panel silently shows "No agents available" with no indication that the org connection failed or that Agentforce isn't enabled. Users have no way to know what went wrong or how to fix it.

Functionality After

  • Auth/connection error: Panel shows "Unable to connect to org" with "Select Another Org" button
  • Agentforce not enabled: Panel shows "Agentforce is not enabled" with "Enable Agentforce" (opens Setup) and "Select Another Org" buttons
  • Title bar icons hidden during error state
  • Auto-refresh on window focus when in error state (seamless recovery after enabling Agentforce in browser)

Testing Setup Notes

  • Expire org auth (sf org logout -o <alias> --no-prompt) or point to a deleted org to trigger connection error
  • Use an org without Agentforce enabled to trigger the "not enabled" screen
  • Verify "Enable Agentforce" opens the org's Setup page in browser
  • Verify "Select Another Org" opens the org picker
  • Verify auto-recovery: enable Agentforce in browser, switch back to VS Code, panel should refresh
  • Verify title bar icons are hidden during error state

…ailable

Instead of silently showing "No agents available" when the org connection
fails, display a dedicated error screen with a "Select Another Org" button
that opens the org picker. Title bar icons are hidden during this state.
@marcelinollano marcelinollano requested a review from npiccolo May 20, 2026 16:32
marcelinollano and others added 5 commits May 20, 2026 18:35
Detects INVALID_TYPE error for BotDefinition (org lacks Agentforce
permission) and shows "Agentforce is not enabled" instead of the
generic connection error message.
When Agentforce is not enabled on the org, the error screen now includes
an "Enable Agentforce" button that opens the org's setup page. Buttons
use horizontal layout matching the placeholder screen pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When the auth error screen is showing and VS Code regains focus,
automatically re-fetch agents so the user doesn't need to manually
reload after enabling Agentforce or re-authenticating.

Also updates the "not enabled" message to reflect both available actions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@npiccolo npiccolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing PR #211. Build clean.

New features verified manually:

  • "Unable to connect to org" error screen — released an orgfarm org to invalidate auth, panel auto-detected the error on window focus and showed the error screen with "Select Another Org" button ✅
  • "Agentforce is not enabled" error screen — connected a fresh orgfarm org without Agentforce enabled, panel showed the specific error with "Select Another Org" + "Enable Agentforce" buttons ✅
  • "Enable Agentforce" button — redirects to the correct Agentforce setup page in the org ✅
  • Recovery after enabling — refreshed after enabling Agentforce, panel cleared and toolbar icons came back ✅
  • "Select Another Org" recovery — after auth error, selected a valid org, error screen disappeared and panel fully recovered with toolbar icons restored ✅
  • Auto-refresh on window focus — after releasing the org in orgfarm, switching back to VS Code triggered the error screen automatically without needing to click Refresh ✅

The error detection, error screens, and recovery flow all work cleanly. Approved.

@marcelinollano marcelinollano merged commit d427e10 into main May 22, 2026
10 checks passed
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.

2 participants