Skip to content

slack: promote legacy-attachment content to message body text - #334

Open
Soony123 wants to merge 1 commit into
yc-software:mainfrom
Soony123:slack-attachment-body-text
Open

slack: promote legacy-attachment content to message body text#334
Soony123 wants to merge 1 commit into
yc-software:mainfrom
Soony123:slack-attachment-body-text

Conversation

@Soony123

@Soony123 Soony123 commented Aug 11, 2026

Copy link
Copy Markdown

Problem

Notification bots — GitHub's Slack app among them — post messages whose text is empty, with the content living only in legacy attachments (fallback/pretext/title/text). Every ingestion path read m.text alone, so these messages were invisible end to end:

  • the thread-reply dispatch dropped them as empty unprompted input,
  • the ambient judge filtered them out of its batch ((m.text ?? "").trim()), so an action-mode bot policy or standing orders aimed at such a bot could never fire,
  • the conversation view rendered them as blank lines.

Change

messageBodyText (in message-gating.ts, exported via slack/lib.ts) returns the text verbatim when present and otherwise composes the body from attachment content, preferring the richer pretext/title/text fields over the fallback summary. Applied at every ingestion site: both events.ts dispatches, mirror.ts surface ingestion, and conversation-view.ts rendering (including thread openers).

Verification

  • Unit tests added in test/slack-message-gating.test.ts (verbatim text, fallback composition, multi-attachment join, field preference).
  • Verified against a live instance: a label-filtered GitHub PR notification in a channel with standing orders now reaches the ambient judge with its body visible and produces an engagement (the agent reviewed the PR and commented). Before the change the same notification produced no ambient judgment at all — before/after visible in the surface cache: pre-change rows for such notifications have empty text, post-change rows carry the attachment body.
  • tsc --noEmit, eslint on touched files, and the slack message-gating/conversation/mirror test files all pass.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Notification bots (GitHub's Slack app among them) post messages whose text
is empty, with the content living only in legacy attachments (fallback/
pretext/title/text). Every ingestion path read m.text alone, so these
messages were invisible end to end: the thread dispatch dropped them as
empty unprompted input, the ambient judge filtered them out of its batch,
and the conversation view rendered them as blank lines. A channel with an
action-mode bot policy or standing orders aimed at such a bot could never
fire, because the judged batch never contained the notification body.

messageBodyText (message-gating) returns the text verbatim when present
and otherwise composes the body from attachment content, preferring the
richer pretext/title/text fields over the fallback summary. Applied at
every ingestion site: both events.ts dispatches, mirror.ts surface
ingestion, and conversation-view rendering (including thread openers).

Verified against a live instance: a label-filtered GitHub PR notification
in a channel with standing orders now reaches the ambient judge with its
body visible and produces an engagement; before the change the same
notification produced no judgment at all.
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.

1 participant