[kimi-task] [feat] Add Pip familiar state to agent_state messages #676

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

Epic: Matrix Unification

Task

Extend the agent_state message for Timmy to include Pip familiar state. The Workshop
already has a Pip behavioral state machine (familiar.py). Include Pip's state in the
agent_state so the Matrix can render the familiar orb.

Files

  • src/infrastructure/presence.py — extend produce_agent_state() to include familiar field
  • tests/unit/test_presence.py — add test for familiar data in agent_state

Acceptance Criteria

  • agent_state.data.familiar includes: name, mood, energy, color, trail_color
  • Falls back to default Pip state if familiar module not available
  • Does not crash if familiar.py raises an exception
  • tox -e unit passes
  • tox -e lint passes

Context

Pip is an emerald green glowing orb (core 0x00b450) with gold particle trail (0xdaa520).
Behavioral states: curious, content, alert, sleepy, playful. Energy decays over time.
The Matrix (js/familiar.js, issue #86) needs this data to animate Pip.

## Epic: Matrix Unification ## Task Extend the agent_state message for Timmy to include Pip familiar state. The Workshop already has a Pip behavioral state machine (familiar.py). Include Pip's state in the agent_state so the Matrix can render the familiar orb. ## Files - src/infrastructure/presence.py — extend produce_agent_state() to include familiar field - tests/unit/test_presence.py — add test for familiar data in agent_state ## Acceptance Criteria - [ ] agent_state.data.familiar includes: name, mood, energy, color, trail_color - [ ] Falls back to default Pip state if familiar module not available - [ ] Does not crash if familiar.py raises an exception - [ ] tox -e unit passes - [ ] tox -e lint passes ## Context Pip is an emerald green glowing orb (core 0x00b450) with gold particle trail (0xdaa520). Behavioral states: curious, content, alert, sleepy, playful. Energy decays over time. The Matrix (js/familiar.js, issue #86) needs this data to animate Pip.
kimi self-assigned this 2026-03-21 03:12:09 +00:00
Author
Collaborator

PR created: #738

Summary of Changes

src/infrastructure/presence.py

  • Added DEFAULT_PIP_STATE constant with Pip familiar defaults:
    • name: "Pip"
    • mood: "sleepy"
    • energy: 0.5
    • color: "0x00b450" (emerald green)
    • trail_color: "0xdaa520" (gold)
  • Added _get_familiar_state() helper with graceful error handling
  • Extended produce_agent_state() to include familiar in data dict

tests/unit/test_presence.py

  • Added TestFamiliarState class with 5 test cases
  • Added tests for familiar data in produce_agent_state() output
  • Tests verify fallback behavior on exception

All acceptance criteria met. All tests pass (2507 passed).

PR created: #738 ## Summary of Changes ### src/infrastructure/presence.py - Added `DEFAULT_PIP_STATE` constant with Pip familiar defaults: - name: "Pip" - mood: "sleepy" - energy: 0.5 - color: "0x00b450" (emerald green) - trail_color: "0xdaa520" (gold) - Added `_get_familiar_state()` helper with graceful error handling - Extended `produce_agent_state()` to include `familiar` in `data` dict ### tests/unit/test_presence.py - Added `TestFamiliarState` class with 5 test cases - Added tests for familiar data in `produce_agent_state()` output - Tests verify fallback behavior on exception All acceptance criteria met. All tests pass (2507 passed).
kimi closed this issue 2026-03-21 14:37:40 +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#676