Skip to content

🤖 tests: agentSession queueDispatch rejected-dispatch test flakes in CI #4572

Description

@ThomasK33

Summary

src/node/services/agentSession.queueDispatch.test.ts › "rejected queued dispatch surfaces through onAcceptedPreStreamFailure" fails intermittently in CI's Test / Unit (6/6) shard. It passes locally, 3 of 3 runs on the pinned Bun 1.3.5.

Occurrences

Both are on PR #4560, which does not touch AgentSession, at head b6e692b4a8:

  • PR CI run 36151943919, job "Test / Unit (6/6)". It passed on rerun.
  • Merge-group run 36156039096, job "Test / Unit (6/6)". The PR was dequeued.

Likely cause

The test spies session.sendMessage to reject, calls sendQueuedMessages(), then waits with waitForCondition(() => failures.length === 1). On a loaded CI runner the rejected dispatch probably reaches onAcceptedPreStreamFailure after waitForCondition's default bound. The fix is to await the dispatch's own settlement instead of polling.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions