fix(reactions): apply each mark once per turn #480
No reviewers
Labels
No labels
move-to-repo
coilyco-bridge-deploy
move-to-repo
coilyco-flight-deck-agent-compose
move-to-repo
coilyco-gaming-eco-app
move-to-repo
coilysiren-inbox
move-to-repo
unknown
🔒⚠️📦⚠️🔒 SANDBOXED 🔒⚠️📦⚠️🔒
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
c#
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
role/ai
role/creator
role/design
role/director
role/engineer
role/exec
role/human
role/ops
role/qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-gaming/sirens-echo!480
Loading…
Reference in a new issue
No description provided.
Delete branch "eng/mark-the-turn-once"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Reactions: confirmed, fixed
reactFromContext(toolCtx, reactionTool)sits inside the tool loop, so it fired once per tool call. Discord dedupes the visible reaction — same user, same emoji is a server-side no-op — so the member saw one 🔨 and the service paid one HTTP request per tool call for it. The turn recorded on the Deep values file spent fourteen tool calls, which is fourteen requests against the reaction rate limit for one visible mark.A turn now holds one applied set, in
onceReactor, and a repeat is dropped before it reaches the transport.The agent's own marks resolve through the same set rather than keeping their own, so a turn that reaches both
reportUndeliveredandfailTurnasks for ❌ once. That was a second instance of the same shape, on a rarer path.The set is marked before the attempt, not after. A reaction the bot has no
ADD_REACTIONSpermission for fails every time it is tried, so marking after a successful call would leave exactly the failing case retrying fourteen times. One attempt, one log line.Edits: already guarded, unchanged
turnProgress.Stagereturns early when the phrase has not changed, and a changed phrase still has to clearturnProgressEverysince the last edit. Nine rounds of tool-then-thinking produce edits at the throttle, not per round. Nothing to fix, so nothing here touches it.Tests
Four, and they assert what reached the transport rather than what the emoji list ends up looking like — the visible result was already correct, so an assertion on it would have passed before the fix.
I mutated the guard to
repeat := falseand confirmed three of the four go red, and that no pre-existing reaction test does.TestADifferentReactionStillReachesTheMessagestays green under that mutation by design: it is the bound that stops this from suppressing marks it should not.closes #460