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
unlink(NULL) fails in R code run by Posit Assistant #19794
RStudio Edition : Desktop
RStudio Version : development build of main (2958c9c803)
OS Version : macOS (arm64)
R Version : 4.6
Steps to reproduce the problem
Run this in the Console, which evaluates the expression with the same file-access checks that apply to R code run by Posit Assistant:
.rs.chat.withGuardrails(unlink(NULL))
Describe the problem in detail
The call fails:
Error in path.expand(paths) : invalid 'path' argument
The check added to unlink() passes its argument to Sys.glob(), which does not accept NULL.
This matters beyond a literal unlink(NULL): some packages make that call while cleaning up. rmarkdown::render(), for example, calls unlink() on its list of temporary files as it exits, and that list is NULL when rendering fails early. The cleanup then fails in turn, so Posit Assistant is shown invalid 'path' argument in place of the error that stopped the render.
Describe the behavior you expected
unlink(NULL) does nothing and returns 0, as it does when run outside Posit Assistant.
Activity
check working directory changes made by assistant-run code (#19795)