# 2026-03-04 — Phase 4 Build Day

## What Was Built

### Phase 4: Research Lab (port 8097)
- Full 7-stage research pipeline: ideation → literature → experiment_design → experiment_run → analysis → writing → review
- Model-agnostic: any Ollama model can fill any role (reasoner, coder, analyst, writer, reviewer, narrator, vision, embedder)
- 4 thinking levels (none/low/medium/high) per stage
- RAG knowledge base with nomic-embed-text
- 0.8b narrator for human-friendly summaries
- Ecosystem integration layer connecting all 6 services
- Smart sessions: auto-pick models from eval profiles, report to status, announce to comms
- Dashboard at hub/25-research-lab/ with pipeline viz, session management, knowledge search, ecosystem tab
- Service: dgx-research-lab.service on port 8097
- First test: 4b generated solid grokking hypotheses in 92s, 4900 tokens

### Computer Use V2 (hub/26-computer-use-v2/)
- Complete rewrite as NEW prototype page (V1 untouched)
- Interactive screen: click on screenshot → sends click with visual ring feedback
- Type toolbar: send text, Enter, Tab, Esc to the page
- Chat panel: talk to agent mid-session, steer it
- Credential manager: save/use login credentials, auto-fill
- 4 modes: Browse, Deep Research, Desktop, Assist
- Deep Research: continuous search/refine/cite cycle, 3x step limit
- Session History tab: past sessions with flags, tags, continue/research-fix actions
- Failed sessions auto-tagged, manual flagging with notes
- "Research Fix" button on failures → pre-fills deep research task
- Info page (?) explaining every feature and button
- Settings: training toggle, auto-creds, voice, max steps, screenshot quality
- Proper mobile layout: slide-out panels with backdrop, no overlap
- Second iteration cleaned up: consolidated left panel, better mobile, less clunky

### UI Design System (skills/ui-design-system/SKILL.md)
- Standard design tokens, component patterns, layout rules
- Page template all agents use for consistent dashboards
- Dark theme principles, mobile rules, do's and don'ts

### Ecosystem Integration
- All 6 services connected: Research Lab (8097), Computer Use (8095), Agent Eval (8093), Agent Status (8094), Agent Comms (8096), Ollama (11434)
- integrations.py chains them: browse → knowledge base, eval → model routing, status reporting, comms announcements
- Single API endpoint: POST /api/smart-session does it all
- Hub index updated with Research and V2 Prototypes sections

## Key Decisions
- Build new pages as prototypes, don't edit existing working ones
- Standard UI design system for all future dashboards
- Research Lab as the hub connecting all services
- Deep Research mode = continuous, won't stop, builds citations

### App Packager (tools/app-packager/)
- build-launchers.sh: creates .desktop files + chromium --app launchers for all 8 hub apps
- share-app.sh: packages any app as a shareable zip
- create-app.js: full Electron packaging (heavier option)
- 8 apps registered: Computer Use, Research Lab, Agent Eval, Model Hub, Agent Status, Agent Comms, System Dashboard, Clawboard
- Icons at ~/.openclaw/apps/icons/*.svg

### Computer Use V2 — Model Config
- 🧠 Config tab: swap vision model, planner model, thinking level, temperature
- 4 presets: Default, Fast, Smart, Experimental
- Custom presets: save/load/delete (localStorage)
- Config passed to API on task run
- Tab icons condensed for mobile

## Pat's Feedback
- "Absolutely fantastic" on the styling
- Wants ecosystem where agents flow between tools
- Wants customizable modes for computer use
- Wants info/help pages explaining features
- Wants session history with failure tracking + research-fix
- Mobile layout was overlapping — fixed in V2 iteration
- Wants resizable side panels (added drag handles)
- Wants click-to-run desktop apps (done via chromium --app)
- Wants shareable packages for friends
- Wants interactive screen: draw, photo search, shopping cart
- Prefers V1 layout (screen top, steps bottom) over V2's 3-column layout

### Computer Use V2 — Interactive Features (final iteration)
- ✏️ Draw on screen: pen, circle, arrow tools with color picker
- ❓ Ask about drawing: highlight area and ask the agent
- 📷 Photo search: upload/capture photo → agent searches for it
- 🛒 Shopping cart: add items, track prices/sources, build cross-store orders
- Command bar: chat + type on page from one input
- Full mobile touch support for drawing

### Computer Use V2 — Major Overhaul (late night)
- **Prompt-optional sessions:** Can now start empty sessions and direct interactively. Quick-start buttons on placeholder screen: Photo Search, Browse, Deep Research, Desktop — all start a session immediately without requiring a task prompt first.
- **Command bar auto-starts:** Typing in the command bar with no session auto-starts one with that as the task.
- **Session management in sidebar:** Each session card now shows hover actions: ⏹ Stop (running sessions), 🧠 Model (inline model picker), 📦 Archive/Unarchive. Active/Archive toggle view.
- **Comprehensive help modal:** Full guide covering every feature, button, mode, config option, keyboard shortcut. Organized by section with styled feature cards.
- **Clean animations:** slideIn for sidebar, fadeIn for modals/backdrop, slideUp for upload sheet, slideInRight for cart panel, modalIn with scale+translate for info modal, toastIn for notifications.
- **Toast notification system:** Non-intrusive bottom-center toasts for confirmations (session started, archived, model changed, etc.)
- **Desktop audit:** Verified grid layout, sidebar inline mode at >=1200px, all interactive elements, proper z-indexing, escape key closes all panels.
- **UI polish:** Refined spacing, border-radius consistency via CSS vars, better color hierarchy with --text-muted, session count pill dims when zero, improved mobile responsive breakpoints.

### Research Lab + Dashboard Polish (late night cont.)
- **Agent dropdown**: Replaced text input with proper dropdown listing all agents (main, q35/Jess, codex, flash, bob, max) with model info
- **Model labels**: Dropdowns now show `model_name (size · backend)` so you can tell qwen3.5:35b-a3b-q8 (Ollama) from qwen3.5:35b-a3b-q8 (Jess · llama.cpp)
- **llama.cpp support**: models.py now routes to llama.cpp (port 18080) for Jess's model automatically. Uses /v1/chat/completions API.
- **DGX Dashboard**: Added "Other Models (llama.cpp / External)" section showing Jess's model with online/offline status, slot activity, agent name, port
- **Smart Session**: Also has agent dropdown now
- **Models tab**: Shows detailed cards with name, size, backend indicator (purple for Ollama, green for llama.cpp)
- Research Lab service restarted successfully

### Research Lab — Major Feature Drop (00:30)
- **Abort button**: ⛔ kills running sessions immediately, marks stage as failed
- **Paper export**: Auto-generates paper.md from writing+review stages with YAML frontmatter (title, session, agent, date, tokens)
- **Paper library**: New "Papers" tab — browse all completed papers with abstracts, download links, view session
- **Auto-RAG feeding**: When a session completes, hypothesis + writing + analysis + review + findings auto-index into the knowledge base. Future sessions reference past research.
- **Research iteration**: 🔄 Iterate button on completed sessions — feeds review feedback back into stages 3-7 (experiment_design → review), each cycle refines the work
- **Manual controls**: "Export Paper" and "Index to KB" buttons for completed sessions
- **Paper download**: Direct markdown download via `/api/papers/download/{session_id}`
- Cleaned 3 broken 35b Ollama models (~82GB freed), all 35b now routes to llama.cpp

### Model Lab — Unified Model Hub (00:40)
- New page at hub/27-model-lab/ combining Model Hub + Agent Eval
- **Models tab**: Cards for every model with eval scores, category bars, size, backend, vision capability
- **Chat Playground**: Inline chat sessions with any model. Supports text + image (for vision models). Shows thinking if enabled. Model selector dropdown with all discovered models.
- **Eval Details**: Full breakdown of all 6 eval categories with explanations of what each tests and why, plus per-model test-by-test results
- **Discovery**: Scans 10 common ports for model servers (Ollama, llama.cpp, vLLM, TGI, LM Studio, LocalAI). Shows what's alive and what models are available.
- Auto-merges Ollama models + llama.cpp model + eval profiles into unified cards
- Hub index updated to link to Model Lab instead of old Model Hub