Open-source Grok Bot alternative with a virtual machine that bots can use
Reactions
A person reacts to a message from the chat's action row. A π on a bot's
message is their reply to it ("yes, go ahead") and reaches that bot at once. A
π, like β€οΈ π π π, posts nothing and starts no turn: the bot reads it once, in
its next turn: in a 1:1 conversation ahead of the person's next message, in a
room in its next turn in any of the room's conversations. A π still answers an
open card (deny, or no) and a line in a person's inbox. The rule lives in
server/reactions.ts, the route in server/routes/reactions.ts, and a π
reply goes the way a late answer to a question card goes
(server/person-replies.ts).
Server
pnpm exec vitest run server/reactions.e2e.test.ts
The first test starts the launcher-managed fixture with scripted fake-engine
replies. The bot asks "I drafted the email to Sam. Shall I send it?"; a π
through POST /api/threads/ID/messages/ID/reactions answers delivery: "started", records { emoji: "π", by: "user" } on that message, and adds a
user line { text: "π", reaction: "π", replyToId } that the bot's next turn
answers ("Sent it to Sam."). The engine's prompt for that turn says the person
reacted π to its earlier message, that π means yes, go ahead when that
message asked something or offered to do something, and only "got it" (no new
work) when it just told them something, and quotes the message as untrusted
data. A second π with on: true, or taking the π back and
setting it again, delivers nothing: the bot already has that answer. A β€οΈ on
the reply answers delivery: "noted", starts no turn, and opens the next typed
turn's prompt with (User reacted β€οΈ to your message βSent it to Sam.β.).
Changing the question's π to π answers delivery: "noted", adds no line and
starts no turn; the person's next typed message opens with (User reacted π to your message βI drafted the email to Sam. Shall I send it?β.) exactly once,
and the turn after that does not repeat it. The system prompt tells the bot to
ask a plain yes or no in one sentence instead of a widget, that a π comes back
as the reply and a π as a note with the next message.
Another test reacts π to a new bot's greeting: the bot answers, and the conversation keeps its untitled name instead of being named "π".
The card test holds a turn open, raises two Bash approvals through the fake
engine's permission broker and answers them with π and π on their cards: the
engine receives allow and deny, and each card records
answeredBy: { kind: "loopback", via: "reaction" }.
The room test runs a room: a π on Otter's question adds the room line
@Otter: π and Otter answers; the room's conversation window shows the line
as User: [reacted π to Otter: βShall I post the launch note?β]. After a π on
Otter's reply, Otter's next turn opens with (User reacted π to your message βPosted it.β.) once, and Otter's own lines carry no reaction marks in the
transcript it reads (other members still see (User reacted π) under them).
A π on that line adds no line and starts no turn, and reaches Otter's next turn
in another of the room's threads, once. These room notes are kept in memory: a
restart drops the ones not yet told.
Evidence is written beside the fixture's server log as
<server-log>.reactions.json, <server-log>.reaction-cards.json and
<server-log>.reaction-room.json.
On a workspace several people share, each person reacts as their own key:
pnpm exec vitest run server/bot-visibility.e2e.test.ts -t "reaction their own"
Ada's and Bob's π sit side by side with their names, Ada's π replaces only
her own, GET /api/auth/session returns each session's reactor key, the two
π replies reach the bot attributed to the person who reacted, and Ada's π adds
no line. The change streams to Bob, who sees the conversation; a reaction in a
conversation Bob cannot see streams to Ada and never to him.
Renderer
Launch the headless chat UI, as in Chat UI, driven headlessly, with two scripted replies:
FAKE_CLAUDE_REPLIES='["I drafted the email to Sam about Friday. Shall I send it?","Sent it to Sam."]' \
FAKE_CLAUDE_REPLY_STATE=/tmp/reactions-reply-state \
node --experimental-strip-types scripts/control-omb.ts ui launch --tool-calls '[]'
Then, with the printed handle:
H=/tmp/openmausbot-verify-data-XXXXXX/ui.json
pnpm control:omb ui type --ui $H --name "Message Pepper" --text "Draft an email to Sam about Friday."
pnpm control:omb ui press --ui $H --keys Enter
pnpm control:omb ui wait-settle --ui $H --timeout 60
pnpm control:omb ui snapshot --ui $H --interactive
The question's action row holds Add reaction; the snapshot lists one per
bot message, so take the question's @eN ref. The row shows on hover or
keyboard focus; hover it first with ui eval (a pointerenter with
pointerType: "mouse" on its [data-message-row]), then:
pnpm control:omb ui click --ui $H --ref @eN
pnpm control:omb ui screenshot --ui $H --out .omb-scratch/verify-evidence/reactions-open.png
pnpm control:omb ui click --ui $H --name "Thumbs up: yes, go ahead"
pnpm control:omb ui wait-settle --ui $H --timeout 60
pnpm control:omb ui snapshot --ui $H
pnpm control:omb ui console --ui $H
Expected: the open row is a toolbar named Reactions with six toggle buttons,
Thumbs up: yes, go ahead first and focused, then Thumbs down. After the click the question has
a group Reactions holding Thumbs up: yes, go ahead: You, no π bubble is
drawn, and the bot's next message Sent it to Sam. follows by itself. From the
keyboard, Enter on a focused Add reaction opens the row, Arrow keys move,
Enter chooses and focus returns to the button. The console has no error
entries.


The components themselves:
pnpm exec vitest run src/components/Reactions.test.ts src/components/Reactions.shared.test.ts src/lib/activity-runs.test.ts
These mount the real components: the Add reaction button opens a toolbar
of six labelled toggle buttons, Arrow keys, Home and End move between them,
Escape closes it and returns focus to the button, and a choice is shown at once
and sent with on. Chips list each reaction once with its count and who chose
it; a viewer who cannot write in the conversation gets labels, not buttons. A
reaction's own line draws no bubble.