Skip to content

Start failures say Revyl's reason; app links follow the backend; CDP counts as activity - #97

Merged
capy-ai[bot] merged 9 commits into
mainfrom
capy/start-reasons-app-link
Dec 5, 2026
Merged

capy-ai[bot] merged 9 commits into
mainfrom
capy/start-reasons-app-link

Conversation

@anamhira47

@anamhira47 anamhira47 commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

G2, G3 and G5 from the /verify device dogfood (REVL-46674). Stacked on #93, which removes the app host from TS web start-failure and failed-profile messages, and reuses its helper.

G2: start failures say Revyl's reason

  • Web (Python, Go): the error now relays the device session's error_message, with the app host stripped as Web sessions: a failed start says "web session" once and leaves out the app's host #93 does in TS. Before, it said "Web session ended before becoming ready".
  • Devices (all three): when the worker connection ends, Verify reads the device session's error_message and puts it in SESSION_START_FAILED with the link. The connection's own message is always the placeholder Session <status> for a terminal session. When the reason is null, the error falls back to today's text.
  • Computers (all three): every failure_reason on the report is named in the message, such as (failed: host_start_failed). It is safe to try again: open() starts a new computer. Before, only no_host and device_limit were explained and the rest were dropped. A value is shown only if it's a plain code. No new RefusalReason values.
  • Limit: the backend sends no structured code on these responses. For web, runtime_code=… appears only inside error_message, and only for four runtime failure types. Any other host_start exception is stored as just "Failed during host_start", so that's all Verify can show.

G3: links follow the backend

With no app URL and no REVYL_APP_URL, the app link comes from the backend Verify talks to:

  • backend.revyl.ai → app.revyl.ai
  • backend-<name>.revyl.ai → <name>.revyl.ai
  • anything else → app.revyl.ai, as today

This applies to session links, report, and the API-key page hint, in all three languages. It's internal behaviour, so the CHANGELOG line describes it without naming environments.

Host audit: after #93, these errors still echoed the host or URL; all are fixed in all three languages:

  • the web-app create errors, which quoted Verify: <host>
  • the non-web-app error, which quoted the name and origin
  • TS's "registered without a build id"
  • Python and Go's profile-ended error

Left on purpose: the scheme-fix hint for http:// or a scheme-less URL echoes the corrected URL. It's the caller's own value and it is the fix.

G5: CDP and the idle timeout (docs and the config hint)

  • What counts as activity: every command a client sends over cdp() resets the web idle timer (cognisim_python_cli/web_runtime/action_host.py, inbound customer frames), as every Verify step does. Browser events and replies don't, and the SDK sends no keepalive.
  • Docs: the CDP sections and the idleTimeoutSeconds hint say so, and tell a quiet script to send a cheap command such as Browser.getVersion, or to raise idleTimeoutSeconds.
  • No keepAlive() API, because CDP traffic already counts.

Proposal, needs Anam's approval (not built): readyTimeoutMs for web

  • SDK shape:
    • TS readyTimeoutMs, 5000-120000 ms in whole seconds; Python ready_timeout; Go ReadyTimeout.
    • Web only. Leaving it out keeps today's 20 s first navigation.
  • Backend: today the 20 s is a module constant, INITIAL_NAVIGATION_TIMEOUT_SECONDS. Adding it needs:
    • an initial_navigation_timeout_seconds field on WebSessionOptions, WebStartSource and WebBundleSource, all extra="forbid"
    • the runtime reading that field
    • the host-start budget (25 + nav) scaling with it
  • Rollout, reader first: runtime, then backend, then SDK. The SDK sends the field only when it's set.

Review

An independent review found no high-severity issues. Fixed in d9cb176:

  • host stripping is now case-insensitive and also covers the host as written
  • a whitespace-only reason falls back to the connection's message
  • persistent start-failure text matches across languages (no_host and device_limit explained; the openPersistent fix is always given)

Residual gap: for a non-ASCII host, Go strips only the host as written, not its punycode form.

Checks

  • TS build, typecheck and npm test (317).
  • Python ruff, format, mypy and pytest (780).
  • Go gofmt, vet and test.
  • check:links.

No tests were added or changed, and nothing was run live; the device error_message format is known only from code. This PR conflicts with #96 on the web-app error lines and the CHANGELOG headings, and lightly with #94 in persistent.ts.

Open in Capy


Note

Medium Risk
Touches session startup error paths and URL derivation used for every session link; behavior changes are user-visible but limited to messaging and defaults, not request semantics.

Overview
Improves diagnostics and link consistency across TypeScript, Python, and Go for the 0.9.3 release.

