[kernel-1116] browser debug: externel events#203
Open
archandatta wants to merge 14 commits intoarchand/kernel-1116/cdp-monitorfrom
Open
[kernel-1116] browser debug: externel events#203archandatta wants to merge 14 commits intoarchand/kernel-1116/cdp-monitorfrom
archandatta wants to merge 14 commits intoarchand/kernel-1116/cdp-monitorfrom
Conversation
…ader godoc, and test correctness
Event is the agreed portable name. DetailStandard avoids Go keyword ambiguity with "default".
…ut of Event Event is now purely producer-emitted content. Pipeline-assigned metadata (seq, capture_session_id) lives on the Envelope. truncateIfNeeded operates on the full Envelope. Pipeline type comment now documents lifecycle semantics.
Ring buffer now indexes by envelope.Seq directly, removing the separate head/written counters. NewReader takes an explicit afterSeq for resume support. Renamed notify to readerWake for clarity.
Drops are now stream metadata (ReadResult.Dropped) rather than fake events smuggled into the Event schema. Transport layer decides how to surface gaps on the wire.
truncateIfNeeded now warns if the envelope still exceeds the 1MB limit after nulling data (e.g. huge url or source.metadata). Pipeline.Publish skips the file write when marshal returns nil to avoid writing corrupt bare-newline JSONL lines.
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 9425b05. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Test plan
Tested against local Docker container (chromium-headful-test on port 444).
Event publishing (POST /events/publish)
preserved (not overwritten to kernel_api)
auto-derived from type prefix (network_request → network)
SSE streaming (GET /events/stream)
framing
session
Category log files
Note
Medium Risk
Adds new HTTP endpoints for publishing and streaming captured events, which can affect runtime load/availability if misused (long-lived SSE connections, unbounded clients). Changes are otherwise localized and covered by new tests.
Overview
Adds external access to the events pipeline by introducing
POST /events/publish(validates JSON, requirestype, defaults missingcategory/source.kind) andGET /events/streamas an SSE feed withLast-Event-IDresume support.Hardens shutdown and lifecycle handling by making
ApiService.Shutdowntolerate nilcdpMonitor/captureSessionand log close errors, and wires the new routes inmain.goalongside the existing/events/start//events/stopcontrols. Includes focused tests for publish validation, log routing, and SSE streaming behavior.Reviewed by Cursor Bugbot for commit 27856a3. Bugbot is set up for automated code reviews on this repo. Configure here.