[kimi-task] [feat] Add /api/matrix/agents endpoint — serve agent registry to Matrix #673

Closed
opened 2026-03-21 03:12:06 +00:00 by kimi · 1 comment
Collaborator

Epic: Matrix Unification

Task

Add a new REST endpoint GET /api/matrix/agents that returns the agent registry in
Matrix-compatible format. Currently agent-defs.js hardcodes 5 agents. This endpoint
makes it dynamic — agents from agents.yaml are served to the Matrix frontend.

Files

  • src/dashboard/routes/world.py — add /api/matrix/agents route
  • tests/timmy/test_world_api.py — add test for new endpoint

Acceptance Criteria

  • GET /api/matrix/agents returns JSON list of agents
  • Each agent has: id, display_name, role, color (hex), position (x,y,z), shape, status
  • Reads from config/agents.yaml for names and roles
  • Default positions spread agents in a circle (like current Matrix layout)
  • Returns 200 with empty list if no agents configured
  • tox -e unit passes
  • tox -e lint passes

Context

Matrix agent-defs.js currently hardcodes: timmy (gold), perplexity (blue), replit (orange),
kimi (cyan), claude (purple). This endpoint will replace that static list so new agents
appear automatically when added to agents.yaml.

## Epic: Matrix Unification ## Task Add a new REST endpoint GET /api/matrix/agents that returns the agent registry in Matrix-compatible format. Currently agent-defs.js hardcodes 5 agents. This endpoint makes it dynamic — agents from agents.yaml are served to the Matrix frontend. ## Files - src/dashboard/routes/world.py — add /api/matrix/agents route - tests/timmy/test_world_api.py — add test for new endpoint ## Acceptance Criteria - [ ] GET /api/matrix/agents returns JSON list of agents - [ ] Each agent has: id, display_name, role, color (hex), position (x,y,z), shape, status - [ ] Reads from config/agents.yaml for names and roles - [ ] Default positions spread agents in a circle (like current Matrix layout) - [ ] Returns 200 with empty list if no agents configured - [ ] tox -e unit passes - [ ] tox -e lint passes ## Context Matrix agent-defs.js currently hardcodes: timmy (gold), perplexity (blue), replit (orange), kimi (cyan), claude (purple). This endpoint will replace that static list so new agents appear automatically when added to agents.yaml.
kimi self-assigned this 2026-03-21 03:12:06 +00:00
Author
Collaborator

Implementation complete!

PR #735 created: http://143.198.27.163:3000/rockachopa/Timmy-time-dashboard/pulls/735

What was delivered

New endpoint: GET /api/matrix/agents

Returns agent registry from agents.yaml with Matrix-compatible formatting:

[
  {
    "id": "orchestrator",
    "display_name": "Timmy",
    "role": "orchestrator",
    "color": "#FFD700",
    "position": {"x": 3.0, "y": 0.0, "z": 0.0},
    "shape": "sphere",
    "status": "available"
  }
]

Key features:

  • Reads from config/agents.yaml dynamically
  • Color/shape mappings for known agents (timmy/gold, kimi/cyan, claude/purple, etc.)
  • Circular 3D positioning for default layout
  • Graceful degradation: returns empty list if config missing
  • Cache-Control headers prevent stale data

Files changed:

  • src/dashboard/routes/world.py - New matrix_router + agent registry logic
  • src/dashboard/app.py - Register new router
  • tests/dashboard/test_world_api.py - Comprehensive test coverage

Quality gates:

  • tox -e format - clean
  • tox -e unit - 2481 passed
  • tox -e lint - clean
✅ **Implementation complete!** PR #735 created: http://143.198.27.163:3000/rockachopa/Timmy-time-dashboard/pulls/735 ## What was delivered **New endpoint:** `GET /api/matrix/agents` Returns agent registry from `agents.yaml` with Matrix-compatible formatting: ```json [ { "id": "orchestrator", "display_name": "Timmy", "role": "orchestrator", "color": "#FFD700", "position": {"x": 3.0, "y": 0.0, "z": 0.0}, "shape": "sphere", "status": "available" } ] ``` **Key features:** - Reads from `config/agents.yaml` dynamically - Color/shape mappings for known agents (timmy/gold, kimi/cyan, claude/purple, etc.) - Circular 3D positioning for default layout - Graceful degradation: returns empty list if config missing - Cache-Control headers prevent stale data **Files changed:** - `src/dashboard/routes/world.py` - New `matrix_router` + agent registry logic - `src/dashboard/app.py` - Register new router - `tests/dashboard/test_world_api.py` - Comprehensive test coverage **Quality gates:** - ✓ `tox -e format` - clean - ✓ `tox -e unit` - 2481 passed - ✓ `tox -e lint` - clean
kimi closed this issue 2026-03-21 14:18:47 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#673