follow-the-tail browser specs time out: the run they open shows no transcript #59

Closed
opened 2026-09-26 18:39:03 -04:00 by cmoriarty · 1 comment
Owner

Both tests in ui/e2e/follow-the-tail.spec.ts fail against a running osfd, and they failed the same way on main before #58:

OSF_URL=http://127.0.0.1:8710 npx playwright test --grep @live
  ✘ follow-the-tail › stays at the bottom while the content below it grows (15.5s)
  ✘ follow-the-tail › but stops following the moment the operator scrolls up (15.4s)
TimeoutError: page.waitForSelector: Timeout 15000ms exceeded.
  - waiting for locator('[data-lines]') to be visible

step-pane.spec.ts, the other live spec, passes.

Why

liveRun() picks the first run whose status is running and opens #/run/{id} with no step. App.tsx then selects the step the run header names, which is the blocked one first. On the demo osfd that is a step waiting at a gate or for approval, so the stage shows a review lens or an empty state. The transcript's virtual list ([data-lines], ui/src/components/Transcript.tsx) never mounts. The spec is measuring a stream it never reaches.

Fix

The spec should open a step that actually streams. Pick a running agent step from GET /api/runs/{id} and open #/run/{id}/step/{stepId}. Alternatively, now that #58 adds window.braid, select one with braid.state() and braid.run(...). Keep the test.skip when there is no osfd or no running step.

This only changes the test, not how Braid behaves, so the quick-fix pipeline (#55) fits.

Context

Found while auditing the suites for #39 (PR #58). The two specs are tagged @live, so neither lane runs them unless OSF_URL is set, and they don't block anything.

Both tests in `ui/e2e/follow-the-tail.spec.ts` fail against a running osfd, and they failed the same way on `main` before #58: ``` OSF_URL=http://127.0.0.1:8710 npx playwright test --grep @live ✘ follow-the-tail › stays at the bottom while the content below it grows (15.5s) ✘ follow-the-tail › but stops following the moment the operator scrolls up (15.4s) TimeoutError: page.waitForSelector: Timeout 15000ms exceeded. - waiting for locator('[data-lines]') to be visible ``` `step-pane.spec.ts`, the other live spec, passes. ## Why `liveRun()` picks the first run whose status is `running` and opens `#/run/{id}` with no step. `App.tsx` then selects the step the run header names, which is the blocked one first. On the demo osfd that is a step waiting at a gate or for approval, so the stage shows a review lens or an empty state. The transcript's virtual list (`[data-lines]`, `ui/src/components/Transcript.tsx`) never mounts. The spec is measuring a stream it never reaches. ## Fix The spec should open a step that actually streams. Pick a running agent step from `GET /api/runs/{id}` and open `#/run/{id}/step/{stepId}`. Alternatively, now that #58 adds `window.braid`, select one with `braid.state()` and `braid.run(...)`. Keep the `test.skip` when there is no osfd or no running step. This only changes the test, not how Braid behaves, so the quick-fix pipeline (#55) fits. ## Context Found while auditing the suites for #39 (PR #58). The two specs are tagged `@live`, so neither lane runs them unless `OSF_URL` is set, and they don't block anything.
Author
Owner

Fixed by #81 (tracked in #80, which duplicated this issue).

follow-the-tail.spec.ts now does what this issue proposed: it lists the running runs (GET /api/runs) and their steps (GET /api/runs/{id}), picks the running agent step with the longest transcript, and opens /run/{run}/step/{step}, so a gate on the run can no longer take the page. It still skips when there is no osfd or no running agent step.

The fix went further than this issue expected, and it was not test-only:

  • The specs also measured the first scrollable element on the page, which is the run rail, so the scroll-up spec passed while checking nothing. They now measure [data-lines].
  • Measured on the transcript, scrolling up while an agent streams was undone within a frame (virtua's scrollToIndex kept re-aiming at the tail). The transcript now follows with a plain scroll to the bottom; OpenSpec change transcript-follows-the-tail adds the requirement to agent-transcript.
  • The fixture backend has a tail-demo run, so the specs pass in the full lane with OSF_URL at the fixture.

Verified against the fixture only, not a real osfd. To confirm there, run while an agent step is streaming:

OSF_URL=http://127.0.0.1:8710 npx playwright test e2e/follow-the-tail.spec.ts
Fixed by #81 (tracked in #80, which duplicated this issue). `follow-the-tail.spec.ts` now does what this issue proposed: it lists the running runs (`GET /api/runs`) and their steps (`GET /api/runs/{id}`), picks the running agent step with the longest transcript, and opens `/run/{run}/step/{step}`, so a gate on the run can no longer take the page. It still skips when there is no osfd or no running agent step. The fix went further than this issue expected, and it was not test-only: - The specs also measured the first scrollable element on the page, which is the run rail, so the scroll-up spec passed while checking nothing. They now measure `[data-lines]`. - Measured on the transcript, scrolling up while an agent streams was undone within a frame (virtua's `scrollToIndex` kept re-aiming at the tail). The transcript now follows with a plain scroll to the bottom; OpenSpec change `transcript-follows-the-tail` adds the requirement to `agent-transcript`. - The fixture backend has a `tail-demo` run, so the specs pass in the full lane with `OSF_URL` at the fixture. Verified against the fixture only, not a real osfd. To confirm there, run while an agent step is streaming: OSF_URL=http://127.0.0.1:8710 npx playwright test e2e/follow-the-tail.spec.ts
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cmoriarty/braid#59
No description provided.