Skip to content

test(ui-kit): StreamingAnswer 'Loading To Ready' fails on a 700 ms wall-clock handoff bound under runner load #3417

Closed

Description

@schlessera

Problem

stories/conversation/StreamingAnswer.stories.tsx > Loading To Ready failed in ready-candidate run 41558182985 (browser (3)). That run was proving PR #3413, which only removes unused ui-sdk ./internal names and doesn't touch ui-kit or ui-react. The failure is a wall-clock assertion in stories/_streaming-handoff.tsx:60:

await expect(removed! - arrived!).toBeLessThan(700);
AssertionError: expected 719.2999999999884 to be less than 700

It measures real elapsed time between the first token arriving and the loading ghost's removal on a shared CI runner, so runner load alone can push it over the bound. Earlier issues in this family were closed (#1179, #1185, #1946).

Acceptance criteria

  • Root cause stated: either a real handoff delay (a stalled transition or a late frame) or a test that measures wall time it doesn't control.
  • A deterministic fix that keeps the property being tested (the ghost is removed promptly once the first token arrives). It should assert ordering or animation state, or use the story's own clock rather than wall-clock milliseconds. Don't raise the bound or retry.
  • Failing-first proof under load or forced timing, plus a mutation receipt showing a genuinely stalled handoff still fails.

Blocks #2534 (PR #3413). Refs #1179, #1946.

Activity

  1. added this to the 0.45.0 milestone on Nov 3, 2026
  2. added
    type: test
    area: ui-kit
    priority: p2
    agent-ready
    on Nov 3, 2026
  3. self-assigned this
    on Nov 3, 2026
  4. schlessera commented on Nov 3, 2026

    @schlessera
    OwnerAuthor

    Claiming (token wi-3417-c5e4). Branch: test/3417-streaming-handoff-clock from origin/main b9fb28b.

  5. schlessera commented on Nov 3, 2026

    @schlessera
    OwnerAuthor

    Implementation is in draft PR #3426, head 7d135cfab19f4c513940610f22564afecb0b5e22. It is ready to confirm.

    Root cause: the test measured wall time it doesn't control. A main-thread stall across the 600 ms mark delays the removal timer, the fade's own animationend and every frame together, and no frame is painted with a ghost that should be gone. The stories now count the handoff in rendered frames: the fade lasts at most 600 ms of animation time, and the ghost is removed within three frames of the fade's end. The failing-first stall control, the natural-load runs and the mutation receipts are in the PR.

    Local preflight passed. Main is green, but the integration lease is held by another candidate, so confirmation has not been requested yet. Next step:

    bun scripts/integrate.ts confirm 3426 --issues schlessera/brain-kit#3417

    Found during this work: #3425. The arrival timer can cut the fade short when the fade's first frame is late. That is the remaining load-sensitive mid-sample signature.

  6. removed their assignment
    on Nov 3, 2026
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

    agent-readyarea: ui-kitpriority: p2type: test

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions