#14618: feat(ui): add AgentHQ - agent workspace evolution viewer
app: web-ui
gateway
size: XL
Cluster:
UI Enhancements and Fixes
## Summary
Introduces **AgentHQ**, a comprehensive new dashboard tab that visualizes how agent workspace files (`.md` configuration files) evolve over time using git history. This feature enables operators to understand the complete history of their agent configurations—tracking when changes were made, by whom, and how the agent's "personality" has evolved.
## Key Features
### 🕐 Timeline View
Chronological listing of all changes with expandable details showing file-level diffs, timestamps, and commit messages.
### 🎨 Visual Evolution Mode
Card-based snapshots that highlight how agent configuration files have changed over time—perfect for understanding the progression of agent behavior tuning.
### 📊 Activity Heatmap
GitHub-style contribution graph showing activity patterns across workspace files. Instantly see periods of intense iteration vs. stability.
### 🔍 Diff Viewer
Side-by-side comparison with syntax highlighting for deep-diving into specific changes.
## New Git History Service (`src/services/git-history.ts`)
This PR introduces a **new reusable service layer** for git-based version tracking. The service provides:
### Core Capabilities
- **`isGitRepository(path)`** - Check if a directory is under git version control
- **`getGitRoot(path)`** - Find the root of the git repository containing a path
- **`getGitHistory(options)`** - Retrieve commit history with file-level change stats
- **`getGitDiff(path, sha, fileName)`** - Get detailed diff with hunks for a specific file at a commit
- **`getGitStats(options)`** - Aggregate statistics: activity by day, files changed, date ranges
- **`getFileAtCommit(path, sha, fileName)`** - Retrieve file content at any point in history
### Why This Matters
This service abstracts git operations into a clean, typed API that can be reused across OpenClaw. It enables:
1. **Version Recovery** - Restore any previous version of agent configuration files
2. **Change Auditing** - Full audit trail of who changed what and when
3. **Activity Analytics** - Understand usage patterns and iteration velocity
4. **Diff Analysis** - Programmatic access to line-by-line changes
The service handles edge cases like:
- Workspaces that aren't git repos (graceful degradation)
- Binary files in diffs
- Renamed/moved files
- Proper path resolution relative to git root
## Architecture
**Backend:**
- `src/services/git-history.ts` - Reusable git history parsing service (434 lines)
- `src/gateway/server-methods/agenthq.ts` - RPC handlers exposing 5 endpoints:
- `agenthq.agents.list` - List all agent workspaces with git status
- `agenthq.history.list` - Get paginated commit history
- `agenthq.history.stats` - Get activity statistics
- `agenthq.history.diff` - Get detailed diff for a commit/file
- `agenthq.summary.generate` - Placeholder for future LLM-powered summaries
**Frontend:**
- Modular view components split by visualization mode (~1000 lines of CSS)
- Full state management via Lit reactive properties (21 new state properties)
- Responsive design with collapsible sidebar and filter chips
- Dark/light theme support throughout
- 10 new icons (gitBranch, history, calendar, diff, eye, chevronDown, chevronRight, plus, minus, check)
## Use Cases
- **Debugging**: Understand when a specific agent behavior changed
- **Auditing**: Track who made configuration changes and when
- **Recovery**: Restore previous agent configurations if something breaks
- **Learning**: Study how well-tuned agents evolved over time
- **Collaboration**: Share agent evolution insights with team members
## Files Changed
| Category | Files | Lines |
|----------|-------|-------|
| New Service | `src/services/git-history.ts` | +434 |
| RPC Handlers | `src/gateway/server-methods/agenthq.ts` | +180 |
| UI Views | `ui/src/ui/views/agenthq*.ts` (6 files) | +1100 |
| Styles | `ui/src/styles/agenthq.css` | +1000 |
| State/Types | `ui/src/ui/app.ts`, `types.ts`, etc. | +400 |
| **Total** | **18 files** | **+3,439** |
## Screenshots
_Screenshots to be added after review_
---
Co-Authored-By: Warp <agent@warp.dev>
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
Adds a new **AgentHQ** UI tab that visualizes agent workspace `.md` file evolution using git history (timeline/visual cards/heatmap + diff view), plus a new backend git-history service and gateway RPC handlers to list agents, fetch history/stats, diff commits, and read file content at a commit. Integrates the tab into navigation, adds new Lit view components + controller state, and introduces dedicated CSS styles for the new dashboard.
<h3>Confidence Score: 3/5</h3>
- This PR is close, but has clear runtime integration issues that should be fixed before merge.
- Core UI/UX and backend scaffolding look coherent, but the AgentHQ controller is currently calling RPC methods/params that the gateway does not implement/accept (`agenthq.summary.generate`, `fileFilter`/`offset`), which will break filtering/summaries in production until aligned.
- ui/src/ui/controllers/agenthq.ts, src/gateway/server-methods/agenthq.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#21679: fix: Mission Control dashboard issues for agent status, stale sessi...
by thejawdoc · 2026-02-20
84.2%
#12168: feat: integrate Mission Control dashboard into Control UI
by riftagent-git · 2026-02-08
81.0%
#22977: fix(ui): resolve agent names from config in session dropdown
by NikhilGaddam · 2026-02-21
79.5%
#19560: docs: refactor agent workspace default location & bootstrap configu...
by ashinkuniyil · 2026-02-17
77.6%
#15852: fix: pass agentId when resolving IRC session paths
by MisterGuy420 · 2026-02-14
77.4%
#7892: Claude/setup agent firewall ww xsv
by starwreckntx · 2026-02-03
77.2%
#6616: Control UI: daily activity dashboard
by georgeykalangi · 2026-02-01
76.9%
#8522: feat(control-ui): Add Model Requests panel for real-time API monito...
by GiantAxeWhy · 2026-02-04
76.8%
#19316: feat(agents): add agentic engineering workflows and /workflow command
by ranausmanai · 2026-02-17
76.8%
#8546: Fix/config UI improvements
by RandomRaine · 2026-02-04
76.4%