Skip to content

feat: Webui improvement#607

Merged
Henry-811 merged 3 commits intodev/v0.1.23from
webui_improvement
Dec 10, 2025
Merged

feat: Webui improvement#607
Henry-811 merged 3 commits intodev/v0.1.23from
webui_improvement

Conversation

@ncrispino
Copy link
Copy Markdown
Collaborator

@ncrispino ncrispino commented Dec 10, 2025

feat: Webui improvement

Description

Improves automation mode and web UI integration to provide better progress monitoring capabilities when running MassGen in automated/headless workflows. Also adds auto-launch functionality and session management improvements.

Closes MAS-137

Key Features

1. Auto-Launch with URL Parameters

The web UI now supports URL parameters to auto-start coordination:

http://localhost:8000/?prompt=What%20is%202%2B2&config=/path/to/config.yaml

When using --web with a question and config, the browser auto-opens with the coordination already starting:

massgen --config config.yaml --web "What is 2+2?"
# Browser auto-opens and coordination starts immediately

New --no-browser flag to disable auto-opening:

massgen --config config.yaml --web --no-browser "What is 2+2?"

2. Combined --automation + --web Mode

When both flags are specified, the web UI shows an automation-friendly timeline view instead of the full interactive interface. This allows external tools (LLM agents, CI pipelines) to monitor coordination progress visually.

  • Simplified timeline-focused view with status header
  • Shows phase, elapsed time, question, and status.json path
  • Polls for active sessions and auto-connects
  • Suppressed verbose uvicorn logging to keep stdout clean

3. Status File Path Display

Automation mode now prints LOG_DIR and STATUS paths at startup for easy monitoring:

LOG_DIR: .massgen/massgen_logs/log_20251210_123456
STATUS: .massgen/massgen_logs/log_20251210_123456/turn_1/status.json

4. Enhanced Terminal Timeline Output

The SilentDisplay (used in automation mode) now prints a structured timeline showing votes, reasons, and results:

TIMELINE:
  [VOTE] agent_a -> agent_b
         Reason: More comprehensive approach...
  [RESULTS]
    agent_b: 2 votes (winner)
    agent_a: 1 vote

5. Session Management Improvements

  • Completed sessions persist: Sessions remain in the list after WebSocket disconnects
  • Session ID input: Manually connect to a session by entering its ID
  • Auto-connect to active sessions: In automation mode, automatically connects to running coordination sessions
  • Better session switching: State properly restores when switching sessions

Type of change

  • New feature (feat:) - Non-breaking change which adds functionality

Checklist

  • I have run pre-commit on my changed files and all checks pass
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Pre-commit status

uv run pre-commit run --files massgen/cli.py massgen/frontend/displays/silent_display.py massgen/frontend/displays/web_display.py massgen/frontend/web/server.py

How to Test

Test CLI Commands

  1. Auto-launch (browser opens automatically):

    massgen --config ~/.config/massgen/config.yaml --web "What is 2+2?"
    • Browser should auto-open with question pre-filled
    • Coordination should start automatically
  2. Auto-launch with --no-browser:

    massgen --config config.yaml --web --no-browser "What is 2+2?"
    • Server starts but browser doesn't open
    • URL printed in terminal includes auto-launch params
  3. Automation + Web mode:

    massgen --config config.yaml --automation --web "What is 2+2?"
    • Terminal shows LOG_DIR and STATUS paths
    • Browser shows simplified timeline view (not interactive view)
    • Timeline updates as coordination progresses
  4. Automation-only mode:

    massgen --config config.yaml --automation "What is 2+2?"
    • Verify TIMELINE section appears in output with votes and results
    • Verify status.json path is printed
  5. Interactive web mode (regression test):

    massgen --config config.yaml --web
    • Verify normal interactive web UI still works as before
  6. Session management:

    • Start coordination in one terminal
    • Open browser manually to http://localhost:8000
    • Session dropdown should show the active session
    • Can enter session ID manually to connect

Expected Results

Mode Terminal Output Web UI
--web "question" Auto-launch URL Auto-starts coordination
--automation --web LOG_DIR, STATUS, minimal logs Timeline view
--automation LOG_DIR, STATUS, TIMELINE N/A
--web Normal uvicorn logs Full interactive UI

Files Changed

CLI Changes

File Description
massgen/cli.py Add --no-browser flag, URL param generation, auto-open browser, pass automation_mode to server

Backend Changes

File Description
massgen/frontend/displays/silent_display.py Add _print_timeline() for structured vote output
massgen/frontend/displays/web_display.py Support automation mode state
massgen/frontend/web/server.py Handle automation_mode, completed sessions persistence, suppress verbose logs

Web UI Changes

File Description
webui/src/App.tsx URL param parsing, auto-start coordination, route to AutomationView
webui/src/components/AutomationView.tsx New - Timeline-focused automation view with session polling
webui/src/components/HeaderControls.tsx Session ID input field, layout improvements
webui/src/stores/agentStore.ts Track automationMode and logDir state
webui/src/types/index.ts Add new type definitions

Additional Context

This PR addresses the feature requests from the original issue:

  1. ✅ When --web and --automation are specified, web UI shows progress (timeline view)
  2. ✅ The --automation mode prints the location of status.json
  3. ✅ Terminal shows timeline with votes/results in automation mode

Additional improvements:

  • ✅ Auto-launch URL params for quick coordination start
  • ✅ Browser auto-opens when using --web with question+config
  • ✅ Sessions persist after completion for better tracking
  • ✅ Manual session ID input for connecting to specific sessions

@Henry-811 Henry-811 changed the base branch from main to dev/v0.1.23 December 10, 2025 16:32
@Henry-811 Henry-811 merged commit 38d7849 into dev/v0.1.23 Dec 10, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants