[kernel-1116] browser events: add external events#227
[kernel-1116] browser events: add external events#227archandatta wants to merge 6 commits intoarchand/kernel-1116/cdp-foundationfrom
Conversation
|
Firetiger deploy monitoring skipped This PR didn't match the auto-monitor filter configured on your GitHub connection:
Reason: PR title and branch suggest browser events feature work, but no file changes are provided to confirm modifications to API endpoints or Temporal workflows. To monitor this PR anyway, reply with |
…ed signal on Stop
…ontrol on all SSE endpoints
809321b to
ca437c0
Compare
7139fb3 to
0a89c58
Compare
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 0a89c58. Configure here.
Sayan-
left a comment
There was a problem hiding this comment.
matches plan well and deviations from it are reasonable!
| return s.captureSessionID != "" | ||
| } | ||
|
|
||
| // Stop ends the current session. It publishes a synthetic session_ended |
There was a problem hiding this comment.
should seq be monotonic across start/stop cycles? If so, I think Start shouldn't reset it here. That would make seq represent the process-wide event stream position rather than the position within a single capture session.
| // PublishEvent handles POST /events/publish. | ||
| // Injects a caller-supplied event into the active capture session. Returns 400 | ||
| // if no session is active or the event fails validation. | ||
| func (s *ApiService) PublishEvent(_ context.Context, req oapi.PublishEventRequestObject) (oapi.PublishEventResponseObject, error) { |
There was a problem hiding this comment.
could we add one lifecycle test for the new event flow? Something like start capture session, publish an event through PublishEvent, read it from StreamEvents, then stop and verify the stream receives session_ended.

As per plan -> #217
Note
Medium Risk
Adds new public API endpoints for injecting and streaming events and changes capture-session stop behavior to emit terminal frames; issues here could impact event delivery semantics and client reconnect behavior.
Overview
Adds a new external events API:
POST /events/publishto inject validated events into the active capture session (with reserved types blocked andsource.kindforced tokernel_api), andGET /events/streamto stream capture envelopes over SSE withLast-Event-IDresume, keepalives, and explicit handling for dropped events.Updates the events pipeline to support this streaming lifecycle by introducing
CaptureSession.Active, publishing a syntheticsession_endedenvelope onStop, and adding an unfiltered publish path (PublishUnfiltered) for externally supplied events. OpenAPI/oapi-codegen output is regenerated accordingly (new schemas/client methods, SSE headers), and tests are updated for renamed enum constants.Reviewed by Cursor Bugbot for commit f97e3a9. Bugbot is set up for automated code reviews on this repo. Configure here.