Skip to content

Offer to reinstall Posit Assistant when it is up to date - #18927

Merged
gtritchie merged 3 commits into
mainfrom
feature/pai-reinstall
Sep 24, 2026
Merged

gtritchie merged 3 commits into
mainfrom
feature/pai-reinstall

Conversation

@gtritchie

Copy link
Copy Markdown
Member

Fixes #18658.

Step 5, the last in the plan in #18658. When Check for Posit Assistant Updates finds the user's own installation is already the latest version, the result dialog offers Reinstall, which downloads a fresh copy into a new slot. It is the in-product recovery for an install that passes verification but misbehaves.

What changes

  • The update check sets reinstallAvailable when the installed version equals the manifest's version for this protocol, the install is not blocked as unsupported, the session runs one of the user's own slots (runsUserSlot(), new in ChatInstallation), and a fresh user slot would still be selected (userInstallWouldBeSelected(), the update offer's gate). The manifest's download URL and SHA-256 are kept for that version.
  • Copies from posit-assistant-path, the administrator's directory, or the RStudio bundle are never offered Reinstall: a user slot beside them would shadow that copy rather than repair it.
  • reinstallAvailable is carried through a throttled skip in throttle::PendingUpdate, under the same installed-version-unchanged rule as a pending update, so a skip while the dialog is open doesn't make the click fail.
  • chat_install_update takes an optional reinstall flag. With it, performInstall() checks reinstallAvailable instead of updateAvailable, skips the select-an-existing-slot shortcut, and publishes with SlotPolicy::AlwaysFresh, so a collision bumps the suffix (1.5.0-2) rather than adopting the existing slot. The old slot is left in place. Managed mode refuses it, as it refuses install and update.
  • The dialog shows Reinstall and OK, with OK as the default. When Posit Assistant isn't selected as chat provider or assistant, the plain up-to-date message is shown instead, since the backend would refuse the install. en and fr strings.
  • NEWS entry.

Testing

GTEST_FILTER='Chat*:SessionAssistant*:PositAssistant*' ./build/src/cpp/rstudio-tests --scope rsession

283 tests pass, including new ones for runsUserSlot() and for carrying the reinstall offer through a throttled skip. ant unittest passes (606), including new dispatchUpdateCheck cases. check-for-updates-command.test.ts passes in desktop-dev with a new test for the Reinstall dialog.

A real reinstall was run once in desktop-dev from a throwaway spec against the live manifest: before, pai/versions held 1.5.0 with {"selected":{"11.0":"1.5.0"}}; after, it held 1.5.0 and 1.5.0-2 with {"selected":{"11.0":"1.5.0-2"}}, and no staging directory was left behind.

The update check now records the installed-equals-available case as
reinstallAvailable, keeping the manifest's download URL and SHA-256 for
it, and carries it across a throttled skip. chat_install_update takes an
optional reinstall flag that downloads a fresh copy and publishes it
with SlotPolicy::AlwaysFresh instead of re-selecting an existing slot.

Addresses #18658
Check for Posit Assistant Updates now shows Reinstall beside OK when the
backend reports reinstallAvailable, and accepting it calls
chat_install_update with the reinstall flag. en and fr strings, GWT
dispatch tests, an e2e dialog test, and a NEWS entry.

Addresses #18658
A reinstall writes a user slot, so beside a system or bundled copy of
the same version it would shadow that copy rather than repair it.
reinstallAvailable now also requires runsUserSlot(): the session's held
resolution is a slot under the user's pai/versions.

Addresses #18658
@gtritchie gtritchie added this to the 2026.10 (Blue Mistflower) milestone Sep 24, 2026
@github-actions

Copy link
Copy Markdown

RStudio E2E - all platforms

All tests passed!

#################### 100% pass rate

Passed Failed Skipped Flaky
3222 0 190 5
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 2 0 10 0
✅ desktop-linux 808 0 39 2
✅ desktop-macos 815 0 34 1
✅ desktop-windows 811 0 43 1
✅ server-linux 758 0 44 1
✅ setup 28 0 20 0
View / download the full report

View report online -- opens in the browser, no download needed. Available for 14 days.

Download playwright-report.zip -- extract and open index.html

Includes screenshots, traces, and step-by-step details for every test. Expires in 15 days.


All platforms - commit fa8feab90e98abece0f2f70cdcc1f2163208bb0a - Run #1184

@gtritchie
gtritchie merged commit c6d8d31 into main Sep 24, 2026
34 checks passed
@gtritchie
gtritchie deleted the feature/pai-reinstall branch September 24, 2026 21:58
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.

Install Posit Assistant side-by-side in versioned directories

1 participant