Skip to content

test(ui): await queued picker patch dispatch - #184744

Merged
steipete merged 1 commit into
mainfrom
steipete/fix-chat-send-picker-flake
Oct 26, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/fix-chat-send-picker-flake

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes the recurring Bun UI CI flake in handleSendChat > retires a failed queued picker back to the preceding confirmed session row when the first settings patch has not dispatched within one second.

User Impact

No user-visible runtime change. The regression retains its exact patch-count assertion and every assertion that a rejected queued picker restores the preceding confirmed session row.

Why This Change Was Made

The first real sessions.patch in the original file goes through withSessionMutationOperations, which can lazily import the mutation runtime before dispatch. waitForFast polls with Vitest's default 1,000 ms deadline; the hosted failure took 1,051 ms with the count still zero. The file was first in its Bun worker, and the nearby “unexpected gateway request” came from activity-page.test.ts in another worker.

Signal the first RPC from its existing fixture handler and await that signal with awaitGateBeforeSettlement, then retain expect(patchCount).toBe(1). Early operation settlement or rejection still fails. Move this one regression into chat-settings-patches.test.ts, beside its settings owner, to satisfy the mandatory line-cap ratchet on the oversized send suite. The original fixture values and all assertions are preserved.

There are no production changes, retries, sleeps, new timers, timeout increases, or skips. Test-only delta: +68/-41 lines across two files, including the moved test and its standalone setup; no other tests change.

Evidence

Reported hosted failures:

Full-file stress loops on macOS arm64 with pinned Bun 1.4.4-canary.1+807211511:

Lane Before Final change
Required root command, chat-send.test.ts 20/20 passed, 108 tests/run 20/20 passed, 107 tests/run
Bun UI config, original file before / both files after 20/20 passed, 108 tests/run 20/20 passed, 108 tests/run

The relocated picker test also passes alone through the root wrapper (1/1 run). It runs on every final Bun UI iteration; no coverage was dropped. The initial in-place gate fix also passed 20/20 root and 20/20 Bun UI runs before extraction.

Commands:

pnpm test ui/src/pages/chat/chat-send.test.ts --maxWorkers=1
pnpm test ui/src/pages/chat/chat-settings-patches.test.ts --maxWorkers=1
OPENCLAW_VITEST_RUNTIME=bun node scripts/run-vitest.mjs run --config ui/vitest.config.ts ui/src/pages/chat/chat-send.test.ts ui/src/pages/chat/chat-settings-patches.test.ts --maxWorkers=1

The intermittent failure did not reproduce naturally in the local baseline loops; the diagnosis uses the hosted timeout and the cold dispatch path above. These are focused runs, not a replay of the entire hosted shard.

Final median command wall times: 4.25 s (original file), 6.02 s (both files, UI config); median Vitest durations: 2.20 s and 2.76 s. The relocated file alone took 4.57 s wall / 1.08 s Vitest. Hosted failing-file test duration was 20.95 s; new PR CI timing is pending.

Plain oxlint, repository typed oxlint, the chat-test typecheck, oxfmt, the line-cap ratchet, and git diff --check pass. Independent review of the final extraction found no actionable issues.

@clawsweeper

clawsweeper Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T15:19:54.445158Z 0f66454 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 26, 2026
@steipete
steipete merged commit 5f1d487 into main Oct 26, 2026
78 of 79 checks passed
@steipete
steipete deleted the steipete/fix-chat-send-picker-flake branch October 26, 2026 15:24
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

app: web-ui App: web-ui clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant