Sync upstream - v45/v49 (2026-06-04)#214
Conversation
…creenshot, domains
…outine overlap, variable shadowing, duplicate time.Since, ffmpeg stderr capture, base64 threshold comment
70361be to
bfb6cd7
Compare
|
Firetiger deploy monitoring skipped This PR didn't match the auto-monitor filter configured on your GitHub connection:
Reason: PR does not clearly modify API endpoints (packages/api/cmd/api/) or Temporal workflows (packages/api/lib/temporal); please opt in manually if this affects the kernel API. To monitor this PR anyway, reply with |
Final layer of the CDP monitor split. Replaces the no-op dispatchEvent stub with the full handler implementation and completes the test suite. Merges cleanly on top of #214 <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Adds full CDP event dispatch/handling and emits richer network/page interaction events (including headers and optional response bodies), which can affect event volume and expose sensitive data to downstream consumers. > > **Overview** > Completes the CDP monitor split by replacing the no-op `dispatchEvent` stub with a full handler implementation that publishes console, page/navigation, target, interaction binding, timeline layout-shift, and detailed network request/response events (including optional truncated response bodies for textual resources). > > Improves lifecycle/computed-state correctness by handling redirects without inflating pending counters, ignoring subframe lifecycle events for main-frame settling logic, and standardizing published event timestamps to microseconds (including screenshots and monitor lifecycle events). Adds an extensive test suite covering these handlers, rate-limiting of binding events, auto-attach/attach-existing-targets flows, and the redirect/subframe edge cases; updates API wiring to pass a `slog` logger into `cdpmonitor.New`. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit b5b3e89. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
348243a
into
archand/kernel-1116/cdp-foundation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9092789. Configure here.
| m.failPendingCommands() | ||
|
|
||
| // pendingRequests is already empty above, so inflight=0 is correct. | ||
| m.computed.resetOnNavigation(0) |
There was a problem hiding this comment.
Stop starts spurious timer that fires after shutdown
Medium Severity
clearState() calls m.computed.resetOnNavigation(0), which — when inflight is 0 — starts a 500ms network_idle debounce timer via startNetIdleTimer. When clearState is called from Stop(), this timer fires after the monitor has fully shut down and publishes a spurious network_idle event through the publish function. The downstream consumer (captureSession.Publish) may have already been torn down by then.
Reviewed by Cursor Bugbot for commit 9092789. Configure here.
Second layer of the CDP monitor split. Adds the full Monitor struct, all lifecycle machinery, and the test infrastructure. dispatchEvent is a no-op stub - event handlers land in #213 <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Adds substantial new WebSocket lifecycle/reconnect and command routing logic with multiple goroutines/locks; regressions could impact capture stability and leak resources. Tests mitigate but concurrency and reconnect edge cases remain moderately risky. > > **Overview** > Implements the core `cdpmonitor.Monitor` lifecycle: establishes a CDP WebSocket connection, routes command responses via `send()`, starts the init sequence (`Target.setAutoAttach` + attach to existing targets), and adds a `Health()` snapshot for operational visibility. > > Adds automatic reconnect on upstream URL changes with backoff, state reset/unblocking of in-flight commands, and lifecycle events (`monitor_disconnected`, `monitor_reconnected`, `monitor_reconnect_failed`, `monitor_init_failed`). > > Introduces screenshot capture/publishing with rate limiting and optional ffmpeg downscaling, plus a comprehensive test harness (fake WS server/upstream, event collector) and new unit tests covering lifecycle, reconnect, screenshot behavior, and pending-command unblocking. Domain enablement/script injection is factored into `domains.go`, and `dispatchEvent` is stubbed pending the follow-up handlers PR. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit bfb6cd7. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->


Summary
Sync branch updated with latest private
maincommits and upstreamkernel-imageschanges.Date of sync
2026-06-04
Private sync
Merged new commits from
origin/mainintosync/upstream-release:db4d91e)CURSOR_PREFERRED_MODEL(8703ab5)kernel-browser
No update required. Both Dockerfiles already use v145.0.7632.75-r16 (latest release).
Upstream merge
Merged
upstream/mainintosync/upstream-release. Notable upstream change:display: return realized X root size instead of failing on libxcvt rounding (7fbc8cd)server/cmd/api/api/display.go— resize/configure logic updatesserver/e2e/e2e_display_resize_window_test.go— new e2e coverageserver/lib/nekoclient/client.go— minor client additionMerge conflicts
None — both the private
mainmerge and the upstream merge completed cleanly.New image versions
Test plan
server/cmd/api/api/display.gocd server && go vet ./...cd server && go test -v -race $(go list ./... | grep -v /e2e$)main