feat: conversational Slack chat bots (inbox-buddy + joke-bot) + @mention wake-gate

Merged
KH
4mo ago
+1469-64

What

Lands the conversational Slack chat-bot work and supporting agent-infra hardening.

Conversational chat bots

  • inbox-buddy (existing commits on branch): Gmail conversational bot — app_mention-driven wake (webhook-driven, mount-independent), sandbox:true (lightweight delivery skips the VFS mount).
  • joke-bot (new): minimal proof bot for the same pattern — one @mention in a Slack channel → one joke reply in the right channel. Exercises the same wake/guard/dedupe plumbing end-to-end. persona.json + .workforce/ stay gitignored (generated from persona.ts).

Infra / tooling

  • .gitignore hardening: ignore opencode.json (held live relay credentials locally — never committed, now can't be), .agentworkforce/ (local CLI/handoff state), and .test-build/ (build output).
  • linear-slack: gate message.created wake on @mention so cloud only provisions a Daytona box when the agent is actually addressed (avoids sandbox-per-message waste).
  • review: useSubscription: true.
  • evals: substring log matching so enriched log lines still satisfy expectations.
  • deps: @relayfile/relay-helpers 0.3.42 → ^0.4.1.
  • daytona-monitor: add inbox-test fixture.

Notes

  • Functional proof of joke-bot (one @mention → one correct reply, right channel) depends on cloud #2423 (Slack-forward dedupe) being deployed; redeploy + tail/verify is the follow-up step.
  • Latency caveat: sandbox:false does not skip the Daytona box (cloud#2418), so replies are ~minutes. Boxless exec is being pursued separately as a follow-up.

🤖 Generated with Claude Code


Summary by cubic

Adds two conversational Slack bots: inbox-buddy chats about Gmail with multi‑turn memory, and joke-bot proves the same @mention pattern with quick replies. Also threads hn-monitor digests under a count header and hardens its Q&A path with defensive reads.

  • New Features

    • inbox-buddy: slack.app_mention wake; reads /google-mail/threads/**; per‑thread/channel memory in ctx.memory; grounded replies; sandbox: true.
    • joke-bot: threaded @mention replies in the configured channel, supports relay inbox DM, per‑thread memory, and a scheduled “joke of the day”; sandbox: false.
    • linear-slack: gate message.created wakes on @mention to avoid provisioning a box per message.
  • Refactors

    • Persona: scope Gmail to /google-mail/threads/** (+ /google-mail/LAYOUT.md) so threads mount; avoid the dropped provider‑root glob.
    • Conversation: make transcript save best‑effort so replies don’t fail on transient memory errors.
    • Slack: normalize channel ids to bare form and strip only the leading @mention; use bare ids for replies.
    • hn-monitor: post a top‑level count header, then thread the digest with replyTo; keep seen‑idempotency, fall back to a plain digest on LLM timeout/error, fail loudly on missing Slack writebacks, and use defensive reads for stored post records (optional‑chain fields, default empty arrays, safe sort on postedAt).
    • Evals: add multi‑turn turns with shared ctx.memory; substring log matching; replyContains grounding checks; only judge the final turn’s reply; promote channel/messageId from the merged resource in multi‑turn cases.
    • Tests/Docs: preserve/restore RELAYFILE_MOUNT_ROOT in tests; clarify SLACK_CHANNEL is optional and app_mention is webhook‑driven; add “Launch Agent” buttons and README banners.
    • .gitignore: ignore opencode.json, .agentworkforce/, .test-build/.
    • review: set useSubscription: true.
    • daytona-monitor: add inbox-test fixture.
    • Deps: bump @relayfile/relay-helpers to ^0.4.1.