fix: show connection error screen when org auth fails @W-22584848@#211
Merged
marcelinollano merged 6 commits intoMay 22, 2026
Merged
Conversation
…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.
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>
npiccolo
approved these changes
May 21, 2026
Contributor
npiccolo
left a comment
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Testing Setup Notes
sf org logout -o <alias> --no-prompt) or point to a deleted org to trigger connection error