Repository navigation
feat: Agent UI eval benchmark framework with gaia eval agent command - #607
Conversation
…g model fields - Troubleshooting: show both npm (gaia-ui) and Python CLI (gaia --ui-port) commands - Fix RAG SDK method: index_file() -> index_document(), chunk_count -> num_chunks - Add missing indexing_status field to DocumentResponse - Add missing agent_steps field to MessageResponse - Update npm package section: gaia -> gaia-ui CLI command name Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…config update - Add self-hosted fonts (DM Sans, JetBrains Mono, Space Mono) for consistent rendering - Refine UI styling across ChatView, Sidebar, WelcomeScreen, MessageBubble, DocumentLibrary, SettingsModal, and ConnectionBanner - Update eval config: default model to claude-sonnet-4-6 with pricing - Add agent-ui eval benchmark plan Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Welcome page: typewriter effect for title and subtitle with hacker-style randomized timing, sequential content reveal, GAIA text pulsating glow - Feature cards: fixed-height with code hints that get erased by cursor on hover, replaced by expanded descriptions typed out hacker-style - Pixelated red cursor: consistent 8px blocky design with AMD red glow across welcome page, chat streaming, typing indicator, and input cursor - View transitions: smooth crossfade between welcome and chat views - Agent activity: elegant slide-in/out transitions for tools and thinking - Chat polish: bouncing typing indicator, scroll button slide, staggered chips, input focus glow, smoother message entrance animations - Global: theme transition CSS, toast exit slide, modal exit keyframes, sidebar content fade on collapse, prefers-reduced-motion support
… refinements - Smooth streaming exit: streaming bubble fades out with content snapshot before completed message appears (no duplicate flash or jarring vanish) - Stop button: AMD red accents for immediate visual priority during streaming - User messages: removed contradictory left border for cleaner asymmetry - GAIA avatar: subtle red glow in dark mode ties into accent system - Copy confirmation: green background tint flash for clearer feedback - Agent activity: stronger thinking bar glow, visible collapsed summary - Input area: inset shadow depth, higher placeholder contrast - Text selection: AMD red tint across entire app for brand cohesion - Scrollbars: unified 5px themed scrollbars across all panels and modals - Glassmorphism: consistent backdrop-blur on all floating surfaces - Button active states: tactile press feedback on all button types - Hover accents: doc pills, attachments, tool cards use AMD red consistently - Transition timing: unified to design system variables throughout
…shell whitelist The suggested "What hardware is in my PC?" query was completely broken due to: - Missing system info commands (systeminfo, wmic, powershell, lscpu, lspci, etc.) - LLM defaulting to Linux commands on Windows (no platform awareness in prompt) - PowerShell pipe commands broken by shlex.split stripping quotes - Windows /flags (e.g., findstr /i) misidentified as file paths - Piped commands not validated against whitelist (security gap) Changes: - shell_tools.py: Add cross-platform system info commands to whitelist, add PowerShell/wmic with read-only cmdlet validation, fix command execution to preserve quoting on Windows, add pipe pipeline validation, block dangerous shell operators (>, &&, ||, ;), fix Windows flag path detection - agent.py: Add dynamic platform detection to system prompt so LLM uses the correct OS-specific commands (Windows/macOS/Linux) Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…URLs - AnimatedPresence wrapper: delays unmount for CSS exit animations on all modals (Documents, File Browser, Settings, Mobile Access) - Modal exit: overlay fades out + panel slides down (reverse of entrance) - Session delete: slides left + shrinks + fades (250ms) before removal, sessions below smoothly reflow - Message delete: fades + scales down + shrinks (250ms) before removal - Session URL routing: sessions linkable via #hash in URL bar, auto-updates on session switch with getSessionHash/findSessionByHash utilities
- Default model updated from Qwen3-Coder-30B to Qwen3.5-35B-A3B across ChatAgent config, effective model selection, and database defaults - Added network query guidance: prefer ipconfig, identify primary adapter by real Default Gateway, ignore virtual adapters unless asked
Replace count-based session polling with fingerprint comparison that detects any change (new/deleted sessions, title edits, timestamp updates). Add guard against empty server responses wiping the sidebar. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Increase Lemonade health check timeout from 3s to 10s and soften the banner message to acknowledge the server may be busy rather than down. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…hardening, and test plan Thinking/cursor display: - Stream LLM reasoning_content as <think> tags through SSE handler - FlowThought component shows thinking text with red cursor in AgentActivity - Single cursor rule: only one red cursor visible at any time - LoadingMessage with sequential red glowing dots while waiting for LLM - Auto-collapse AgentActivity panel when thinking completes - Separated thinking events from status events (start_progress -> status type) Lemonade integration: - Model badge shows live model from Lemonade health API (not stale session DB) - Settings modal shows model size, device, context window, GPU, inference speed - Inference stats (tok/s, TTFT, token counts) on each assistant message - Model override: custom HuggingFace model with status indicators (found/downloaded/loaded) - Settings persistence via SQLite settings table Security hardening: - Block & operator in shell commands (was only blocking &&) - Remove foreach-object from safe PS cmdlets (allows .NET code execution) - Add shlex.split ValueError handling for malformed PS commands - Improved DANGEROUS_SHELL_OPERATORS regex with word-boundary matching Agent improvements: - System prompt trimmed from 25K to 13K chars (removed verbose examples, deduplicated tool refs) - Enhanced list_indexed_documents with per-doc chunks, sizes, types - Enhanced rag_status with total index size and document type breakdown - Better index_document messages (skip/cache/re-index/new) - Improved read_file error with parent dir context and search_file suggestion - Friendlier error messages from GAIA's perspective (not technical stack traces) Test infrastructure: - Comprehensive 56-case conversational test plan (tests/agent_ui_test_plan.md) - Test fixture files: CSVs, YAML, Python, empty file for data analysis tests Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Cursor consolidation: - ThinkingIndicator in message header types/erases "Thinking..." next to GAIA name - Cursor only renders when ThinkingIndicator is active (no dual cursor with FlowThought) - RenderedContent cursor gated on !agentStepsActive (no overlap with thinking cursor) - Removed dead cursorRef from FlowThought, renamed wasActiveRef2 Message transition fix: - Skip rendering static DB message during streamEnding phase (return null) - Removed stream-ending fade/blur/translate animation (caused visible flash) - Streaming bubble stays in place until unmounted, static message takes over seamlessly Thinking panel: - Auto-collapse immediately when thinking completes (no 300ms delay) - Removed red border from active summary bar - Removed erase animation from FlowThought (was invisible due to collapse) - start_progress emits status type instead of thinking (prevents cursors on status lines) CSS cleanup: - Consolidated .thinking-dots animation to single global rule in index.css - Removed duplicate rules from AgentActivity.css and MessageBubble.css - Removed dead .flow-thought-spinner CSS and reduced-motion override - Removed dead .loading-message, .thinking-display, .thinking-cursor CSS - Slower dot animation: 2.4s cycle with ease-in-out for relaxed pulse Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Remove orphaned .msg-entering CSS class (no longer referenced after transition fix) - Use var(--text-muted) for thinking indicator color (was hardcoded white, invisible in light theme) Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The default model was changed from Qwen3-Coder-30B-A3B-Instruct-GGUF to Qwen3.5-35B-A3B-GGUF in database.py but the test wasn't updated.
The implementation was changed to emit {"type": "status", "message": ...}
instead of {"type": "thinking", "content": ...} but tests weren't updated.
- AgentActivity panel always starts collapsed (thinking text in header instead) - Summary bar uses stable step count label (no THINKING → 1 STEP text swap) - Consistent Zap icon always (no spinner → icon swap on transition) - Removed active/done CSS differences (no padding/font/border/margin changes) - Immediate auto-collapse when thinking completes (no 300ms delay) Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
- Add AgentEvalRunner (src/gaia/eval/runner.py) that drives multi-turn Agent UI conversations via MCP tools and judges each turn with an LLM - Add scorecard generator (src/gaia/eval/scorecard.py) with weighted scoring across correctness, tool selection, context retention, completeness, efficiency, personality, and error recovery dimensions - Add architecture audit (src/gaia/eval/audit.py) for deterministic checks (history limits, agent persistence) without LLM calls - Wire `gaia eval agent` CLI subcommand with --scenario, --category, --model, --budget, --timeout, --output-dir, and --backend flags - Add eval corpus: 12 documents (reports, CSVs, HTML, code, adversarial edge cases) with manifest.json for scenario referencing - Add 5 YAML scenarios covering RAG quality, tool selection, and context retention categories with multi-turn conversation scripts and judge criteria - Add 30+ prompt templates for simulator, judge, and per-scenario runners - Commit initial eval run results (phase0–phase3 + fix_phase) as baseline - Strengthen ChatAgent RAG-first prompt: mandatory retrieval before answering, anti-re-index guard, response length calibration - Improve RAG tools, SSE handler, chat helpers, database, sessions, and MCP server based on eval findings - Add unit tests for history limits (tests/unit/chat/ui/test_history_limits.py) - Update frontend (App.tsx) with eval-driven UI fixes Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…al benchmark - Agent UI: inline image rendering via /api/files/image endpoint with home-dir security guard, symlink rejection, and image extension whitelist - Agent UI: MCP server management UI in SettingsModal with 18-entry curated catalog (Tier 1-4), enable/disable toggles, and custom server form - Backend: /api/mcp/* REST router (7 endpoints) with env masking on GET - Backend: MCP disabled flag support in MCPClientManager.load_from_config() - Backend: raise chat semaphore/session lock timeouts (0.5s→60s/30s) to prevent spurious 429s under sequential eval/multi-turn workloads - Streaming cleanup: fix DB persistence bug where responses stored as JSON artifacts; add _ANSWER_JSON_SUB_RE and trailing code-fence strip to _chat_helpers.py cleaning chain; extend fullmatch guard for backticks - ChatAgent system prompt: 8 new rules fixing all 7 eval baseline failures (MULTI-TURN re-query, NEGATION SCOPE, TWO-STEP DISAMBIGUATION, MULTI-FACT QUERY, SOURCE ATTRIBUTION, NUMERIC POLICY FACTS, Q1 aggregation) - Eval framework: 34 YAML scenarios covering RAG, context retention, tool selection, error recovery, personality, vision, and web system capabilities; claude -p judge pipeline; scorecard comparison; auto-fix loop - Eval results: 27/34 baseline → 34/34 after fixes (100% pass rate, avg 9.1/10) - Lint: remove duplicate imports, add check=False to subprocess.run calls, fix f-strings without interpolation, add PermissionError guard to serve_local_image symlink check - New tools: screenshot capture (mss/PIL fallback), system info, clipboard, desktop notifications, list windows, TTS, fetch webpage - screenshot_tools.py: new ScreenshotToolsMixin for cross-platform screen capture - eval/results/.gitignore: exclude timestamped run dirs, keep baseline.json Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Auto-registering generate_image caused the agent to call it during document Q&A (topic_switch regression: 8.7→6.1). Gate init_sd() behind ChatAgentConfig.enable_sd_tools=False so SD tools are opt-in only. topic_switch: FAIL 6.1 → PASS 8.9 after fix. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…tion Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…ucination Added explicit forbidden pattern: after index_document, calling list_indexed_documents does NOT provide document content — only filenames. The model was using this as a false "I've checked the index" signal and then answering from parametric training knowledge instead of querying. Also added explicit rule forbidding use of training-data knowledge to answer questions about indexed documents (supply chain, compliance, etc.). large_document: FAIL 7.3 → PASS 9.6 after fix (was pre-existing FAIL 5.8 at baseline). Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…, pylint suppress) Remove ChatAgent/RAGSDK/MCPClientManager from startup pre-load — their import trees pull in gaia.apps.* which instantiate AgentSDK at module level, triggering LemonadeManager.ensure_ready() and causing Lemonade to switch to the default 0.6B model on server startup. Only pre-load faiss and sentence_transformers (pure libraries, no side effects).
…ning Fix query_specific_file auto-index re-match to include resolved absolute path, preventing silent fallthrough when agent queries before indexing. Add /api/system/load-model and /api/system/download-model endpoints with non-blocking async design. ConnectionBanner now has direct Load/Download buttons instead of Lemonade UI links. Harden eval runner: graceful manifest error handling, authoritative scenario_id injection, ERRORED in known statuses, UTC run IDs. Add tests for _compute_effective_timeout and corpus doc manifest cross-reference. Electron packaging: asar, ignore list, English-only locales. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…rdening - Redesign SettingsModal: remove Model Override section, MCPServersSection dead code, add Download/Load Model/Force Re-download action panels - Add useModelActions shared hook with status polling for completion detection - Add ConnectionBanner Load Now and Download buttons for wrong model/missing model - Extract shared constants (MIN_CONTEXT_SIZE, DEFAULT_MODEL_NAME, timeouts) - Add _get_lemonade_base_url() and _lemonade_post() helpers in system.py - Add non-dict JSON guard in eval runner (prevents TypeError on array responses) - Add eval tests: score clamping, empty ground_truth, non-dict JSON Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
@claude perform a detailed code review. check if any existing functionality is broken due to the massive changes here and if any technical debt exists. |
|
Claude finished @kovtcharov's task —— View job Code Review CompleteOverall Assessment: This is a well-architected, substantial PR that adds significant value through the eval benchmark framework and Agent UI improvements. The code quality is generally high with good error handling, but there are some areas requiring attention. 🔴 Critical Issues1. Model Name InconsistencyThere's a mismatch between
The Fix: Update 🟡 Important Issues2. Duplicated Code Block in
|
| Feature | Status | Notes |
|---|---|---|
gaia chat CLI |
✅ | Works with model upgrade |
gaia chat --ui |
✅ | New Settings modal, model actions work |
| RAG indexing | ✅ | Auto-index path bug fixed |
| Agent caching | ✅ | Properly evicts on model change |
| Streaming SSE | ✅ | Improved regex filtering |
| Shell tools | ✅ | Security guardrails added |
No breaking changes to existing functionality detected.
Summary
| Severity | Count |
|---|---|
| 🔴 Critical | 1 |
| 🟡 Important | 3 |
| 🟢 Minor | 4 |
Recommendation: Address the critical model name inconsistency before merging. The important issues are technical debt that can be addressed in follow-up PRs.
…d source Replace all references to Qwen3-Coder-30B-A3B-Instruct-GGUF with Qwen3.5-35B-A3B-GGUF across 30 doc files and 17 source files to match the model upgrade completed in prior commits. Document new API endpoints in agent-ui SDK reference: load-model, download-model, settings GET/PUT. Expand CLI init profile table to include all 9 agent profiles (talk, blender, jira, docker were missing). Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Remove exact duplicate message construction in rag_tools.py index_document (lines 1267-1276 were copy of 1279-1287). Fix stale Qwen3-Coder-30B references in comments/docstrings across agent.py, device.py, and lemonade_client.py. Add clarifying comment on DEFAULT_MODEL_NAME explaining why it stays at 0.6B (lightweight fallback for gaia llm; agents use Qwen3.5-35B via AGENT_PROFILES). Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…B-GGUF Tests were still asserting Qwen3-Coder-30B-A3B-Instruct-GGUF as the default model for RAGConfig, AGENT_PROFILES, and JiraAgent. Updated test_rag.py, test_lemonade_client.py, test_jira.py, and test_utils_helpers.py to match the new default. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…egend agent-ui.mdx: - Add full Getting Started section with Prerequisites and Install & Launch - Cover both npm (gaia-ui) and Python CLI (gaia chat --ui) install paths - Document all CLI flags verified against cli.py and gaia-ui.mjs source - Note npm auto-installs backend + Lemonade on first run eval.mdx: - Add missing ERRORED status to Status Legend table - Distinguish judged vs infrastructure statuses (BLOCKED_BY_ARCHITECTURE is a judged status counted in avg_score, not an infrastructure status) - Clarify status re-derivation: BLOCKED_BY_ARCHITECTURE is never overridden but emits a warning, distinct from true infrastructure statuses
9511072 to
b50ec16
Compare
The link checker was resolving `https://host:8000/api/v1` as a real URL and failing DNS resolution. Changed to `http://your-server:8000` which is in the SKIP_DOMAINS allowlist. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
b50ec16 to
3ba23e2
Compare
When a previous chat request hangs (e.g., failing MCP servers causing 300s+ ChatAgent construction), the session lock was held indefinitely, blocking all future messages with "request already in progress". Now force-releases the stuck lock after 5s and proceeds with the new request, preventing permanent session deadlocks. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The test expected 409 for concurrent same-session requests, but the lock behavior was changed to force-release stuck locks and proceed (returning 200) instead of deadlocking. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
## Summary Release v0.17.0 — **GAIA Agent UI**, eval benchmark framework, tool execution guardrails, system prompt optimization, and security hardening. ### Files Changed - **`docs/releases/v0.17.0.mdx`** — Comprehensive release notes (new file) - **`docs/docs.json`** — Added `releases/v0.17.0` to Releases tab, updated navbar to `v0.17.0 · Lemonade 10.0.0` - **`src/gaia/version.py`** — Already at `0.17.0` on main (no change needed) ### Release Highlights **New Features:** - **GAIA Agent UI** — Full-stack privacy-first desktop chat with streaming responses, 53+ format document Q&A, ngrok tunnel for mobile, page-level citations, session management (PR #428) - **Agent UI Eval Framework** — `gaia eval agent` command with 7-dimension weighted scoring across 34 scenarios, redesigned Settings modal, `<think>` block display, performance stats (PR #607) - **Tool Execution Guardrails** — Blocking confirmation popup (Allow/Deny/Always Allow) before write/shell tools, 60s timeout (PR #565, #604) - **Device Support Detection** — AMD Ryzen AI Max + Radeon ≥24GB detection, `--base-url` remote bypass, `GAIA_SKIP_DEVICE_CHECK` override (PR #593) - **Terminal UI Design** — Typewriter welcome page, pixelated AMD cursor, glassmorphism, `prefers-reduced-motion` support (PR #568) **Performance:** - **78% System Prompt Reduction** — 17,600 → 3,853 tokens via two-tier RAG gating, 600s chat timeout, MCP runtime status display (PR #617) **Security:** - **TOCTOU Race Condition** — Atomic `O_NOFOLLOW` + `fstat` fix in document upload, per-file `asyncio.Lock` (PR #564) **Bug Fixes:** - LRU eviction silent failure + new `--max-indexed-files`/`--max-total-chunks` CLI flags (PR #567) - Lemonade v10 device key renames: `npu` → `amd_npu`, `gpu` → `amd_igpu`/`amd_dgpu` (PR #548) - Agent UI rendering, Windows paths, JSON safety regex, RAG indexing guards (PR #566, #604, #605) - Restored accidentally reverted changes from PRs #564, #565, #568 (PR #608) ### Post-Merge After merging, tag and push: ```bash git checkout main && git pull git tag v0.17.0 && git push origin v0.17.0 ``` CI runs `validate-release` → `publish-release`. PyPI gated on Kalin approval. ## Test plan - [ ] `docs.json` is valid JSON and renders on Mintlify - [ ] `validate_release_notes.py` passes for v0.17.0 - [ ] `version.py` reads `0.17.0` - [ ] Release notes content matches actual PR changes
Summary
Eval Benchmark Framework
gaia eval agentCLI command — runs multi-turn Agent UI benchmark scenarios viaclaude -psubprocess with MCP tool accesssrc/gaia/eval/) —AgentEvalRunner,scorecard.py(weighted scoring across 7 dimensions: correctness, tool selection, context retention, completeness, efficiency, personality, error recovery),audit.py(deterministic architecture checks)eval/corpus/) — 12+ documents covering reports, CSVs, HTML, Python code, and adversarial edge cases; 34 YAML scenarios across RAG quality, tool selection, context retention, and real-world categoriesscenario_idinjection, emptyground_truthvalidation, non-dict JSON guard,ERROREDstatus tracking, UTC timestamps on run IDsAgent UI Improvements
/api/system/load-modeland/api/system/download-modelbackend endpoints (non-blocking async); ConnectionBanner "Load Now" and "Download" buttons replace Lemonade UI links<think>block state machine in SSE handler routes reasoning to thinking events; single cursor, no flash, smoother animations_TOOL_CALL_JSON_REregex (DOTALL, handles thought+goal+tool+tool_args prefix),_json_filteredflag for artifact suppression, combined cleaners inprint_final_answerAgent Reasoning Fixes
query_specific_fileauto-indexing used absolute path forindex_document()but relative path for re-match, causing silent fallthrough to error; fixed by includingresolved(absolute) path in match checkQwen3.5-35B-A3B-GGUFacrosslemonade_client.pyMODELS registry, all agent profiles, database schema, and CLAUDE.mdSecurity & Reliability
DANGEROUS_SHELL_OPERATORSregex, PowerShell blocked flags, whitelist for system info commandsallowed_pathsenforcement in RAG auto-indexingElectron Packaging
Test plan
gaia eval agent— runs all scenarios and prints scorecard (34/34 PASS confirmed)gaia eval agent --scenario simple_factual_rag— single scenario filteringgaia eval agent --category rag_quality— category filteringgaia eval agent --audit— deterministic architecture checkspython -m pytest tests/test_eval.py -xvs— 95 eval tests passpython -m pytest tests/unit/ -xvs— unit tests passgaia chat --uiend-to-end regression check