Skip to content

fix(core): keep polling text checks while the next page loads - #165

Closed
bagrat wants to merge 1 commit into
sedum-dev:mainfrom
bagrat:fix/text-wait-through-navigation
Closed

bagrat wants to merge 1 commit into
sedum-dev:mainfrom
bagrat:fix/text-wait-through-navigation

Conversation

@bagrat

@bagrat bagrat commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

What

  • A text check (verify …, wait until the text … is shown) that can't read the page treats it as "text not there yet" and keeps polling until the step's deadline.
  • Text that is still unreadable at the deadline fails the step with text_unreadable, instead of recording it as unsupported.

Why

A text step that starts during a full page load reads the page before Sedum's page script exists in the new document. executeTextAssertion caught that read error and ended the step on the spot with text_unreadable. That was recorded as could_not_run, so --retries never applied.

In our suite, "click Send risk questionnaire" followed by wait until the text "Risk questionnaire" is shown failed this way on every run. The server served the new page normally.

Verification

  • New unit tests with a fake page whose script is missing for its first reads: the step continues once the text is readable, and fails with text_unreadable at the deadline. Both fail on main and pass here.
  • pnpm typecheck and pnpm lint are clean, pnpm test passes (1,446), and the flow-runner.steps browser integration tests pass (20/20).
  • In a real project, the three tests that stopped on text_unreadable pass first time on Linux/Chromium. An equivalent patch to the built package also fixed them on macOS/Chrome.

A text check that started during a full page load read the page before
Sedum's page script was in the new document and stopped at once with
text_unreadable, recorded as unsupported, so retries never applied. Treat an
unreadable page like text not found yet and poll until the step's deadline;
text still unreadable then fails the step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U7KCKub793DH4xshQbHCGd
@coldtea-pr-lens

coldtea-pr-lens Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Architecture

Architecture diagram for sedum-dev/sedum at b8d90ba

Play the walkthrough


Data flow

Data flow diagram for sedum-dev/sedum at b8d90ba

Follow each request


Tip

The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change

🪧 More tips
  • Run npx skills add coldteadotai/pr-lens, then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."
  • Run npx @coldtea/pr-lens-cli analyze --base origin/main on a branch, then npx @coldtea/pr-lens-cli render .pr-lens/graph.json. Same lenses, your own model key, before the pull request exists
  • Click the link under each diagram to open it on a canvas you can zoom, pan and step through
  • Open a diagram on the canvas, then press W or click play to walk through the change one step at a time
  • The CLI's render reads .github/pr-lens.yml and applies your renames, exclusions and lane pins at draw time
  • Set github.comment.collapsed: true in .github/pr-lens.yml to fold the comment behind one View architecture and data flow row. Drawing still runs as before
  • Set github.draw: on-demand in .github/pr-lens.yml and PR Lens stops drawing pull requests on its own. Comment @pr-lens draw on a pull request when you want that one drawn
  • Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and your model provider's key as its api-key to run PR Lens from your own CI. Any /chat/completions endpoint works
  • After a push, tick Redraw to draw the latest commit
  • Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion

Thanks for using PR Lens! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out on X, Bluesky, Mastodon, Reddit or LinkedIn

Copy link
Copy Markdown
Contributor

Thanks for this, @bagrat, and for the clear repro ("click Send risk questionnaire" then a text wait during a full page load).

#169 landed the next day from the same field report and already makes the text check treat an unreadable page as "not yet" and keep polling until the step's deadline (assertion-text.ts), with a browser integration test on a page mid-navigation.

What #169 didn't do is your second point: text that's still unreadable at the deadline was still recorded as unsupported, so --retries couldn't repeat the test. I've taken that into #172, with your fake-page test harness for the deadline case, and you as co-author.

Since this PR now conflicts with main and the polling part is already there, I'm closing it in favour of #169 + #172. Thanks again!

@devnacho devnacho closed this Oct 23, 2026
devnacho added a commit that referenced this pull request Oct 23, 2026
#169 made a text check keep polling while the page cannot be read. Text
still unreadable at the deadline was recorded as could_not_run, so
--retries never repeated the test. It now fails the step with
text_unreadable.

Follow-up to #169, taking the remaining part of #165.


Amp-Thread-ID: https://ampcode.com/threads/T-8894897a-ba72-47ec-b40f-2aacd96b4545

Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: Bagrat <bagrat@timeline.co>
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.

2 participants