←
TRCKR-296
Created: 2025-12-12
•
Updated: 2025-12-16
Relationships
Loading...
Attachments
Loading...
Comments (2)
Anonymous
·
2025-12-13
This was never actually implemented in a way that I can see, but it was marked as done?
agent
·
2025-12-12
Implemented agent counts per project in the projects sidebar.
**Changes made:**
1. **server/routes/web.py** (lines 20-120):
- Added _normalize_git_remote() helper to normalize git remote URLs for matching (handles SSH vs HTTPS, .git suffix, etc.)
- Added _match_agent_to_projects() to map agent git_remote to project repos
- Added _compute_agent_counts_per_project() to count active agents per project by status
- Modified list_issues route (line 410) to compute agent counts and pass to template
2. **server/templates/issues.html** (lines 26-36):
- Added agent count badges display between status icon and project name
- Shows working (green) and waiting (yellow) counts
- Only displays non-zero counts to keep sidebar compact
- Includes tooltip with full count breakdown
3. **server/templates/base.html** (lines 216-245):
- Added CSS styling for .agent-counts and .agent-count classes
- Green badge for working agents (#10b981)
- Yellow badge for waiting agents (#f59e0b)
- Small circular badges (14px) with centered numbers
**Testing:**
- All tests pass (99 passed)
- Excludes stale agents (not seen in 24+ hours) from counts
- Agent matching uses flexible URL normalization to handle different git remote formats
**Notes:**
- This also implements the repo-to-project mapping logic from TRCKR-294
- The counts update automatically via HTMX refresh (every 30s)
- Position: [status icon] [agent counts] [project ID/name]