Skip to content

test(browser): wait for gjc-status's expected chat view and finish before idle (#4184) - #4196

Merged
devswha merged 2 commits into
mainfrom
fix/gjc-expected-view
Nov 19, 2026
Merged

devswha merged 2 commits into
mainfrom
fix/gjc-expected-view

Conversation

@devswha

@devswha devswha commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Summary

Part of #4184 (gjc-status-browser-regression flakes in CI: the server and HTTP report DONE, but the browser never draws the row idle). A read-only trace found a synchronization gap in the script: in the app, DONE turns idle only once the finish is recorded as seen, which needs an uncovered, presented pane, and in chat the current finish's validated final answer with the last row in view before data-pane-content appears. The script only tracked which pane it had selected (onScreen).

The script now waits for the selected chat frame before appending the completion, then requires the new answer and the chat's presentation key for the pushed finish before asserting the visible idle badge, inside the existing 20 s deadline. Its timeout diagnostic now reports the browser's own roster status for the pane, the selected pane, the chat presentation key, the scroll gap and the badge's visibility, so the next CI failure names the broken stage.

The CI evidence does not prove this gap caused the flake, so the quarantine entry stays (per the lead, until the cause is shown). Test-only.

Validation

  • CI runner image (herdr-ci-runner:local, BROWSER_RETRY=0), 10 passes: 10/10.
  • bun run check fast: green.

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Expanded browser regression coverage for status updates delivered through EventSource and WebSocket.
    • Added bounded waits and diagnostic details when browser-state checks fail.
    • Updated completion checks to verify the final answer appears, the browser shows idle, and the server reports done.

The browser regression harness now observes roster updates and reports bounded browser-state diagnostics. Completion checks distinguish server status from the browser badge and verify the final answer in the selected chat. Scenarios use these checks to assert viewed completion.

Changes: Browser status regression

Layer / File(s) Summary
Roster observation and bounded waits
scripts/gjc-status-browser-regression.ts
Adds status types, a shared timeout, browser roster observation through EventSource and WebSocket frames, and bounded diagnostics for failed browser waits.
Viewed completion checks
scripts/gjc-status-browser-regression.ts
Checks server status and browser badge separately. A viewed finish also requires a positive finish ID and epoch, and verifies the exact final answer in the current chat.
Scenario adoption
scripts/gjc-status-browser-regression.ts
Updates stability and completion scenarios to verify viewed completion. The delayed-readiness scenario appends the user request and assistant answer together.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Possibly related issues

  • devswha/ovis#4184 — The issue describes the same browser DONE-to-idle wait behavior and asks for diagnostics. This PR changes the same wait path but keeps the quarantine entry, so the issue’s stated root cause remains unconfirmed.

Possibly related PRs

  • devswha/ovis#4154 — Both PRs update diagnostics and quarantine handling for the same browser status regression test.
Merge Risk: Minimal · up to 03f45

This change only tightens a browser regression test's synchronization and failure diagnostics. It does not alter production behavior, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the test change and the main synchronization fix: waiting for the expected chat view before the finish is appended, and requiring the finish to be presented before the idle badge is as…
Description check Passed The description follows the template. It has a Summary (Change) section that explains the synchronization gap, the fix, and the diagnostic change, and it notes the quarantine entry stays. It has a Val…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the test change and the main synchronization fix: waiting for the expected chat view before the finish is appended, and requiring the finish to be presented before the idle badge is asserted. It matches the changeset and the stated objectives. It is specific enough for history scanning.

Full details: Description check

Explanation

The description follows the template. It has a Summary (Change) section that explains the synchronization gap, the fix, and the diagnostic change, and it notes the quarantine entry stays. It has a Validation section listing the CI runner passes (10/10) and the green bun run check fast. It does not mention changelog or contract-test coverage. The template says contract tests apply to HTTP/WS changes, and this PR is test-only and does not change HTTP/WS behavior, so the omission is acceptable. The Summary heading differs from the template's 'Change' heading, which is a minor deviation.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 7de4a00 and 03f4540.

Files selected for processing: 1

  • scripts/gjc-status-browser-regression.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

@devswha
devswha merged commit 0013ea5 into main Nov 19, 2026
15 checks passed
@devswha

devswha commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Merged through pr-merge at head 03f454048. Seen before the merge was asked for: required checks green, no unresolved thread, no conflict, no hold, main not red, no release in progress. CodeRabbit reviewed this head.

