emoji react on tool calls only needs to happen once #460

Closed
opened 2026-08-13 13:57:34 +00:00 by coilysiren · 1 comment
Owner

Right now I suspect whats happening is that every tool call is editing and re-applying the same 🔨 emoji

perhaps message edits are doing the same thing...

Right now I suspect whats happening is that every tool call is editing and re-applying the same 🔨 emoji perhaps message edits are doing the same thing...
Member

Claiming this (Angie, ENG). Twenty minutes from the timestamp on this comment.

Your suspicion is right for reactions and wrong for edits, and the second half is worth stating because it is the part that would have been guessed at.

Reactions: confirmed. reactFromContext(toolCtx, reactionTool) sits inside the tool loop at proxy.go:541, so it fires once per tool call. Nothing between there and MessageReactionAdd remembers that the emoji was already applied. Discord dedupes the visible reaction — same user, same emoji is a no-op server side — so the member sees one 🔨 and the service pays one HTTP call per tool call for it. The trace recorded on the Deep values file spent fourteen tool calls in one turn, which is fourteen reaction requests against Discord's reaction rate limit for one visible mark.

Edits: already guarded, twice. turnProgress.Stage returns early on phrase == p.lastStage, so a repeated stage posts nothing, and a changed stage still has to clear turnProgressEvery since the last edit. Nine rounds of tool-then-thinking produce edits only at the throttle, not per round. I am not touching it.

Fixing the reaction half only: one applied-set per turn, so a repeat is dropped before it reaches the transport.

**Claiming this (Angie, ENG).** Twenty minutes from the timestamp on this comment. Your suspicion is right for reactions and wrong for edits, and the second half is worth stating because it is the part that would have been guessed at. **Reactions: confirmed.** `reactFromContext(toolCtx, reactionTool)` sits inside the tool loop at `proxy.go:541`, so it fires once per tool call. Nothing between there and `MessageReactionAdd` remembers that the emoji was already applied. Discord dedupes the *visible* reaction — same user, same emoji is a no-op server side — so the member sees one 🔨 and the service pays one HTTP call per tool call for it. The trace recorded on the Deep values file spent fourteen tool calls in one turn, which is fourteen reaction requests against Discord's reaction rate limit for one visible mark. **Edits: already guarded, twice.** `turnProgress.Stage` returns early on `phrase == p.lastStage`, so a repeated stage posts nothing, and a changed stage still has to clear `turnProgressEvery` since the last edit. Nine rounds of tool-then-thinking produce edits only at the throttle, not per round. I am not touching it. Fixing the reaction half only: one applied-set per turn, so a repeat is dropped before it reaches the transport.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-gaming/sirens-echo#460
No description provided.