You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't start Posit Assistant in more than one RStudio instance on Windows #18787
RStudio Edition : Desktop
RStudio Version : 2026.09.0+174 "Autumn Hawkbit" Release (works in 2026.08.x)
OS Version : Windows-11 (so far have only reproduced on Windows)
R Version : any
Steps to reproduce the problem
Start RStudio desktop, show Posit Assistant (install if necessary), sign in, etc.
Start a second instance of RStudio (e.g. Session > New Session, or other ways)
Describe the problem in detail
The Posit Assistant pane fails to load, showing "Error: Failed to start Chat backend: A Posit Assistant update is in progress. Please try again in a moment."
Every Windows session names its Posit Assistant "in use" lock file pai/locks/sessions/.lock because the lock owner id comes out as an empty string. The second instance then collides with the first on that one file and reports the contention as "update in progress". From rsession-<user>.log:
Failed to acquire lock: C:/Users/<user>/AppData/Local/RStudio/pai/locks/sessions/.lock
ERROR system error 39 (The disk is full) [lock-file: .../pai/locks/sessions/.lock,
description: A Posit Assistant update is in progress. Please try again in a moment.]
The owner id is built in installLock() (src/cpp/session/modules/SessionChat.cpp):
MSVC (19.51.36248, VS 2026 v145) in -std:c++20 mode, which cmake/compiler.cmake selects on Windows only, initializes that function-local static to "". Confirmed three ways:
Instrumented dev build: inside installLock() the UUID printed non-empty while the static printed empty, and InstallLock's constructor received "".
A standalone 30-line program with the same shape: empty under -std:c++20 at both /Od and /O2; correct under -std:c++17, correct as a non-static local, and correct when the initializer is wrapped in an immediately-invoked lambda.
InstallLock itself produces the right <id>.lock name when handed a real id, so the lock protocol is not at fault.
Why 2026.09 and not 2026.08
The lock shipped in 2026.08 (#18276) with the id passed straight to the constructor as an expression. #18573 (2026.09 only) hoisted it into a static const std::string initialized by the conditional operator, which is the shape MSVC gets wrong. Windows has built with C++20 since December 2025, so the compiler mode did not change.
Why it wasn't caught
ChatInstallLockTests.cpp is wrapped in #ifndef _WIN32, so nothing on Windows exercised the owner-path naming. The "The disk is full" text is a side effect of rendering errc::no_lock_available (39) through the Windows system error category and is misleading but harmless.
Fix
Compute the id in an immediately-invoked lambda with plain locals (verified correct with the same compiler), refuse an empty owner id in InstallLock so a regression fails loudly instead of silently sharing one file, and add tests that compile on Windows.
Windows only (macOS and Linux were never affected).
Start RStudio Desktop, open Posit Assistant, and sign in.
Session > New Session (or launch a second RStudio instance any other way) and open Posit Assistant in the second window.
Expected: Posit Assistant starts in both windows. Before the fix the second window shows "Error: Failed to start Chat backend: A Posit Assistant update is in progress. Please try again in a moment."
While both are running, %LOCALAPPDATA%\RStudio\pai\locks\sessions should contain one <launcher-token>-<uuid>.lock file per running session and no file named just .lock.
Close one window; its lock file should disappear and the other window's Posit Assistant should keep working.
This is a regression in MSVC 19.51 (Build Tools v14.51, Visual Studio 2026 18.6 and later). The repro passes on every MSVC release from 19.29 (VS 2019 16.11) through 19.50 (VS 2026 18.2) on Compiler Explorer, under both /std:c++17 and /std:c++20, and fails only on 19.51. RStudio's Windows CI image pins VS 2026 18.7.3, which carries 14.51.
Affected shape, from local characterization: copy-initializing a static-storage class object (static T x = cond ? a : b;, local or namespace scope) where an operand is a temporary. std::string, std::wstring, and an aggregate holding a string break under C++20; std::shared_ptr breaks under C++17 and C++20. Direct-init static T x(cond ? a : b);, lvalue operands, an IIFE lambda, if/else, and non-static locals are all fine. A sweep of src/cpp on main and rel-autumn-hawkbit found no other instance of the pattern.
Activity
gtritchie commentedon Sep 11, 2026
Root cause
Every Windows session names its Posit Assistant "in use" lock file
pai/locks/sessions/.lockbecause the lock owner id comes out as an empty string. The second instance then collides with the first on that one file and reports the contention as "update in progress". Fromrsession-<user>.log:The owner id is built in
installLock()(src/cpp/session/modules/SessionChat.cpp):MSVC (19.51.36248, VS 2026 v145) in
-std:c++20mode, whichcmake/compiler.cmakeselects on Windows only, initializes that function-local static to"". Confirmed three ways:installLock()the UUID printed non-empty while the static printed empty, andInstallLock's constructor received"".-std:c++20at both/Odand/O2; correct under-std:c++17, correct as a non-static local, and correct when the initializer is wrapped in an immediately-invoked lambda.InstallLockitself produces the right<id>.lockname when handed a real id, so the lock protocol is not at fault.Why 2026.09 and not 2026.08
The lock shipped in 2026.08 (#18276) with the id passed straight to the constructor as an expression. #18573 (2026.09 only) hoisted it into a
static const std::stringinitialized by the conditional operator, which is the shape MSVC gets wrong. Windows has built with C++20 since December 2025, so the compiler mode did not change.Why it wasn't caught
ChatInstallLockTests.cppis wrapped in#ifndef _WIN32, so nothing on Windows exercised the owner-path naming. The"The disk is full"text is a side effect of renderingerrc::no_lock_available(39) through the Windows system error category and is misleading but harmless.Fix
Compute the id in an immediately-invoked lambda with plain locals (verified correct with the same compiler), refuse an empty owner id in
InstallLockso a regression fails loudly instead of silently sharing one file, and add tests that compile on Windows.gtritchie commentedon Sep 11, 2026
QA Notes
Windows only (macOS and Linux were never affected).
%LOCALAPPDATA%\RStudio\pai\locks\sessionsshould contain one<launcher-token>-<uuid>.lockfile per running session and no file named just.lock.gtritchie commentedon Sep 11, 2026
Upstream compiler bug
This is a regression in MSVC 19.51 (Build Tools v14.51, Visual Studio 2026 18.6 and later). The repro passes on every MSVC release from 19.29 (VS 2019 16.11) through 19.50 (VS 2026 18.2) on Compiler Explorer, under both
/std:c++17and/std:c++20, and fails only on 19.51. RStudio's Windows CI image pins VS 2026 18.7.3, which carries 14.51.Microsoft tracks it as Developer Community ticket 11093947, "MSVC 14.51 codegen: ternary picks wrong =default constructed branch for std::string class", listed as fixed in the v14.52 preview in MSVC Build Tools Preview updates - July 2026. As of 2026-09-11, v14.52 is preview only (19.52.36725, September 2026 preview notes); the GA toolset through VS 2026 18.10 is still 14.51 with no servicing fix listed in the release notes. So no shipped toolset has the fix yet, and the source-level workaround is needed regardless.
Affected shape, from local characterization: copy-initializing a static-storage class object (
static T x = cond ? a : b;, local or namespace scope) where an operand is a temporary.std::string,std::wstring, and an aggregate holding a string break under C++20;std::shared_ptrbreaks under C++17 and C++20. Direct-initstatic T x(cond ? a : b);, lvalue operands, an IIFE lambda, if/else, and non-static locals are all fine. A sweep ofsrc/cpponmainandrel-autumn-hawkbitfound no other instance of the pattern.Refuse an empty Posit Assistant lock owner id on the mutation path too
Fix Posit Assistant failing to start in a second RStudio instance on …
gtritchie commentedon Sep 12, 2026
Fixed in 2026.09.1 patch branch, and pulled into
mainvia usual merge process.gtritchie commentedon Sep 13, 2026
Verified fixed in patch build
2026.09.1+180. Note this is not yet an official release, but the only change in this build versus the official release is this fix. Download from: https://dailies.rstudio.com/rstudio/autumn-hawkbit/.We will be issuing an official patch release soon.