Skip to content

feat(slack): ack incoming messages with 👀 reaction#4

Merged
ibuildthings-instrumentl merged 1 commit intodevfrom
slack-receipt-ack
Apr 17, 2026
Merged

feat(slack): ack incoming messages with 👀 reaction#4
ibuildthings-instrumentl merged 1 commit intodevfrom
slack-receipt-ack

Conversation

@ibuildthings-instrumentl
Copy link
Copy Markdown
Collaborator

Why

Long-running Archon workflows currently have an awkward silent gap between "user hits send" and "bot finally posts its first status message" -- thread-history fetch, lock acquisition, planner warm-up, and first LLM token can easily add up to several seconds. During that time the user has no idea if the bot saw their message.

What

When Slack delivers an incoming message that passes auth and has content, Archon now immediately posts an 👀 reaction on that message -- before any orchestration work begins.

  • `SlackAdapter.acknowledgeReceipt(event)` calls `reactions.add` with `{ channel, timestamp, name: 'eyes' }`.
  • The call is wrapped in try/catch: missing `reactions:write` scope or `already_reacted` errors are logged and swallowed so they never block the conversation.
  • Server `onMessage` fires the ack with `void` (fire-and-forget) so the reaction HTTP round-trip never delays thread-history fetch or workflow dispatch.
  • Added `reactions:write` to the Starlight docs, the `archon` skill guide, and the `archon setup` CLI prompt as an optional scope (the bot still works without it -- you just don't get the visual receipt).

Tests

Three new unit tests in `packages/adapters/src/chat/slack/adapter.test.ts`:

  • Posts 👀 reaction with correct channel + timestamp on happy path.
  • Does not throw when `reactions:write` scope is missing (`missing_scope` error).
  • Silently skips on `already_reacted` (idempotent re-processing).

All 33 Slack adapter tests pass. Full workspace `type-check` is clean across all 10 packages. Lint-staged + prettier ran on commit.

Manual verification

After merge, restart `bun run dev`, grant the bot `reactions:write` in Slack, and @-mention it. You should see an 👀 appear on your message within ~100ms, well before the first status message posts.

Made with Cursor

When a user @mentions or DMs Archon, the bot now posts an 👀 reaction
on the incoming message the moment it's received -- before thread-history
fetch, lock acquisition, planner warm-up, or first LLM token. This
eliminates the awkward silent gap between "user hit send" and "bot
responds" for long-running workflows.

- SlackAdapter.acknowledgeReceipt(event) calls reactions.add; swallows
  errors so a missing reactions:write scope just skips the reaction
  instead of blocking the conversation.
- Server onMessage handler fires the ack right after auth/stripBotMention
  with void (fire-and-forget) so the reaction round-trip never delays
  orchestration.
- reactions:write added to the Starlight docs, skill guide, and CLI
  setup prompt as an optional scope.
- Three adapter tests cover the happy path, missing-scope failure, and
  already_reacted replay case.

Made-with: Cursor
@ibuildthings-instrumentl ibuildthings-instrumentl deleted the slack-receipt-ack branch April 20, 2026 16:21
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