From ac9611478b4f394e62e4e4b2813dad337e22e698 Mon Sep 17 00:00:00 2001 From: YurenHao0426 Date: Sat, 14 Feb 2026 03:59:20 +0000 Subject: Fix debate elimination display and preserve original debater role numbers - Add elimination cards (orange themed) in Timeline showing who was convinced and by whom - Add "N eliminated" badge in round headers - Preserve original debater numbers after elimination by passing original_indices through debate_round() Co-Authored-By: Claude Opus 4.6 --- backend/app/services/debate.py | 8 +++++++- frontend/src/components/Sidebar.tsx | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/backend/app/services/debate.py b/backend/app/services/debate.py index 7ae25f3..086dde1 100644 --- a/backend/app/services/debate.py +++ b/backend/app/services/debate.py @@ -176,6 +176,8 @@ async def debate_round( tools_per_model: Optional[List[Optional[List[Dict[str, Any]]]]] = None, openrouter_api_key: Optional[str] = None, images: Optional[List[Dict[str, Any]]] = None, + original_indices: Optional[List[int]] = None, + original_total: Optional[int] = None, ) -> AsyncGenerator[Dict[str, Any], None]: """ Query debate models for one round. @@ -188,10 +190,12 @@ async def debate_round( idx: int, config: LLMConfig, current_round_so_far: Optional[List[Dict[str, Any]]] = None, ) -> Dict[str, Any]: + mi = original_indices[idx] if original_indices else idx + tm = original_total if original_total else len(configs) prompt = build_debate_prompt( user_prompt, debate_history, config.model_name, round_num, debate_format, custom_prompt, - model_index=idx, total_models=len(configs), + model_index=mi, total_models=tm, current_round_so_far=current_round_so_far, ) atts = attachments_per_model[idx] if attachments_per_model else None @@ -439,6 +443,8 @@ async def debate_event_stream( tools_per_model=active_tools, openrouter_api_key=openrouter_api_key, images=images, + original_indices=active_indices, + original_total=len(member_configs), ): round_responses.append(result) yield _sse_event({ diff --git a/frontend/src/components/Sidebar.tsx b/frontend/src/components/Sidebar.tsx index 474a969..7aed93c 100644 --- a/frontend/src/components/Sidebar.tsx +++ b/frontend/src/components/Sidebar.tsx @@ -3081,6 +3081,13 @@ const Sidebar: React.FC = ({ isOpen, onToggle, onInteract }) => { > Round {round.round} ({round.responses.length} responses)
+ {round.eliminated && round.eliminated.length > 0 && ( + + {round.eliminated.length} eliminated + + )} {round.judgeDecision && ( = ({ isOpen, onToggle, onInteract }) => {
))} + {round.eliminated && round.eliminated.length > 0 && ( +
+ {round.eliminated.map((elim, ei) => ( +
+
+ {elim.model} was convinced{elim.convincedBy && <> by {elim.convincedBy}} +
+
{elim.reasoning}
+
+ ))} +
+ )} {round.judgeDecision && (
Judge Decision
-- cgit v1.2.3