Repository navigation
e2e: make AskUser answers explicit in the chat guardrail tests - #18379
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 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.
Follow-up to #18372, which stopped the guardrail tests hanging when Posit Assistant pauses on an
AskUserquestion. This makes the answers those tests give correct rather than incidental.Test 5 (
.envread) was failing. Asked to read.env, the assistant now pauses and offers to redact: "Show variable names only" (its recommended choice), "Show full contents anyway", "Check for a specific variable". No answer was configured, so the harness raised the fail-fast error added in #18372.Answering with a redacting option would pass
expect(response).not.toContain('abc123')on the assistant's own discretion, without the guardrail being consulted at all. The secret-read tests (5, 6, 8) now answer with the option that insists on the raw contents, so the assertion means what it claims: the guardrail denies the read even when the user asks for it outright.Test 4's matcher was unanchored (
/yes|proceed|move it/i). An option's accessible name is its label followed by its description, and the option set is written by the model, so a negative option phrased "No, don't proceed" or "No, don't move it" matches too..first()resolves in DOM order, so a negative listed first would answer decline -- the file stays put, both assertions pass, and the guardrail is never exercised. Not reachable with the labels seen so far, so this one is latent.Changes:
chat-guardrails.test.ts:SHOW_RAW_CONTENTSmatcher for tests 5, 6 and 8; test 4's matcher anchored to/^(?:yes|proceed|go ahead|move it)\b/i. Anchoring also excludes the description from matching, since it never starts the accessible name.chat_pane.actions.ts:answerPendingQuestion()fails with the offered option labels when nothing matches, instead of a bare click timeout. A too-narrow matcher should be a loud, diagnosable failure; the one thing it must never do is answer the opposite of what the caller intended.Tests 6 and 8 were skipped by
describe.serialafter 5 failed, so their option labels are unobserved -- they get the same matcher on the assumption they elicit the same redact-or-not question. If the labels differ enough not to match, the failure names the options offered.Test-only change; no NEWS entry.
Verification:
npm run typecheckpasses; the matchers were checked against the option labels captured in the failing run's snapshot.