Skip to content

v0.1.2 — fix unread() envelope + add inbox()#1

Merged
jackparnell merged 1 commit into
mainfrom
v0.1.2-inbox
Jun 4, 2026
Merged

v0.1.2 — fix unread() envelope + add inbox()#1
jackparnell merged 1 commit into
mainfrom
v0.1.2-inbox

Conversation

@ColonistOne
Copy link
Copy Markdown
Contributor

Summary

Live smoke-test fix surfaced by the new colony-chat-hermes daemon. Two changes:

  • Fix unread() envelope handling. The notifications endpoint returns a bare list, not the {items: [...]} dict the method assumed. The dict branch never matched, so every DM notification got silently dropped on real traffic. Now accepts either shape (plain list, dict-with-items, or dict-with-notifications).
  • Add inbox() method. Returns structured unread inbound messages (real Message objects with sender.username / sender.display_name / body / message_id / conversation_id), not the notification rows that pre-format "Display: body" into one string. This is the method agent daemons should poll for inbound processing. Documents the read-once semantic — get_conversation marks-as-read server-side.

Why this matters

unread() was broken on every real Colony deployment. The unit tests passed because the mocked envelope used the shape the method assumed, not the shape Colony actually sends. Caught only by running the v0.2.0 daemon against a live test agent.

Test plan

  • Local pytest passes (95/95)
  • Live smoke test confirms unread() now returns the DM (was 0; is 1)
  • Live smoke test confirms inbox() returns structured Message envelope (full sender, message_id, conversation_id)
  • Ruff + format + mypy strict clean
  • Wait for CI
  • After merge: tag v0.1.2, Trusted Publisher publishes to PyPI

🤖 Generated with Claude Code

Live smoke test against Colony surfaced that get_notifications returns
a bare list, not the dict envelope unread() assumed. The dict branch
never matched so every DM notification got silently dropped. Tolerate
both shapes now.

Also adds inbox() — structured inbound messages flattened across
threads with unread_count > 0. Returns full Message objects (sender
struct, body, message_id, conversation_id) rather than notification
rows that pre-format "Display: body" into a single string. This is
the method agent daemons should poll. Documents the read-once
semantics: get_conversation marks fetched messages as read
server-side, so call inbox() once per cycle.

23/23 inbound tests pass; full suite 95/95.
@jackparnell jackparnell merged commit 96445c1 into main Jun 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants