Skip to content

e2e: name chat sends blocked by a missing model; attach positai.log on external-server runs - #19262

Merged
gtritchie merged 16 commits into
mainfrom
test/19261-chat-no-model-and-positai-log
Oct 24, 2026
Merged

gtritchie merged 16 commits into
mainfrom
test/19261-chat-no-model-and-positai-log

Conversation

@gtritchie

@gtritchie gtritchie commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Two e2e harness changes, prompted by plots-pane-activation.test.ts failing on Linux Server in #19255 and #19256. In both runs Posit Assistant had briefly lost its model list and showed its provider-setup overlay (posit-dev/assistant#2850), so Send stayed disabled. The tests reported a bare 10 s sendBtn.click() timeout and had no backend log to explain it.

Send blocked by a missing model. sendChatMessage now waits up to 15 s for Send to enable after typing, instead of clicking it as soon as it is visible. If Send stays disabled and its aria-describedby text says "Please pick a model", the test skips when Posit AI is unreachable from the runner too (skipIfAiServiceGone, the existing outage policy). Otherwise it fails with a message naming the no-model state. A Send disabled for any other reason, or one that leaves the page before its description can be read, fails with the plain timeout, as before.

positai.log on external-server runs. Session logs are attached to failures only on Desktop, where the harness can read the log directory. When PW_RSTUDIO_SERVER_URL is set, the fixture now fetches positai.log through the session's /files/ endpoint and attaches the entries stamped since the failing test started. The fetch uses the account's default data home (~/.local/share/rstudio/log/), the same assumption remote-provision.ts makes for credential stores, and builds the URL under the configured server URL, including any path prefix. A missing (404) or empty log is skipped quietly. A response with no timestamped lines, such as a sign-in page reached through a redirect, is logged and dropped, as are other fetch errors, so none can mask the test's own failure. The fetch is skipped once the fixture has found the session deaf, since a deaf session can't serve /files/. The account's sessions share the log, so other workers' entries can be interleaved. The README's failure-diagnostics section describes this.

Servers the harness spawns itself (test:server-dev) still attach no session logs.

Fixes #19261.

Testing

  • tests/harness/chat-send-no-model.test.ts: Send that enables after typing, later than click()'s own 10 s wait (fails without the new wait); Send disabled for lack of a model (outage check, then the named failure); Send disabled for another reason, with the phrase elsewhere in the chat (plain timeout, no outage check); Send removed from the page during the wait (plain timeout, no outage check).
  • tests/harness/remote-session-logs.test.ts: trimming the log to a test's entries, including multi-line entries; fetching it from a local HTTP server at the root and under a path prefix, and on 404, 500 and connection refused; a non-log answer (warns), and an empty log or one with no recent entries (no attachment, no warning).
  • Against a dev RStudio Server, /files/.local/share/rstudio/log/positai.log returned the log (HTTP 200) and a missing log returned 404.
  • npx tsc --noEmit is clean. The full chat e2e suite was not run against a live assistant.

sendChatMessage clicked Send as soon as it was visible, so a Send that
Posit Assistant kept disabled for lack of a model surfaced as a 10s
click timeout. It now waits for Send to enable. When it stays disabled
with "Please pick a model", the test skips if Posit AI is unreachable
from the runner too (posit-dev/assistant#2850) and otherwise fails
naming that state.

Addresses #19261.
Session logs were attached only on Desktop, where the harness can read
the log directory, so the Linux Server CI failure in #19255 carried no
record of what the Posit Assistant backend fetched. On external-server
runs the fixture now fetches positai.log through the session's /files/
endpoint, from the account's default data home, and attaches the
entries stamped since the failing test started.

Addresses #19261.
The check matched "pick a model" anywhere in the chat frame, so a chat
message with that phrase could turn an unrelated disabled Send into the
no-model failure and its outage check. It now reads only the text Send's
aria-describedby points at. The harness test that sends now starts with
Send disabled and enables it later than click()'s own wait would last,
so it covers the wait itself.

Addresses #19261.
The fetch kept only the origin of PW_RSTUDIO_SERVER_URL, so a server
served under a path prefix (https://host/rstudio) got a request for
/files/... instead of /rstudio/files/... and the log was never
attached. /files/ is now resolved under the configured URL.

Addresses #19261.
@gtritchie gtritchie added this to the 2026.11 (Montauk Daisy) milestone Oct 24, 2026
@gtritchie gtritchie self-assigned this Oct 24, 2026

@gtritchie gtritchie left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review: 8 findings, posted inline. The deaf-session fetch delay is the main one. The rest are edge cases outside CI (clock skew, log size, a silent non-log 200), a possibly masked timeout error, and cleanup nits. Nothing here blocks.

Comment thread e2e/rstudio/fixtures/rstudio.fixture.ts Resolved
}

const slice = logSince(log, since);
if (slice.trim() !== '')

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A 200 that isn't the log goes through here as '' with no message. page.request follows redirects, so the sign-in page after an expired cookie, or any page served at <serverUrl>/files/ when the session lives somewhere else, quietly attaches nothing. Nothing in the run would show that the attachment never works on that server. A console.warn when a 200 body has no stamped lines would surface it.

Comment thread e2e/rstudio/README.md Resolved
@github-actions

Copy link
Copy Markdown

RStudio E2E - all platforms

3 test(s) failed

###################- 99% pass rate

Passed Failed Skipped Flaky
4267 3 298 6
Platform ✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
✅ auth-teardown 2 0 14 0
❌ desktop-linux 1061 1 70 1
❌ desktop-macos 1068 1 65 0
❌ desktop-windows 1056 1 77 5
✅ server-linux 1044 0 44 0
✅ setup 36 0 28 0
View / download the full report

View report online -- opens in the browser, no download needed. Available for 14 days.

Download playwright-report.zip -- extract and open index.html

Includes screenshots, traces, and step-by-step details for every test. Expires in 15 days.


All platforms - commit 9c78a5333535951d35f3e80cb57d3acb71501258 - Run #1683

@gtritchie
gtritchie merged commit 6d85c02 into main Oct 24, 2026
37 of 41 checks passed
@gtritchie
gtritchie deleted the test/19261-chat-no-model-and-positai-log branch October 24, 2026 21:12
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.

e2e: explain chat sends blocked by a missing model, and attach positai.log on external-server runs

1 participant