test(e2e): QA.4 tool-policy violation UI indicator#14
Merged
Shaivpidadi merged 1 commit intodevfrom Apr 23, 2026
Merged
Conversation
Add a dedicated Playwright spec that verifies the chat UI correctly surfaces tool-level precheck decisions. Covers three cases via a mocked /api/chat SSE stream (same pattern as budget-limit.spec.ts): - denied tool call -> red Tool Result bubble, deny badge with the block icon and reason hint, Blocked stats tile increments - chat remains interactive after a tool-policy block so the user can retry - redacted tool call -> Redact badge + redacted payload visible, Redacted stats tile increments, no red styling (redact is not a block) Mocking keeps the test deterministic against staging, where real deny-list tool invocations depend on non-deterministic LLM behaviour. Refs TASKS.md QA.4; GOV-594.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
tests/e2e/tool-policy.spec.tswith deterministic coverage of the tool-level precheck decision path.Uses the same SSE-mock pattern as
budget-limit.spec.tsso the test runs deterministically against staging, where a real deny-list tool invocation would depend on non-deterministic LLM behaviour.Closes GOV-594. Refs TASKS.md §QA.4.
Test plan
pnpm type-checkpnpm test:e2e tool-policyagainst staging (requiresKEYCLOAK_USER,KEYCLOAK_PASSWORD)e2ejob green on pushplaywright.config.tsalready setstrace: 'retain-on-failure')