workflow: add_reaction action calls a nonexistent relay endpoint — any workflow using it always fails
- Dominant language
- Rust
- Stars
- 32.7k
- Forks
- 4.3k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 253
Description
## Summary
The workflow engine's `add_reaction` action can never succeed: it POSTs to `{BUZZ_RELAY_BASE_URL:-http://localhost:3000}/api/messages/{message_id}/reactions` (`crates/buzz-workflow/src/executor.rs`, `add_reaction_impl`), but the relay has no such route — `router.rs` defines no `/api/messages/*` paths. Every invocation gets the SPA/404 fallback:
```
webhook error: AddReaction: relay returned 404 Not Found for message :
```
Because a failed step aborts the run, any workflow that uses `add_reaction` as an early step (e.g. an ack-reaction before a `send_message`) silently kills the whole workflow — from the user's perspective, "the workflow doesn't fire."
## Repro
1. Create a `message_posted` workflow whose first step is `action: add_reaction`.
2. Post a matching message.
3. `workflow_runs` shows `status=failed`, `error_message` as above; subsequent steps never run.
4. `curl -X POST http://127.0.0.1:3000/api/messages/deadbeef/reactions` → 404 (route absent).
Also note the manual-trigger path (kind:46020) fails differently — "AddReaction: no trigger.message_id available" — which is arguably correct, but combined with the missing route the action is unusable everywhere.
## Suggested fix
Either implement the action through the relay's real reaction path (build a kind:7 event via the workflow sink, like `send_message` does — no HTTP round-trip needed since the engine runs in-process), or remove/feature-gate the action until it works. If kept HTTP-based, it also needs the host-scoped community binding (`localhost:3000` vs the deployment host) taken into account.
Found while debugging with #2385 / #2390 — happy to PR the in-process kind:7 approach.
Contributor guide
Research direction
Start in crates/buzz-workflow/src/executor.rs at add_reaction_impl and compare its relay request with router.rs and the send_message workflow sink path. Reproduce the missing-route failure with the documented curl command, then verify that a message_posted workflow can complete its reaction step and continue to later steps without a 404.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100