Repository navigation
FIX: Restore scanner UI while preserving OPENAI environment var requirement - #4187
Merged
Richard Lundeen (richlundeen) merged 4 commits intoNov 11, 2026
Conversation
Restore the pre-microsoft#3794 scenario and suite launch controls, Registry setup flow, and previews without reverting credential-free browsing or explicit backend role validation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Check form errors separately from the global live region and match the incumbent suite MessageBar. Capture the restored Objective section on desktop and narrow viewports. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Run scanner launch cases with a fresh backend and dedicated CI shard so sibling seeded specs cannot satisfy deliberately missing roles. Capture the normal launch-error banner in the evidence. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Richard Lundeen (richlundeen)
left a comment
Contributor
Author
There was a problem hiding this comment.
Automated review completed. No blocking concerns remain. This review records source coverage; it does not authorize merge.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Optional endpoints are incorrectly required, blocking valid target creation, and stale suite selections can launch replacement targets after runtime reinitialization.
2 open issues
What changed in this PR
Restores the earlier CoPyRIT scanner workflow while preserving credential-free browsing and backend launch validation from #3794.
Changes:
- Restores scenario and suite forms, Registry-based target setup, and preview copy; removes inline component creation and frontend role-readiness checks.
- Preserves saved scoring-target selections when rerunning scans.
- Updates setup guidance and regression coverage, including an isolated browser-test configuration.
| File | Description |
|---|---|
tests/unit/scenario/core/test_scenario_readiness.py |
Adds credential-free catalog and estimate coverage. |
tests/end_to_end/browser_initializer.py |
Registers an offline default scorer. |
frontend/src/utils/targetIdentity.ts |
Removes readiness-based role labels. |
frontend/src/types/index.ts |
Removes frontend readiness types. |
frontend/src/services/api.ts |
Removes readiness and scorer-creation client methods. |
frontend/src/components/Scorers/CreateScorerDialog.tsx |
Deletes inline scorer creation. |
frontend/src/components/Scorers/CreateScorerDialog.test.tsx |
Removes deleted-dialog tests. |
frontend/src/components/ScenarioSuites/LaunchSuiteDialog.tsx |
Restores suite controls and launch-time validation. |
frontend/src/components/ScenarioSuites/LaunchSuiteDialog.test.tsx |
Updates restored suite-control coverage. |
frontend/src/components/ScenarioSuites/LaunchSuiteDialog.styles.ts |
Removes child flex-shrink overrides. |
frontend/src/components/Scenarios/ScenarioRunPreviewDialog.tsx |
Removes scoring-target display. |
frontend/src/components/Scenarios/scenarioLaunchRequest.ts |
Gates adversarial selections on scenario metadata. |
frontend/src/components/Scenarios/scenarioLaunchRequest.test.ts |
Aligns request tests with restored behavior. |
frontend/src/components/Scenarios/scenarioLaunchForm.ts |
Restores adversarial-default prefilling. |
frontend/src/components/Scenarios/ScenarioFlow.test.tsx |
Removes readiness mocking. |
frontend/src/components/Scenarios/ScenarioDetail.tsx |
Restores launch controls and preserves saved scoring targets. |
frontend/src/components/Scenarios/ScenarioDetail.test.tsx |
Covers restored controls, Registry navigation, and reruns. |
frontend/src/components/helpDefinitions.ts |
Simplifies adversarial-target help text. |
frontend/src/components/Config/CreateTargetDialog.tsx |
Simplifies creation callbacks and changes endpoint requirements. |
frontend/src/components/Config/CreateTargetDialog.test.tsx |
Updates target-creation expectations. |
frontend/src/components/Chat/ChatScorerPicker.tsx |
Restores fixed scenario-default copy. |
frontend/src/App.labels.test.tsx |
Removes readiness mocking. |
frontend/playwright.scan-launch.config.ts |
Adds isolated scan-launch browser configuration. |
frontend/playwright.config.ts |
Excludes scan-launch tests from the shared configuration. |
frontend/package.json |
Adds the scan-launch test command. |
frontend/e2e/scenario-history.spec.ts |
Removes readiness routing mocks. |
frontend/e2e/scenario-datasets.spec.ts |
Checks missing-target validation on submission. |
frontend/e2e/scan-launch.seeded.spec.ts |
Adds restored-workflow browser coverage. |
frontend/e2e/numeric-controls.spec.ts |
Removes readiness mock responses. |
frontend/e2e/explicit-targets.seeded.spec.ts |
Removes inline-creation browser coverage. |
doc/code/setup/0_setup.md |
Documents Registry setup and configured scorer defaults. |
.github/workflows/frontend_tests.yml |
Adds the isolated scan-launch CI job. |
Review effort: Balanced
Roman Lutz (romanlutz)
approved these changes
Nov 11, 2026
Honor optional endpoint metadata while keeping the unavailable-metadata fallback. Close suite launch dialogs when runtime generation changes and block submissions while the runtime is unavailable, without restoring role-readiness UI. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Richard Lundeen (richlundeen)
deleted the
richlundeen-restore-scan-ui
branch
November 11, 2026 07:43
Richard Lundeen (richlundeen)
added a commit
to richlundeen/PyRIT
that referenced
this pull request
Nov 11, 2026
Brings in microsoft#4187. No conflicts or integration changes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

Description
Restore the scanner interface and interactions from before #3794 without bringing back the missing-
OPENAI_CHAT_MODELblocker. The unintended UI regression came from Richard Lundeen (@richlundeen)'s changes in #3794 but preserves the fix.With
OPENAI_CHAT_MODELunset, the original form now opens instead of the blocking warning. Choose registered components, configure the scan, and use the existing run preview; valid configurations launch, while missing helper roles produce the normal launch error.Scanner screenshots
1. Original missing-environment blocker, before #3794. Original capture from #3794 at
80f28af2731d12523e084c9c7d114fedbf5e9b88, withOPENAI_CHAT_MODELunset and no configured targets or scorers.2. Before this rollback: regressed UI after #3794. Production build of merge commit
3cc6f65e616472349a48efdfe321c40bd29afc86;OPENAI_CHAT_MODELremains unset.3. After this rollback: restored UI. Production build of
4cab3976246bb45e720b5a1911078236ace8080b;OPENAI_CHAT_MODELremains unset.The before/after captures use the same
technique.executeroute,red_teamingselection, objective, explicit offline targets, light theme, and 1440 × 1000 viewport. Both are anchored to show the Objective heading and target/scorer controls below the sticky navigation. The local targets reject sends; no scan or provider request was submitted for these screenshots. No product source was patched for the captures.For a healthy-original comparison, the pre-#3794 parent
7d6a3da3b479c31b781be5501e787620f6527993was also built and rendered using that identical offline setup, which supplies the old constructor's required helper targets without model credentials. Its matched viewport and Objective section are pixel-identical to the restored UI: 0 differing pixels. The two review repairs retain metadata-based optional endpoints and close stale suite dialogs after runtime reinitialization without adding controls or readiness UI.