From 77be59bc0a6353e98846b9c9bfa2d566efea8b1f Mon Sep 17 00:00:00 2001 From: YurenHao0426 Date: Fri, 13 Feb 2026 21:43:34 +0000 Subject: Add LLM Council mode for multi-model consensus 3-stage council orchestration: parallel model queries (Stage 1), anonymous peer ranking (Stage 2), and streamed chairman synthesis (Stage 3). Includes scope-aware file resolution for Google/Claude providers so upstream file attachments are visible to all providers. - Backend: council.py orchestrator, /api/run_council_stream endpoint, query_model_full() non-streaming wrapper, resolve_provider() helper, resolve_scoped_file_ids() for Google/Claude scope parity with OpenAI - Frontend: council toggle UI, model checkbox selector, chairman picker, SSE event parsing, tabbed Stage 1/2/3 response display - Canvas: amber council node indicator with Users icon Co-Authored-By: Claude Opus 4.6 --- frontend/src/store/flowStore.ts | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'frontend/src/store') diff --git a/frontend/src/store/flowStore.ts b/frontend/src/store/flowStore.ts index 3590580..944b846 100644 --- a/frontend/src/store/flowStore.ts +++ b/frontend/src/store/flowStore.ts @@ -73,6 +73,16 @@ export interface MergedTrace { summarizedContent?: string; // For summary strategy, stores the LLM-generated summary } +export interface CouncilData { + stage1: Array<{ model: string; response: string }> | null; + stage2: { + rankings: Array<{ model: string; ranking: string; parsed_ranking: string[] }>; + label_to_model: Record; + aggregate_rankings: Array<{ model: string; average_rank: number; rankings_count: number }>; + } | null; + stage3: { model: string; response: string } | null; +} + export interface NodeData { label: string; model: string; @@ -85,22 +95,28 @@ export interface NodeData { reasoningEffort: 'low' | 'medium' | 'high'; // For OpenAI reasoning models attachedFileIds?: string[]; // IDs of files attached to this node disabled?: boolean; // Greyed out, no interaction - + + // Council mode + councilMode?: boolean; + councilModels?: string[]; + chairmanModel?: string; + councilData?: CouncilData; + // Traces logic traces: Trace[]; // INCOMING Traces outgoingTraces: Trace[]; // ALL Outgoing (inherited + self + forks + merged) forkedTraces: Trace[]; // Manually created forks from "New" handle mergedTraces: MergedTrace[]; // Merged traces from multiple inputs - activeTraceIds: string[]; - - response: string; + activeTraceIds: string[]; + + response: string; status: NodeStatus; inputs: number; - + // Timestamps for merge logic querySentAt?: number; // Unix timestamp when query was sent responseReceivedAt?: number; // Unix timestamp when response was received - + [key: string]: any; } -- cgit v1.2.3