Skip to content

fix(mission): receive prints a completion once - #142

Draft
xikimay wants to merge 2 commits into
mainfrom
fix/mission-completed-redelivery
Draft

xikimay wants to merge 2 commits into
mainfrom
fix/mission-completed-redelivery

Conversation

@xikimay

@xikimay xikimay commented Oct 8, 2026

Copy link
Copy Markdown
Owner

TLDR: --mission receive printed the same completed event again and again. It now waits until Nirux records the acknowledgement before it exits.

Problem

receive printed a completion, queued its acknowledgement, and exited at once. Nirux applies that queue a moment later (0.15 s debounce), so a receive run right away still read the completion as unconsumed and printed it again. A parent looping on receive got each finished Mission 6 to 8 times. The ledger shows it: the four completions in the report were marked consumed 0.15 s apart, once the queue was finally drained.

Questions were fine because reply already waits for Nirux to confirm.

Solution

After queueing the acknowledgement, receive waits for the ledger to record it (up to 5 s, the same bound as reply). Args, exit codes and JSON output are unchanged. New test testReceiveDeliversACompletionOnceWhenRunAgainRightAway fails without the fix (second receive returned 0, the same event) and passes with it.

🤖 Generated with Claude Code

xikimay and others added 2 commits October 9, 2026 00:12
receive queued the completion's acknowledgement and exited before Nirux
recorded it, so a receive run right away printed the same completion
again until the queue was drained. It now waits for that record, like
reply waits for its answer.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ent does

The test drained once after a fixed delay, so a slow machine could miss
the acknowledgement. It now drains until the completion is recorded,
while the two receives run back to back. confirmationTimeout sits before
pollInterval, as in reply.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant