Repository navigation
Description
How are you running Flagsmith
- SaaS at flagsmith.com
Describe the bug
The recommendation banner at the top of the experiment results page names a winner and suggests a rollout at any probability. The docs only call a result when a variant's chance to beat control is above 95% (winning) or below 5% (losing). Both sides of that rule are missing in the code:
- Green banner below 95%. At a 64% chance to win the page says "64% Winner Probability Confirmed. Variant_1 is outperforming Control by +20.3% with 64% probability of being the best variant. Consider rolling out Variant_1 to all users." The credible interval in the table on the same page is [-89.6%, 130.2%].
- Yellow "Control is the winner" banner while the variant is above 5%. With the variant at 38% (control 62%) the page says "Control is the winner. Control has shown the best performance, with 62% probability of being the best arm. No variant has outperformed it. Consider rolling out Control to all users." The interval is [-82.4%, 60.1%].
For comparison, at 98% with the interval [14.2%, 400.5%] the page shows the same green "Winner Probability Confirmed" banner, which is correct by the docs. Apart from the number, the banner at 64% and at 98% is identical: same colour, same "Confirmed", same rollout suggestion. Only the table tells them apart.
What the docs say (both pages re-read on 26 Nov 2026):
- https://docs.flagsmith.com/experimentation/analyse-an-experiment: "When a variation reaches a 95% chance of beating control, a recommendation banner suggests rolling it out."
- https://docs.flagsmith.com/experimentation/statistics: "Over 95% → winning; under 5% → losing; in between → inconclusive."
64% and 38% are both in the inconclusive range, and in both cases the page recommends rolling something out to all users.
Impact: the banner and the complete-experiment dialog are where a user decides whether to ship. The docs describe that flow: end the experiment "when you have a conclusive result", then "update the flag so every user gets the winning variation". Today the page suggests a rollout before the result is conclusive, so it can lead a team to ship a variant that has not won, or to keep control and drop a variant that may be better. Since #9021 (merged 23 Nov), the same leader is also pre-selected as the rollout choice in the dialog, again with no threshold. The WeMakeDevs guide for the Toggle Wars hackathon runs into this in its worked example: "Flagsmith calls Variant_1 the winner at 84% and suggests rolling it out", while the credible interval is -14.1% to 44.0% and the author recommends leaving the experiment running (https://www.wemakedevs.org/blogs/how-to-run-a-real-ab-test-with-flagsmith-experimentation).
Where it happens (main at 98fa536, 26 Nov 2026):
- ExperimentRecommendation.tsx L24-L68: yellow branch when
summary.controlWins, green branch otherwise. Neither checks the probability. The copy came from feat: improve experiment recommendation and disable Snowflake warehouse #7940, whose description gives "80% Winner Probability Confirmed" as the example. - derive.ts L233-L273:
getBestTreatmenttakes the highestchance_to_win;getWinningVariantreturns control when its chance is higher than the best treatment's (L263). No minimum in either. - derive.ts L289-L330:
deriveSummaryfeeds both the banner and the "Winning variation" scorecard. The only probability cut-off in the file is L321,chanceToBestHigh: winner.chanceToWin > 0.9, and it only styles the "Chance to be best" number. - ExperimentDetailPage.tsx L97-L99: the banner renders whenever
experiment.status !== 'created'. - CompleteExperimentModal/utils.ts L61-L73:
getDefaultSelectionpre-selects whatevergetWinningVariantreturns. The "leading treatment" case inCompleteExperimentModal/__tests__/utils.test.tsexpects a variant at 0.7 to be pre-selected.
The comment at derive.ts L213 says chance_to_win is the pairwise P(variant beats control), which is the number the docs put the 95% and 5% thresholds on.
Steps To Reproduce
- Flagsmith Cloud (v2.294.0 at the time), Experiments with the built-in Flagsmith warehouse. A multivariate flag with control and one variant, 50/50 split, 100% rollout, one occurrence metric ("purchase", should increase).
- Send exposures and events for synthetic identities with
@flagsmith/nodejs9.3.0: 140 identities, Control 64 exposures and 7 purchases (10.9%), Variant_1 76 exposures and 10 purchases (13.2%). Click Refresh on the results page. - The page shows "64% Winner Probability Confirmed" with the interval [-89.6%, 130.2%] (screenshot 1).
- A second experiment set up the same way, 140 identities: Control 56 exposures (16.1%), Variant_1 84 exposures (14.3%). The page shows "Control is the winner" at 62% (screenshot 2).
- A third experiment, 300 identities: Control 163 exposures (7.4%), Variant_1 137 exposures (22.6%). The page shows "98% Winner Probability Confirmed" (screenshot 3). Here the banner agrees with the docs.
The results were computed on 21 Nov 2026. ExperimentRecommendation.tsx was last changed on 15 Oct (b6824ac), and getBestTreatment / getWinningVariant in derive.ts are unchanged on today's main, so current main should behave the same way.
Expected behavior
The page follows the rule in the docs:
- The green "winner" banner and the rollout suggestion appear only when a variant's chance to beat control is above 95%.
- "Control is the winner" appears only when every variant is below 5%.
- In between, show a neutral banner, for example "64% chance, not enough evidence yet. Variant_1 is ahead of Control by +20.3%, but the true effect could be anywhere from -89.6% to +130.2%. Keep the experiment running; a winner is called at 95%." The "Winning variation" scorecard shows "No winner yet".
- In the complete-experiment dialog, control stays pre-selected until the result is conclusive, with the existing "No variant has a clear lead yet, so control is selected." message.
I can open a PR for this if the approach looks right to you.
Screenshots
- 64%, green "Winner Probability Confirmed":
- Variant 38% / control 62%, yellow "Control is the winner":
- 98%, green banner (the correct case):
The screenshots were taken on Flagsmith Cloud on 21 Nov 2026.



Activity
NadyKor15 commentedon Nov 26, 2026
Adding two annotated images in case they make this quicker to review: the current results screen with the four relevant spots marked, and a mockup of the same screen following the 95% / 5% rule, next to the rules table from the docs.