Skip to content

Extension Bisect: keep eliminated extensions disabled#316792

Open
NSExceptional wants to merge 2 commits into
microsoft:mainfrom
NSExceptional:fix/237092-bisect-keep-disabled
Open

Extension Bisect: keep eliminated extensions disabled#316792
NSExceptional wants to merge 2 commits into
microsoft:mainfrom
NSExceptional:fix/237092-bisect-keep-disabled

Conversation

@NSExceptional
Copy link
Copy Markdown
Contributor

@NSExceptional NSExceptional commented May 16, 2026

Summary

Fixes #237092 — Extension Bisect now keeps previously eliminated extensions disabled so that it can identify a problematic extension even when more than one extension is faulty.

Before: When bisect narrowed the search via a "still bad" answer, extensions outside the new search range were re-enabled. If any of those extensions were also bad, the user would keep answering "still bad" all the way to the end and bisect would conclude with the misleading "no extension has been identified" message.

After: Extensions in [high, length) — those eliminated by a "still bad" answer — stay disabled for the remainder of the bisect run. Extensions in [0, low) (eliminated by "I can't reproduce") were already verified safe collectively, so they remain enabled as before. Bisect now identifies one problematic extension per run; the user repeats bisect to find additional ones, as suggested in the issue's design section.

The "extension identified" confirmation also now mentions that the user may want to re-run bisect to find any additional problematic extensions.

Algorithm change

The bisect state (low, mid, high) partitions extensions into four regions:

Range Meaning Disabled (before) Disabled (after)
[0, low) Known-good (eliminated via "I can't reproduce") no no
[low, mid) Active search, currently enabled no no
[mid, high) Active search, currently disabled yes yes
[high, length) "Skipped" (eliminated via "still bad" — bad status unknown) no (re-enabled — bug) yes (fix)

This simplifies to isDisabled = i >= mid and disabledCount = extensions.length - mid.

Test plan

  • Manual: start bisect with two known-bad extensions, confirm a bad one is identified and the prompt suggests re-running bisect.
  • Manual: start bisect with one bad extension, confirm behavior is unchanged from the previous single-bad case.
  • Manual: confirm the disabled-count notification reflects the total disabled (active + skipped), not just the active half.

Authored this with AI, hope that's okay :)

Previously, when bisect narrowed the search range it only kept the
current upper half [mid, high) disabled and re-enabled every extension
outside the active range. If more than one extension was faulty, the
re-enabled extensions could continue to reproduce the problem,
preventing bisect from converging and yielding the misleading "no
extension identified" outcome.

This change keeps extensions in [high, length) - those eliminated from
the search via a "still bad" answer - disabled for the remainder of the
bisect run. Known-good extensions in [0, low) (eliminated via "I can't
reproduce") remain enabled because they were already verified safe. The
algorithm now correctly identifies one problematic extension per run;
the user can repeat bisect to find additional ones.

The "extension identified" confirmation now mentions running bisect
again to find any additional problematic extensions.

Fixes microsoft#237092
Copilot AI review requested due to automatic review settings May 16, 2026 20:14
@NSExceptional NSExceptional changed the title Extension Bisect: keep eliminated extensions disabled to find multiple bad extensions Extension Bisect: keep eliminated extensions disabled May 16, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Extension Bisect service to keep previously eliminated extensions disabled so bisect can still identify a bad extension even when multiple extensions are faulty (fix for #237092).

Changes:

  • Change bisect disablement to keep all extensions with index >= mid disabled (including those eliminated by “still bad”).
  • Update the disabled-count shown to users to reflect the new disablement rule.
  • Extend the “extension identified” confirmation message to suggest re-running bisect to find additional problematic extensions.

Covers start, "I can't reproduce", "still bad", reset, identification
of a single bad extension, and the "all extensions disabled, still bad"
no-extension-identified path. Asserts that disabledCount stays in sync
with the actual disabled set across each step, guarding against
regressions of issue microsoft#237092 (eliminated extensions must remain
disabled when the search narrows via "still bad").

Exports ExtensionBisectService so it can be instantiated directly in
tests. The DI singleton registration is unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extension Bisect should not re-enable most extensions throughout the process

3 participants