enhancements/consumer #4
Reference in New Issue
Block a user
Delete Branch "enhancements/consumer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Backend (chat.py): - Add bridge_mode field to ChatRequest - Add bridge_required + bridge_messages fields to ChatResponse - When bridge_mode=true (or model set + no backend provider): skip LLM call, return assembled RAG+system_prompt messages - Backend never calls localhost — LLM call happens in browser Frontend (ChatWorkspace.tsx): - isBridgeActive = bridge.status === 'connected' (not model-gated) - effectiveModel chain: chatModel ?? bridge.selectedModel ?? bridgeModels[0] - Send bridge_mode:true when bridge connected - On bridge_required response: call localBridgeFetch with bridge_messages Resolution order (user-facing chat): 1. Browser bridge (extension installed + local model) — zero backend config 2. Offered AI / free tier (NEBULA_LLM_API_KEY in prod env) — TODO: set in prod 3. BYOAI (user key in Settings) 4. 503 client.ts: - ApiChatRequest.bridge_mode?: boolean - ApiChatResponse.bridge_required?: boolean - ApiChatResponse.bridge_messages?: [{role,content}[]]- _get_system_state now accepts user_email; all entity queries (agents, tasks, plugins) filter to the requesting user. Published plugins remain globally visible. integration_instances TODO'd for migration 044 (no owner column yet). - Provider registry: Nebula always first (live registry); external providers only when status='active' AND is_implemented=true. - Tool inline format changed to compact set notation {slug:{t1,t2,...}}. Threshold raised to 80 — compact format is ~3x more token-efficient. Over-limit falls back to count-only {slug:N} with list_provider_tools() hint. - New tool: list_provider_tools(slug) — returns tool list for any provider on demand; used when compact/count-only mode is active. - DATA REGISTRY also uses compact notation {agents:{name(id:state),...}}. Hardcoded route table replaced with a terse pattern rule. - Bug fix: ii.is_active (non-existent) → ii.status='active' in both _fetch_ext_providers (chat.py) and list_integrations tool. - Migration 043: is_implemented BOOLEAN NOT NULL DEFAULT FALSE on integration_providers. Applied. - Test fix: test_create_plugin_tool.py updated to import from chat_tools/plugin_tools (refactored location) and use tool classes directly instead of removed _handle_* functions.Replace floating 'Thinking...' footer with a proper Nebula message bubble that appears inside the message list, directly below the user's message. - TypingBubble renders with the Nebula sender label + sparkle icon (matching real response bubbles), animated three-dot bounce animation (ne-TypingDots), and a status label that cycles based on elapsed time. - inferStatusLabel(): heuristic that reads the last user message and predicts the likely operation: plugin/build → Writing plugin code… → Validating code… run/execute → Dispatching task… → Agent is running… agent/create → Checking agents… remember/save → Checking memory… search/find → Searching knowledge base… integrations → Checking integrations… status/health → Querying system state… default → Calling tools… → Preparing response… - Removed the detached Loader2 + 'Thinking…' div from below the list. - CSS: ne-TypingDots with @keyframes ne-typing-dot bounce animation.During pending: - TypingBubble simplified to plain subtitle text (no bubble box): Sparkles icon + animated dots + status label (context-aware) - LiveWorkflowTrace below the text: nodes appear one by one with timing (Input→Context→LLM→Tools→Response), each node glows purple while active, turns green when complete, current node spins Loader2 After response (on each Nebula message): - WorkflowTrace renders below the message with a collapsible one-line summary: '⚡ 285ms · 4o-mini · 2 tools · 3 chunks ▶' - Expanded view: icon nodes in a horizontal scrollable flow with coloured circles, tool names, and detail labels per node (e.g. 'List Agents · 3 agents', 'Create Agent · ...abc123') - Nodes built from real response data: toolActions, chunksUsed, latencyMs, modelUsed (now stored on ChatMessage) - Shows RAG node only when chunks_used > 0 - Shows Synthesis node only when tools were called - Model prefix stripped (gpt-, openai/, anthropic/) for compact display Types: - Added modelUsed?: string to ChatMessage - aiMsg now stores resp.model_used