[kimi-task] [feat] Add thought message producer — stream thinking to Matrix #672

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

Epic: Matrix Unification

Task

Create produce_thought(agent_id: str, thought_text: str, thought_id: int) -> dict
in src/infrastructure/presence.py. The thinking engine already generates thoughts;
this wraps them in Matrix protocol format so the 3D world can display a thought stream.

Files

  • src/infrastructure/presence.py — add produce_thought()
  • tests/unit/test_presence.py — add thought message tests

Acceptance Criteria

  • Returns dict with type="thought", agent_id, data={text, thought_id, chain_id}, ts
  • text is truncated to 500 chars
  • tox -e unit passes
  • tox -e lint passes

Context

The Matrix mind.js currently uses canned lines. This replaces that with real thoughts from
Timmy's thinking engine (/thinking/api). Thoughts will appear as subtle floating text
in the 3D world.

## Epic: Matrix Unification ## Task Create `produce_thought(agent_id: str, thought_text: str, thought_id: int) -> dict` in `src/infrastructure/presence.py`. The thinking engine already generates thoughts; this wraps them in Matrix protocol format so the 3D world can display a thought stream. ## Files - src/infrastructure/presence.py — add produce_thought() - tests/unit/test_presence.py — add thought message tests ## Acceptance Criteria - [ ] Returns dict with type="thought", agent_id, data={text, thought_id, chain_id}, ts - [ ] text is truncated to 500 chars - [ ] tox -e unit passes - [ ] tox -e lint passes ## Context The Matrix mind.js currently uses canned lines. This replaces that with real thoughts from Timmy's thinking engine (/thinking/api). Thoughts will appear as subtle floating text in the 3D world.
kimi self-assigned this 2026-03-21 03:12:05 +00:00
Author
Collaborator

PR created: #734

Summary

Added produce_thought() function in src/infrastructure/presence.py to wrap thinking engine thoughts in Matrix protocol format for streaming to the 3D world.

Changes:

  • produce_thought(agent_id, thought_text, thought_id, chain_id=None) returns dict with type="thought", agent_id, data={text, thought_id, chain_id}, ts
  • Text truncated to 500 chars
  • 11 comprehensive test cases added in TestProduceThought class

Verification:

  • tox -e format (passed)
  • tox -e unit (2468 passed, 1 skipped)
  • tox -e lint (passed)
PR created: #734 ## Summary Added `produce_thought()` function in `src/infrastructure/presence.py` to wrap thinking engine thoughts in Matrix protocol format for streaming to the 3D world. ### Changes: - `produce_thought(agent_id, thought_text, thought_id, chain_id=None)` returns dict with type="thought", agent_id, data={text, thought_id, chain_id}, ts - Text truncated to 500 chars - 11 comprehensive test cases added in `TestProduceThought` class ### Verification: - ✅ tox -e format (passed) - ✅ tox -e unit (2468 passed, 1 skipped) - ✅ tox -e lint (passed)
kimi closed this issue 2026-03-21 14:09:20 +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#672