π Stop telling users to reinstall Pi when it's just a provider mismatch#50
Open
arach wants to merge 1 commit into
Open
π Stop telling users to reinstall Pi when it's just a provider mismatch#50arach wants to merge 1 commit into
arach wants to merge 1 commit into
Conversation
β¦smatch PiWorkspaceView.setupPlaceholder (the needsProviderSetup state) rendered PiInstallCallout β the "PI REQUIRED β npm install -g ..." block meant for a genuinely missing binary. So a user with pi installed but pointed at an unauthenticated provider (e.g. the default openai-codex while only github-copilot is signed in) was told to reinstall the agent from scratch. - setupPlaceholder now uses the existing (previously orphaned) PiProviderSetupCallout. PiInstallCallout stays for the real !hasPiBinary case (its other three mounts already gate on that correctly). - Auto-select a connected provider in reloadAuthState(): if the selected provider has no stored credential but another is connected, switch to the first connected one in supported order. Keeps the assistant usable instead of stranding the user on a setup screen for a provider they never authenticated. Routed through the normal authProviderID setter so it persists and refreshes like a manual switch; skipped mid-auth-flow.
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.
The bug
If
piis installed but the selected provider has no stored credential (e.g. the defaultopenai-codexwhile you've only signed intogithub-copilot/minimax), the Workspace Assistant rendered the "PI REQUIRED βnpm install -g --ignore-scripts @earendil-works/pi-coding-agent@latest" block β telling you to reinstall the agent from scratch over what is purely a provider-selection problem.Root cause:
PiWorkspaceView.setupPlaceholder(theneedsProviderSetupstate) was wired toPiInstallCalloutβ the component meant for a genuinely missing binary. The name said "setup," the body said "install from scratch."The fix
Right callout for the right state.
setupPlaceholdernow usesPiProviderSetupCallout(an amber "SET UP YOUR AI" component that already existed but was orphaned/never mounted).PiInstallCalloutis now used only for!hasPiBinary. The dock and Settings mounts already gated correctly; this was the one wrong site.Auto-select a connected provider. In
reloadAuthState(), if the selected provider has no stored credential but another provider is connected, switch to the first connected one (inPiProvider.supportedorder). This runs insidePiChatSession.init, so it fires before any setup state can render β the assistant just works on a provider you're already signed into instead of stranding you on a setup screen. Routed through the normalauthProviderIDsetter (persists + refreshes like a manual switch); skipped while an auth flow is in progress.Verification
swift build -c releaseβ builds clean; app relaunches..sharedinstantiation + lazyUserDefaultsflush; and the readOnly popover hardening blanks screenshots), so this is best eyeballed in-app: open the assistant β it should land on GitHub Copilot chat. Sign out of every provider and you'll get the amber "SET UP YOUR AI" callout β never the install-from-scratch block β as long as the binary is present.Notes
This is purely the UX bug. Separately, the installed agent is
0.74.0vs0.78.1latest β worth bumping, but unrelated to this fix.