Repository navigation
Read admin Posit Assistant versions beside the bundled copy - #18998
Conversation
The session now reads administrator-installed Posit Assistant versions from the posit-assistant directory beside the session binary, in the same layout as the user's own storage: slots under versions/, selected per protocol by selected.json, which RStudio never writes. The bundled copy moves under bundled/ in that directory. The selected administrator slot, the bundled copy and the user's slot compete as before: compatible protocol first, then newest version, ties going to the user's slot, then the administrator's. posit-assistant-path shipped in 2026.09.0, so it stays registered as a hidden, deprecated option that is ignored with a warning; removing it would make rsession reject any rsession.conf that still sets it. Addresses #18973
The bundled copy stays where Workbench installs it today, at bin/posit-assistant itself, and the administrator's versions/ and selected.json live inside it. The package owns neither, so an upgrade leaves them in place, and rstudio-pro's install layout is unchanged. bin/posit-assistant is preferred over the macOS location only when it holds a bundled copy or a versions/ directory, so a stray directory there no longer masks a usable one. Addresses #18973
bin/posit-assistant is the default. The location beside bin/ is used only when bin holds neither a bundled copy nor an administrator's slot for this protocol and it does, so an empty versions/ directory there no longer masks a usable copy. Addresses #18973
The macOS app-bundle fallback copied the Copilot Language Server rule, but only Workbench on Linux ships a bundled Posit Assistant, so systemStorageDir() is now <resource>/bin/posit-assistant with no probing. That also removes the extra slot scans and log lines the probe added to every positAssistantSearchPaths() call. runsUserSlot() reads the user's storage directory directly instead of building the full search paths while holding the resolution lock. The managed-mode not-found message names the versions/ directory an administrator installs into, and NEWS and the header no longer claim more than the code does. Addresses #18973
RStudio E2E - all platformsAll tests passed!
View / download the full reportView report online -- opens in the browser, no download needed. Available for 14 days. Download playwright-report.zip -- extract and open
All platforms - commit |
gtritchie
left a comment
There was a problem hiding this comment.
Two minor findings are open; nothing is blocking.
Open
-
The
posit-assistant-pathdeprecation warning only reaches per-user session logs. (ChatInstallation.cpp:156) TheRS_ONCEWLOG inpositAssistantSearchPaths()fires in each user's rsession log when Posit Assistant first resolves an installation. An administrator who set the option in 2026.09.0 sees sessions switch to the bundled copy with nothing in rserver's log. A warning at rserver startup, whenrsession.confsets the key, would reach them. -
No test covers the deprecated option or the new managed-mode message. (ChatInstallation.cpp:156, SessionChat.cpp:5085) No test sets
posit-assistant-pathand checks that resolution ignores it and warns once.installationNotFoundMessage()'s managed branch changed its wording and the path it names, also without coverage. A regression that re-reads the option or drops the warning would pass.
Withdrawn
- Removed macOS
<resource>/posit-assistantfallback (ChatInstallation.cpp:138). Desktop builds don't bundle Posit Assistant, and RStudio Server ships only for Linux, so no build uses that layout. - Desktop reads the system directory, and the managed-mode message points inside the app bundle (SessionChat.cpp:5085). Withdrawn for the same reason.
- Launcher session containers don't see versions installed on the Workbench host (ChatInstallation.cpp:138).
make-session-packagecopiesbin/posit-assistantinto the session tarball, so containerized sessions resolve the image's copy. Session images get a different approach, tracked in rstudio/rstudio-pro#13006, so this is out of scope here. selected.jsoncan't pin a version below the bundled copy or the user's install (ChatInstallation.cpp:238). Intended: customers run at least the version bundled with their Workbench release, and a problem in a bundled version is fixed by an urgent Workbench patch with an updated bundle.
Sessions ignore the option and warn only in each user's session log, so an administrator who set it in 2026.09.0 saw sessions switch copies with nothing in the server log. rserver now scans the rsession.conf sessions use at startup and warns when the option is set, naming the versions/ directory to install into instead. Addresses #18973
|
Responding to the review:
|
Addresses #18973.
Administrator-installed Posit Assistant versions now live in the directory that holds the copy bundled with Workbench,
<resource>/bin/posit-assistant(/usr/lib/rstudio-server/bin/posit-assistanton Linux), in the same layout as a user's ownpaidirectory. Theposit-assistant-pathsession option is no longer used.Layout
versions/andselected.jsonare read through the existing slot and selector code (ChatSlots,ChatSelector).selected.jsonis optional. A missing or stale entry falls back to the newest verifying slot for this protocol. RStudio never writes anything in this directory.versions/norselected.json, so Linux package upgrades leave them in place.Resolution
Three candidates compete under the existing ranking: matching protocol first, then newest version.
Ties keep that order. A selection older than the bundled copy or the user's slot loses to them, so
selected.jsonchooses among the administrator's versions but cannot hold users below a newer Workbench bundle.posit-assistant-installation-enabled=0removes the user's slot from the competition, as before.userInstallWouldBeSelected()ranks an offered version against the administrator's slot and the bundled copy.runsUserSlot()is unchanged in behavior.posit-assistant-pathThe option shipped in 2026.09.0, and rsession rejects an
rsession.confthat contains an unknown key. So the option stays registered as a hidden, deprecated option (deprecatedPositAssistantPath_, followingexternal-copilot-agent-path). Sessions ignore it, and log one warning naming theversions/directory. Because that warning only reaches each user's session log, rserver also scans thersession.confsessions use (thersession-config-fileoverride, or the standard XDG lookup) at startup, and logs a warning when the option is set to a non-empty value. Commented-out lines are skipped.SessionOptions.gen.hppis regenerated. Because hidden options are not documented, regenerating the rstudio-prorsession.confreference removes the entry.Other changes
bundledPositAssistantInstallPath()is replaced bysystemStorageDir(), which returns<resource>/bin/posit-assistant. The macOS app-bundle fallback is removed: only Workbench on Linux ships a bundled copy.InstallSearchPaths::adminDirandbundledPathare replaced bysystemStorageDir.kBundledPositAiDirNamebecomeskSystemPositAiDirName.versions/directory. Otherwise it points the user at the Posit Assistant pane.runsUserSlot()reads the user's storage directory directly instead of building the full search paths while holding the resolution lock.-Wdangling-elsewarning inChatConstantsTests.cppis fixed.Tests
ChatInstallationTests.cppis rewritten against the new layout. It covers:versions/not being read;userInstallWouldBeSelected()against an administrator slot.ChatStaticFilesTests.cppserves through the bundled copy.All 239 tests pass. An
rsession.confthat setsposit-assistant-pathstill parses, and one with an unknown key is still rejected, checked against the builtrsession.NEWS
The two unreleased #18973 entries are rewritten: one under New for the location and ranking, one under Deprecated / Removed for
posit-assistant-pathand/etc/rstudio/pai.Related
rstudio-server upgradesubcommand that installs versions into this layout is planned as a separate rstudio-pro change.