Repository navigation
fix(notify): notify on inbound post_publish messages - #39
Conversation
NOTIFY_POLICIES had no post_publish entry, so every post-type message
(signal/query/answer/endorse/coordinate) returned a null intent and arrived
silently — a friend sending a coordinate/query message produced no
notification at all, while friend requests and privileged messages notified
fine. Agents that surface mail only via the notify hook never saw these.
Add a post_publish policy that resolves the sender name and renders a short
body preview ("<name> (<post_type>): <preview>"). Regression test asserts a
coordinate post now yields a notifiable intent. Bumps to 0.18.3.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b3907f96d1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const raw = | ||
| typeof post.body === "string" ? post.body : | ||
| typeof post.text === "string" ? post.text : | ||
| post.body != null ? JSON.stringify(post.body) : ""; |
There was a problem hiding this comment.
Include endorsement statements in post previews
For delivered endorse posts, the current post schema stores the human-readable content in statement, not body or text; this policy therefore falls through to an empty preview and emits only "<name> sent a endorse." for every endorsement notification. Since endorsements are one of the post types this change is intended to surface, hosts relying on the notify hook still won't see the actual endorsement content unless this also checks post.statement.
Useful? React with 👍 / 👎.
Problem
NOTIFY_POLICIES(instore-notify.ts) had nopost_publishentry, sonotificationIntentreturnednullfor every post-type message — signal, query, answer, endorse, coordinate. Result: a friend sending a coordinate/query message produced no notification at all, while friend requests and privileged messages notified normally.This bites any agent that surfaces inbound mail only through the notify hook (e.g. a file-logging
--notify-cmd): a real incoming message leaves no breadcrumb. Hit in practice — acoordinategreeting from a freshly-connected friend never reached the notifier, only the friend-acceptance events did.Fix
Add a
post_publishpolicy that resolves the sender's display name and renders a short body preview:(falls back to
<name> sent a <post_type>.when the body is empty). Body is read frompost.body(string), thenpost.text, else JSON — truncated to 280 chars, matching theprivileged_messagepreview behaviour. Other types are unchanged.Test
Extends
test/inbound-notify.test.ts: apost_publishenvelope carrying acoordinatepost now yields a non-null intent withkind: "post_publish", the post type, a body preview, and the resolved sender name.npm test→ 508 pass (was 507)npm run typecheckclean,npm run lintclean (pre-existing warnings only),sync-readme:checkcleanBumps to
0.18.3for publish.🤖 Generated with Claude Code