[kimi-task] [feat] Add /api/matrix/thoughts endpoint — recent thought stream #677

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

Epic: Matrix Unification

Task

Add GET /api/matrix/thoughts endpoint that returns Timmy's recent thoughts formatted
for Matrix display. This is the REST companion to the thought WebSocket messages.

Files

  • src/dashboard/routes/world.py — add /api/matrix/thoughts route
  • tests/timmy/test_world_api.py — add test

Acceptance Criteria

  • GET /api/matrix/thoughts returns last 10 thoughts as JSON array
  • Each thought has: id, text (truncated to 500 chars), created_at, chain_id
  • Optional ?limit=N query param (max 50)
  • Reuses existing /thinking/api logic, just reformats output
  • Returns empty array if thinking engine is disabled
  • tox -e unit passes
  • tox -e lint passes

Context

The Matrix mind.js generates canned contextual lines. Replacing with real thoughts
makes Timmy feel alive — visitors see what he's actually thinking about.

## Epic: Matrix Unification ## Task Add GET /api/matrix/thoughts endpoint that returns Timmy's recent thoughts formatted for Matrix display. This is the REST companion to the thought WebSocket messages. ## Files - src/dashboard/routes/world.py — add /api/matrix/thoughts route - tests/timmy/test_world_api.py — add test ## Acceptance Criteria - [ ] GET /api/matrix/thoughts returns last 10 thoughts as JSON array - [ ] Each thought has: id, text (truncated to 500 chars), created_at, chain_id - [ ] Optional ?limit=N query param (max 50) - [ ] Reuses existing /thinking/api logic, just reformats output - [ ] Returns empty array if thinking engine is disabled - [ ] tox -e unit passes - [ ] tox -e lint passes ## Context The Matrix mind.js generates canned contextual lines. Replacing with real thoughts makes Timmy feel alive — visitors see what he's actually thinking about.
kimi self-assigned this 2026-03-21 03:12:09 +00:00
Author
Collaborator

PR created: #739

Summary

Implemented the /api/matrix/thoughts endpoint as specified.

Changes:

  • src/dashboard/routes/world.py: Added GET /api/matrix/thoughts endpoint

    • Returns last 10 thoughts by default (configurable via ?limit=N, max 50)
    • Each thought has: id, text (truncated to 500 chars), created_at, chain_id
    • Gracefully returns empty array if thinking engine is disabled/fails
    • Reuses existing thinking_engine.get_recent_thoughts() logic
  • tests/dashboard/test_world_api.py: Added 11 comprehensive tests covering all acceptance criteria

Verification:

  • tox -e unit passes (2518 tests)
  • tox -e lint passes
  • tox -e format passes
PR created: [#739](http://143.198.27.163:3000/rockachopa/Timmy-time-dashboard/pulls/739) ## Summary Implemented the `/api/matrix/thoughts` endpoint as specified. ### Changes: - **src/dashboard/routes/world.py**: Added GET `/api/matrix/thoughts` endpoint - Returns last 10 thoughts by default (configurable via `?limit=N`, max 50) - Each thought has: `id`, `text` (truncated to 500 chars), `created_at`, `chain_id` - Gracefully returns empty array if thinking engine is disabled/fails - Reuses existing `thinking_engine.get_recent_thoughts()` logic - **tests/dashboard/test_world_api.py**: Added 11 comprehensive tests covering all acceptance criteria ### Verification: - ✅ `tox -e unit` passes (2518 tests) - ✅ `tox -e lint` passes - ✅ `tox -e format` passes
kimi closed this issue 2026-03-21 14:44: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#677