Repository navigation
e2e: answer Posit Assistant AskUser prompts in chat guardrail tests - #18372
Merged
Merged
Conversation
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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 |
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.
Posit Assistant 0.7.8 can pause a turn on an
AskUserquestion instead of acting. The question renders as a form (Pending questionstab strip, radio options,Submit Answers) and the turn stays active until it is answered, sopollWithAllowDialogs-- which waits for the stop button to disappear -- spun until the test timeout.This showed up as
4: rename from project to outside is deniedinchat-guardrails.test.tsfailing with a 120s timeout: asked to rename a file to a path outside the project, the assistant asked for confirmation rather than callingfile.rename()and hitting the R guardrail.Changes:
chat_pane.page.ts: role-based locators for the question form (pendingQuestions,submitAnswersBtn) and anisPendingQuestionVisible()probe.chat_pane.actions.ts:answerPendingQuestion()selects a matching option and submits, waiting for the form to unmount.pollWithAllowDialogs()takes an optionalanswerQuestionmatcher; without one, a pending question throws immediately with the question text instead of spinning to the timeout.chat-guardrails.test.ts: test 4 pins the prompt to R'sfile.rename()-- the assistant's own file tools and shell commands are not subject to.rs.chat.withGuardrails, so an unpinned prompt can move the file for real -- and answers affirmatively if asked, since declining would leave the file in place and pass the assertions without exercising the guardrail.Test-only change; no NEWS entry.
Verification:
npm run typecheckpasses. These tests are gated on Posit AI credentials (requireAiCredentials), which CI does not provision, so they run locally only.