Repository navigation
e2e: handle assistant AskUser prompts and NES edit batching in the @ai tests - #18380
Merged
Merged
Conversation
The assistant now pauses on an AskUser question before writing outside the project, so the test threw "paused on a question and no answer was configured". Tell it not to ask, and answer affirmatively if it does, so the R guardrail is still what denies the write. Shares the affirmative matcher with test 4, which needs the same answer.
Copilot batched the last three call-site renames into one multi-edit accept, so the document was fully renamed after two accepts. The loop still asked for a third: its guard wait saw the outgoing preview, acceptNesRename re-checked after the teardown, and the test failed on a 30s timeout waiting for a suggestion that was no longer needed. Drive the loop off the remaining old-name occurrences and let acceptNesRename own the only wait. If it does time out, report it and fall through to the occurrence assertions, which name the missing call site instead of dumping a combined-locator timeout.
"Yes, write it inside the project instead" opens with an affirmative but performs an allowed in-project write, so the guardrail is never consulted and test 4's file assertions pass anyway. Require the option's accessible name -- label plus description -- not to relocate the operation into the project.
A suggestion that duplicated a call instead of replacing it would satisfy the positive check for the renamed form, exit the loop, and pass the final assertions with the old call still in the document. Filter on the old form and assert it is gone.
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 was referenced Jul 28, 2026
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.
Two failures from a full
--grep @airun against 2026.08.0-daily+144 with Posit Assistant 0.7.8.Filesystem guardrails, test 3 (write outside the project)
The assistant pauses on an AskUser question ("Write outside project folder") instead of running the
writeLines()call, and the test passed no answer, sopollWithAllowDialogsfailed with "paused on a question and no answer was configured".The prompt now tells the assistant not to ask, and the test answers affirmatively if it asks anyway, so
.rs.chat.withGuardrailsis still what denies the write. The affirmative matcher is shared with test 4 (rename to outside the project) and rejects redirect options: something like "Yes, write it inside the project instead" opens with an affirmative but performs an allowed in-project write, which would satisfy test 4's file assertions without the guardrail being consulted. An option set where nothing matches raises an error listing the options the assistant offered.Code suggestions, NES multiple renames
Copilot batched the last three call-site renames into one multi-edit accept, so the document was fully renamed after two accepts. The loop asked for a third: its guard wait saw the outgoing preview,
acceptNesRenamere-checked the same locators after the teardown, and the test failed on a 30s timeout waiting for a suggestion that was no longer needed.The loop now runs on the call sites still holding the old name rather than a count of accepts, and
acceptNesRenameowns the only wait for a suggestion. A timeout there is logged and falls through to the occurrence assertions, which name the call site that is still wrong. Those assertions also check that eachfn(score)form is gone, so a suggestion that duplicates a call instead of replacing it fails.Verification
Both tests pass on macOS desktop against that daily build. The failures are nondeterministic -- they depend on whether the assistant asks before acting and on how the provider batches NES edits -- so a green run does not by itself exercise the changed paths. The run log shows which path ran:
Answered pending assistant question with ...for the guardrail test, andAccepted N NES suggestion(s)with the per-round remaining-occurrence list for the NES test.Test-only change, so no NEWS.md entry.