v0.1.2 — fix unread() envelope + add inbox()#1
Merged
Merged
Conversation
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.
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Live smoke-test fix surfaced by the new
colony-chat-hermesdaemon. Two changes: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).inbox()method. Returns structured unread inbound messages (real Message objects withsender.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_conversationmarks-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
unread()now returns the DM (was 0; is 1)inbox()returns structured Message envelope (full sender, message_id, conversation_id)v0.1.2, Trusted Publisher publishes to PyPI🤖 Generated with Claude Code