Repository navigation
test(bots): wait for attachment listing replies - #477
Merged
Merged
Conversation
The forwarded worker turn can finish after list_attachments and queue a separate bot follow-up. Its FIXTURE_OK reply may be the last message even though the listing already completed. Wait for the bot's tool response containing the attachment ID instead of assuming it is last. Related: #469
This was referenced Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The forwarding integration test can see
FIXTURE_OKas the last message afterlist_attachments: finishing the forwarded worker turn schedules a separate bot follow-up, whose reply can follow the listing response. CI run 42784104536 attempt 1 failed on that assumption.Wait for the bot-authored
TOOL_RESULTcontaining this attachment ID, using the existing boundedeventuallyhelper. Keep the assertion after the wait so a missing result still fails. The immediate forwarding-notice assertion and the blob, worker-path and attribution checks remain intact.This is a test race:
bot_messages.seq; equal timestamps do not make the returned order unstable.forwardedNoticeruns inside the fencedbotActiontransaction, before the forwarding tool completes.botQueue.finishinserts the answer and settles its turn in one transaction.botDeliveries.deliverschedules a distinct bot turn when the worker turn finishes. The scripted CLI repliesFIXTURE_OKto that notification.settled()can correctly return an idle conversation with that follow-up as its last message.Validation:
TMPDIR=/var/tmp bun run check:tmp tests/integration/bot-files.test.ts; 29 passed, run 8 reproduced the exact CI failure (Received: "FIXTURE_OK").check:tmp: nothing left in the temp dir.bun install,bun run typecheck,bun run lint,bun run format:check, andgit diff --checkpass.Only the requested integration file and allowed static checks were run locally; the full suite remains for CI. No product, protocol, schema or UI behavior changes.
Related: #469