Session start failures now relay Revyl’s reasons: web and device sessions read error_message (and worker message when needed) into SESSION_START_FAILED, with the app URL’s host replaced by the app URL so preview hosts don’t leak in errors. Computer starts name every safe failure_reason code (not only no_host / device_limit), add retry guidance where appropriate, and persistent computers always tell you to call openPersistent() again.

Printed links (viewerUrl, session links, missing-credentials API-key hint) default to the Revyl web app that matches backendUrl when appUrl is unset—backend-<env>.revyl.ai maps to <env>.revyl.ai, otherwise production app.revyl.ai.

Docs and validation hints clarify that web idle timeout resets on Verify steps and CDP commands; timeoutMs on web/mobile targets is rejected with a message pointing at idleTimeoutSeconds. CDP sections also document auto-accepted dialogs and headless focus emulation.

Web-app creation/register errors no longer quote app names or URLs; they refer to the app URL.

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

Stack

Top of the 0.9.3 stack, based on #96 (capy/web-app-no-host), which is based on #94. Merge in order: #94 → #96 → #97.

anamhira47 and others added 3 commits December 5, 2026 00:18
- Devices: when the worker connection is terminal, read the device session's
  error_message and put it, without the app's host, in SESSION_START_FAILED.
- Web (Python, Go): relay error_message instead of 'Web session ended before
  becoming ready'; strip the app host from the profile-ended message too.
- Computers: name every failure_reason other than no_host/device_limit with
  what to do; persistent computers name it as well.
- The app URL defaults to the app of the Revyl the backend URL names
  (backend-<name>.revyl.ai -> <name>.revyl.ai), else app.revyl.ai.
- Web-app errors no longer repeat the URL or its host.
- idleTimeoutSeconds hints and cdp() docs: CDP commands count as activity.

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

- withoutAppHost/_start_reason/startReason replace the host as parsed and as
  written, case-insensitively.
- A whitespace-only error_message falls back to the connection's message.
- Python and Go persistent start failures explain no_host and device_limit
  like computers do; TS persistent always gives the openPersistent fix.

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

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@anamhira47
anamhira47 force-pushed the capy/start-reasons-app-link branch from 5a53f59 to 7990537 Compare December 5, 2026 00:18
@capy-ai
capy-ai Bot changed the base branch from capy/web-sessions-a-failed to main December 5, 2026 00:18
@capy-ai
capy-ai Bot marked this pull request as ready for review December 5, 2026 00:49

@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.

View 1 other finding in Capy.

Open in Capy

TS's URL parser already gives the punycode host; Python now also matches
host.encode('idna') and Go an RFC 3492 encoding of each label.

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

@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.

View 1 other finding in Capy.

Open in Capy

The idna codec maps ß to ss (IDNA 2003), so faß.de missed xn--fa-hia.de.
Encode each non-ASCII label with punycode over the lowercased label, and
keep stripping the IDNA 2003 form when it differs.

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

@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.

View 2 other findings in Capy.

Open in Capy

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

# Conflicts:
#	CHANGELOG.md
#	go/session.go
#	packages/verify/src/session.ts
#	python/src/revyl_verify/_session.py
@capy-ai
capy-ai Bot changed the base branch from main to capy/web-app-no-host December 5, 2026 01:17

@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.

View 4 other findings in Capy.

Open in Capy

anamhira47 and others added 2 commits December 5, 2026 01:25
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

@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.

View 1 other finding in Capy.

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 2 potential issues.

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 1aa9edf. Configure here.

Comment thread go/session.go
s := &Session{client: c, id: start.SessionID, runID: start.RunID, platform: target.Platform, stepTimeout: opt.StepTimeout, log: opt.Log, agent: agent, profile: profile}
if target.Platform == Web {
s.appURL = target.URL
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hosted web errors keep the host

Medium Severity

appURL is set only when Open builds a web Session. A web session started from a computer is a different Session and never sets it, but ready still calls startReason. With appURL empty, host redaction is skipped, so a preview host in Revyl's error_message is still printed.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1aa9edf. Configure here.

Comment thread go/session.go
labels[i] = "xn--" + encoded
}
}
return strings.Join(labels, ".")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Go punycode skips browser normalization

Low Severity

idnaHost punycodes the lowerHost label with no Unicode normalization. Browsers and Python's idna codec normalize first, so an NFD host or İ becomes a different xn-- label than the one in Revyl's error. That form is left in the message. Unlike Python, Go also never strips the IDNA 2003 spelling, such as ß mapped to ss.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1aa9edf. 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

@capy-ai
capy-ai Bot changed the base branch from capy/web-app-no-host to main December 5, 2026 03:55
@capy-ai
capy-ai Bot merged commit 3797daf 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