Skip to content

Automate browser based workflows with AI

Refresh .test_durations from CI (#8290)

Suchintan76699e8871c8
diff --git a/skyvern-frontend/src/routes/workflows/studio/StudioBrowserStream.tsx b/skyvern-frontend/src/routes/workflows/studio/StudioBrowserStream.tsx
index 720a6ab49..12bcfc041 100644
--- a/skyvern-frontend/src/routes/workflows/studio/StudioBrowserStream.tsx
+++ b/skyvern-frontend/src/routes/workflows/studio/StudioBrowserStream.tsx
@@ -40,8 +40,8 @@ export function StudioBrowserStream() {
}, [browserSessionId, reset]);
// Recording is session-scoped: clear it when the studio's browser session ends
- // or changes. The transport stream no longer resets on unmount (it remounts
- // across CDP<->VNC swaps without the session ending), so this owns that.
+ // or changes. The stream component can remount while the session persists and
+ // doesn't reset recording state itself, so this owns that.
useEffect(() => {
return () => resetRecording();
}, [browserSessionId, resetRecording]);
diff --git a/skyvern-frontend/src/store/useRecordingStore.ts b/skyvern-frontend/src/store/useRecordingStore.ts
index 3f2f96d4f..23e504e97 100644
--- a/skyvern-frontend/src/store/useRecordingStore.ts
+++ b/skyvern-frontend/src/store/useRecordingStore.ts
@@ -199,8 +199,9 @@ export const nextOptimisticStepId = (): string =>
`optimistic-${(optimisticStepSeq += 1)}`;
/**
- * A frame grabbed from the live VNC canvas at the moment of a recorded click,
- * matched to draft steps by source-event timestamp (ms epoch).
+ * The last committed frame of the live browser stream, grabbed at the moment
+ * of a recorded click, matched to draft steps by source-event timestamp
+ * (ms epoch).
*/
export interface RecordingScreenshot {
timestampMs: number;
diff --git a/skyvern/forge/sdk/routes/streaming/channels/README.md b/skyvern/forge/sdk/routes/streaming/channels/README.md
index 1fd14ae9d..da6e28c45 100644
--- a/skyvern/forge/sdk/routes/streaming/channels/README.md
+++ b/skyvern/forge/sdk/routes/streaming/channels/README.md
@@ -4,17 +4,22 @@ A "channel", as used within the streaming mechanism of our remote browsers,
is a WebSocket fit to some particular purpose.
There is/are:
- - a "VNC" channel that transmits NoVNC's RFB protocol data
+ - a "VNC" channel that transmits NoVNC's RFB protocol data (legacy viewers)
- a "Message" channel that transmits JSON between the frontend app and
the api server
- "CDP" channels that send messages to a remote browser using CDP protocol
data
- an "Execution" channel (one-off executions)
- - a soon-to-be "Exfiltration" channel (user event streaming)
+ - an "Exfiltration" channel (Record Browser user-event capture)
In all cases, these are just WebSockets. They have been bucketed into "named channels"
to aid understanding.
+Record Browser captures actions over CDP: the frontend renders screencast frames
+from the browser-session stream, user events arrive via the Exfiltration channel,
+and the Message channel carries recording commands and interpretation updates.
+The VNC channel and its Message pairing below apply to legacy VNC viewers.
+
These channels are described at the top of their respective files.
## Architecture
@@ -54,7 +59,7 @@ the `skyvern/forge/sdk/routes/streaming` directory. It looks correct.
│ │
│ CDP Channels (created on-demand): │
│ - ExecutionChannel: JS evaluation (paste, get selected) │
-│ - ExfiltrationChannel: (future) user event streaming │
+│ - ExfiltrationChannel: Record Browser user-event capture │
│ │
└────┬─────────────────────────────────────────────────────┬──┘
│ │
@@ -71,9 +76,11 @@ the `skyvern/forge/sdk/routes/streaming` directory. It looks correct.
### Channel Pairing & Sticky Sessions
-**Critical Design Constraint**: The VNC and Message channels for a given frontend
-instance MUST connect to the same API server instance because they coordinate
-via in-memory registries keyed by `client_id`.
+**Critical Design Constraint** (legacy VNC viewers): The VNC and Message channels
+for a given frontend instance MUST connect to the same API server instance because
+they coordinate via in-memory registries keyed by `client_id`. The CDP Record
+Browser path opens only the Message channel here — the Exfiltration channel is
+owned by that Message channel, so there is no cross-socket pairing to break.
```
Frontend Instance (client_id="abc123")
diff --git a/skyvern/forge/sdk/streaming/registries.py b/skyvern/forge/sdk/streaming/registries.py
index 767aa18ad..e2ddf7564 100644
--- a/skyvern/forge/sdk/streaming/registries.py
+++ b/skyvern/forge/sdk/streaming/registries.py
@@ -8,10 +8,12 @@ the same backend api instance. This is because the two registries here are
tied together via a `client_id` string.
The tale-of-the-tape is this:
- - frontend app requires two different channels (WS connections) to the backend api
+ - legacy VNC viewers open two paired channels (WS connections) to the backend api
- one dedicated to streaming VNC's RFB protocol
- the other dedicated to messaging (JSON)
- - both of these channels are stateful and need to coordinate with one another
+ - the CDP Record Browser path opens only the Message channel here; frames and
+ user-event capture ride CDP (screencast + ExfiltrationChannel) instead of VNC
+ - stateful channels sharing a `client_id` need to coordinate with one another
Additionally, this module manages:
- CDP input channels for interactive browser control