[kimi] Add /api/matrix/thoughts endpoint for recent thought stream (#677) #739
Reference in New Issue
Block a user
Delete Branch "kimi/issue-677"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #677
Summary
This PR adds the GET
/api/matrix/thoughtsendpoint that returns Timmy's recent thoughts formatted for Matrix display.Changes
src/dashboard/routes/world.py
_MAX_THOUGHT_LIMIT(50),_DEFAULT_THOUGHT_LIMIT(10), and_MAX_THOUGHT_TEXT_LEN(500) constants_build_matrix_thoughts_response()function to format thoughts for Matrix displayget_matrix_thoughts()endpoint at/api/matrix/thoughts:?limit=Nquery param (capped at 50, min 1)id,text(truncated to 500 chars),created_at,chain_idCache-Control: no-cache, no-storeheaderstests/dashboard/test_world_api.py
TestMatrixThoughtsEndpointtest class with comprehensive coverage:Acceptance Criteria
/api/matrix/thoughtsreturns last 10 thoughts as JSON array?limit=Nquery param (max 50)/thinking/apilogic, just reformats outputtox -e unitpassestox -e lintpasses