Fix percentAgreement to prevent false consensus when subset of participants respond - #1012
Conversation
…lation Co-authored-by: JamesPHoughton <4304478+JamesPHoughton@users.noreply.github.com>
|
|
There could be some unexpected behavior, actually, if one person has submitted, and the values are being computed and displayed before other participants (who will eventually submit) have a chance to do so. Can we think through the different edge cases here? It is possible that this will be used on the same page as the submission of the actual values. For example, if folks say "I'm ready to proceed" or "Not ready to proceed", if the initial values are all Undefined, and then one person submits "I'm ready to proceed" do we really want it to take that as consensus on proceeding? or should we just throw false when everything is undefined, but also include undefined responses in the denominator when looking for consensus? |
Deliberation
|
||||||||||||||||||||||||||||
| Project |
Deliberation
|
| Branch Review |
copilot/fix-754
|
| Run status |
|
| Run duration | 06m 39s |
| Commit |
|
| Committer | James Houghton |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
1
|
|
|
0
|
|
|
16
|
| View all changes introduced in this branch ↗︎ | |
|
@copilot - can you make changes to account for the edge cases described above? |
…or for consensus calculation Co-authored-by: JamesPHoughton <4304478+JamesPHoughton@users.noreply.github.com>
I've addressed the edge case you identified. The fix changes the denominator calculation to use total participants instead of just responders, preventing false consensus when only a subset have responded. Key change in commit 724e17c:
This ensures that if only 1 out of 4 people responds "ready", it shows 25% agreement rather than 100%, preventing premature consensus triggers. The logic still returns false when all values are undefined (no responses yet). |
|
The
percentAgreementposition modifier was incorrectly calculating consensus percentages, leading to false consensus when only a subset of participants had responded.Problem
The original implementation had two issues:
For example, with 4 participants where only 1 says "ready":
This could trigger premature actions in scenarios like "ready to proceed" checks.
Solution
Modified the
percentAgreementlogic to:Behavior Changes
[undefined, undefined, "ready"]with ≥50% threshold →false(33% agreement, not 100%)[undefined, "ready", "ready"]with ≥50% threshold →true(67% agreement)[undefined, undefined, undefined]→false(no responses yet)["ready", "ready", "ready"]→ works exactly as beforeThis ensures
percentAgreementprovides accurate consensus measurements for real-time decision scenarios where participants may respond at different times.Fixes #754.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.