Test-only (#4184): gjc-status waits for the expected chat view and the pushed finish's presentation key before asserting idle, and its timeout diagnostic names the broken stage; the quarantine entry stays on the lead's word. Reviews: dori review CLEAR at 03f4540. Evidence: 10/10 in the CI runner image, check fast green.

@devswha
devswha deleted the fix/gjc-expected-view branch November 19, 2026 05:28
devswha added a commit that referenced this pull request Nov 19, 2026
…full 30 days (#4202)

## Summary

Closes out the browser quarantine entries due 2026-12-18, on the lead's
word (t10k). Test-only (the quarantine list
alone).

- `file-viewer-regression` leaves the quarantine: with #4199 (the long
preview's drawn signal, 30 s ceiling for that
step) it passed 10/10 in the CI runner image on today's main (6bbe673,
including the CommonMark parser change), and
30/30 earlier on #4199's head. Its side-pane timeout seen once in about
50 runs keeps its diagnostic (#4185).
- `gjc-status-browser-regression` (#4184): cause not shown yet; its
timeout diagnostic (#4196) names the stage on the
  next CI failure. Moved to 2026-12-19.
- `pane-mute-demo-regression` (#4131): waits on #4131's design change in
another lane. Moved to 2026-12-19.

2026-12-19 is the latest date the 30-day cap allows
(`QUARANTINE_MAX_DAYS`); the cap stays as is, and the lead reviews
both entries before 12-15.

## Validation

- `bun test scripts/ci-browser-parallel.test.ts -t quarantine`: 4/4.
`bun run check fast`: green.
- CI runner image: file-viewer-regression 10/10 on main 6bbe673.
devswha added a commit that referenced this pull request Nov 21, 2026
…d end the gjc-status quarantine (#4445)

## What

Two changes to the browser tests, none to the product:

1. `scripts/relay-panel-regression.ts` `openPhoneSettings`: when the
page never shows `.conn-live`, the error now also names the page's
`visibilityState`, its `[role=alert]` texts, the header pills, its
console errors and page errors, and for each WebSocket whether a first
frame arrived (refs #4357).
2. `scripts/ci-browser-quarantine.ts`:
`gjc-status-browser-regression.ts` leaves the quarantine list (closes
#4184).

## Why

**#4357.** The `.conn-live` timeout happened once (run 44793002896) and
not again in the runs since #4371 added a stage report, so the cause is
still unknown. Reading that run again showed what the report cannot tell
apart:

- A crash while a pane region draws turns the header chip off and shows
"This pane can't be shown." React logs it with `console.error`, not as a
page error, and the report read neither the console nor `[role=alert]`.
- A hidden page reads nothing at start (`src/lib/useMachineRoster.ts`),
and the report did not record visibility.
- A socket that is still connecting and one that is open both read
"created" until the 8 s timeout: a first frame tells them apart.

Also found, for the record: the server log of that run is silent about
the failed page because the fixture server takes four client connection
reports per address per minute and had just taken its fourth
(`server/client-connection-log.ts`), not because the client reports only
on pagehide as #4357 says. The quarantine entry stays (until
2026-12-20), with its comment brought up to date.

**#4184.** #4196 (2026-11-19) made the script wait for the expected chat
view and the finish before idle. Since then: no gjc-status failure or
flaky pass in about 530 CI runs with a full browser pass (four in the
about 415 before it). A quarantined flake still leaves a warning
annotation, so the quarantine hid none. The list's own rule is that an
entry goes once the script has stopped flaking.

## Validation

- Forced one timeout against a stand-in page (a `[role=alert]`, a
`console.error`, an uncaught error, one WebSocket that answers): the
message read `…; page {"url":…,"visibility":"visible","conn":["conn
conn-off: offline"],"terminals":0,"alerts":["This pane can't be
shown."],"pills":["herdr unavailable"],"dialogs":[]}; sockets ["48ms
created /ws","48ms first frame /ws"]; errors ["34ms console a render
crash","79ms pageerror uncaught in page"]`.
- `bun run check fast`: passed (22,316 unit tests, typecheck, build).
- `bun scripts/ui-access-regression.ts`: passed once, unforced, in the
isolated test session.
- Not run locally: `gjc-status-browser-regression.ts` (the script itself
is unchanged; this pull request's CI runs it).

No changelog fragment: nothing a user of the app notices.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Fable 5.2 <[email protected]>
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