Skip to content

Web sessions: a failed start says "web session" once and leaves out the app's host - #93

Merged
capy-ai[bot] merged 2 commits into
mainfrom
capy/web-sessions-a-failed
Dec 5, 2026
Merged

capy-ai[bot] merged 2 commits into
mainfrom
capy/web-sessions-a-failed

Conversation

@anamhira47

@anamhira47 anamhira47 commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

What changes

When a web session fails to start, the error no longer reads "web web session" and no longer repeats the app's host.

  • webSessionLabel() names the session once. A target passed inline is named after its platform, so The ${target} web session used to print The web web session. It now prints The web session, and a named config target still reads The staging web session. This affects the start-not-acknowledged, ended-before-ready and not-ready-in-time messages.
  • withoutAppHost() replaces target.app.url's host with the app URL in the reason Revyl returns, both when the session ended before it was ready and when a session profile failed. The runtime's reason says Couldn't open <host>: …, so a preview host used to end up in every log and report that quotes the error.
  • The reason now goes through sentence(), so a reason that ends with a period no longer prints ...

Before:

SESSION_START_FAILED | The web web session ended before it was ready (failed): web_session_failed: …; runtime_code=navigation_failed; Couldn't open httpbin.org: the site returned 401. Check that the build's URL is live.. See https://staging.revyl.ai/sessions/<id>

After (from a real staging session, run before the sentence() change, so it still ends with ..):

SESSION_START_FAILED | The web session ended before it was ready (failed): web_session_failed: …; runtime_code=navigation_failed; Couldn't open the app URL: the site returned 401. Check that the build's URL is live.. See https://staging.revyl.ai/sessions/<id>

With sentence(), it ends with live. See ….

Why

The Chaos /verify dogfood on staging preview domains reported this message (REV-6851). Python and Go don't need the change: at web readiness they say Web session ended before becoming ready without relaying Revyl's reason.

Checks

  • tsc --noEmit passes, and npm test passes 317/317. No tests were added or changed.
  • One staging web session (app.url https://httpbin.org/status/401) produced the "after" message above.

CHANGELOG: a new 0.9.2 (unreleased) section. #84 also opens 0.9.2, so whichever merges second combines the two headings. It ships in the next SDK release; don't merge it ahead of that.

Open in Capy


Note

Low Risk
Message-only changes on web session startup error paths; no API or runtime behavior changes beyond error text.

Overview
Improves web session start-failure user-facing errors so logs and SESSION_START_FAILED messages are easier to read.

webSessionLabel() avoids the redundant "web web session" when the target is an inline { platform: 'web' } config (now "web session"); named targets still read like "staging web session". Used for start-not-acknowledged, ended-before-ready, and start-timeout text.

withoutAppHost() scrubs the app URL hostname from Revyl’s reason strings (e.g. preview domains) and substitutes "the app URL", so failures like navigation/401 no longer repeat the host everywhere. Web sessions store appUrl on DeviceSession for profile-failure paths too. Reasons are passed through sentence() where joined to the message to avoid double periods before "See …".

CHANGELOG documents the behavior for the 0.9.2 release.

Reviewed by Cursor Bugbot for commit 895b2a9. Bugbot is set up for automated code reviews on this repo. Configure here.

…e app's host

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot marked this pull request as ready for review December 4, 2026 20:46

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Capy found no issues.

Open in Capy

…ailed

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

const profile = reportedSessionProfile(detail);
if (profile?.status !== 'failed' && ENDED_STATUSES.has(detail.status)) {
throw new VerifyError('SESSION_START_FAILED', `The ${this.target} session ended before session profile ${this.options.profile?.name} finished (${detail.status}): ${detail.error_message ?? 'no reason given'}. See ${this.viewerUrl}`);
throw new VerifyError('SESSION_START_FAILED', `The ${this.target} session ended before session profile ${this.options.profile?.name} finished (${detail.status}): ${sentence(withoutAppHost(detail.error_message ?? 'no reason given', this.appUrl))} See ${this.viewerUrl}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Profile host redaction never runs

Low Severity

The new withoutAppHost call in waitForProfile never sees an app URL. appUrl is stored only for web targets, while waitForProfile runs only for iOS and Android. A failed web session profile still throws profileFailedError with the raw failureReason, so a host in that reason is still logged.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d05244a. Configure here.

@capy-ai capy-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Capy found no issues.

Open in Capy

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 895b2a9. Configure here.

function withoutAppHost(reason: string, appUrl: string | undefined): string {
const host = appUrl ? URL.parse(appUrl)?.hostname : undefined;
return host ? reason.replaceAll(host, 'the app URL') : reason;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

App host redaction is unreliable

Medium Severity

withoutAppHost deletes URL.hostname with a case-sensitive replaceAll, so it matches pieces of longer names and ordinary words, and it skips the same host written in different case. URL.parse also returns null for some HTTPS hosts that webUrlProblem accepts, and those reasons keep the host.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 895b2a9. Configure here.

@capy-ai
capy-ai Bot merged commit 7556b30 into main Dec 5, 2026
7 checks passed
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