Split platform-induced API calls out of the control telemetry category - #322
Draft
archandatta wants to merge 1 commit into
Draft
Split platform-induced API calls out of the control telemetry category#322archandatta wants to merge 1 commit into
archandatta wants to merge 1 commit into
Conversation
Every documented operation emitted api_call under `control`, so the platform's own traffic — recorder polling, profile save/restore, telemetry publishing — buried the agent's browser actions. Operations now carry `x-telemetry-category` in openapi.yaml and categorygen emits the operation -> category map alongside the event-type map, so a new endpoint without a classification fails generation. Browser-control calls keep emitting api_call under `control`; VM-management calls emit platform_api_call under a new `platform` category, which is opt-in and out of the default set. api_call data also gains an optional `code` field, recorded for executePlaywrightCode and clipped to 8 KB on a rune boundary, so the event says what actually ran. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Summary
api_calltelemetry was emitted for every documented operation and always landed in thecontrolcategory. Most of that traffic is the platform acting on the VM, not the agent acting on the browser: recorder polling (listRecorders), profile save/restore (downloadDirZstd,deleteDirectory,processExec), replay lifecycle, and telemetry publishing itself. Anyone readingcontrolto see what an agent did had to page past that noise, and the one event worth reading —executePlaywrightCode— didn't include the code that ran.This splits the two apart:
openapi.yamlnow declaresx-telemetry-category(controlorplatform).categorygenemits the operation → category map next to the existing event-type map, so a new endpoint without a classification fails generation instead of silently landing somewhere.executePlaywrightCode, screenshot, clipboard) keep emittingapi_callundercontrol. VM-management operations emit a newplatform_api_callevent under a newplatformcategory.platformis opt-in: it is inUserCategoriesbut notDefaultCategories, so enabling telemetry without per-category settings now captures strictly less than before (control,connection,system,captcha, withcontrolreduced to browser control).BrowserApiCallEventDatagains an optionalcode, recorded forexecutePlaywrightCodeand clipped to 8 KB on a rune boundary (truncatedset when clipped).platform, so an unclassified route can't dilute the stream callers read to see agent behavior.Notes for review
operation_iddescription saidprocessExec/takeScreenshot, but the value on the wire is the generated handler name (ProcessExec). Corrected, and the generated map keys on that same form —categorygenrejects any operationId that isn't lowerCamelCase, since that assumption is what makes the mapping safe.takeScreenshot,readClipboard/writeClipboardarecontrol(an agent uses them to see and to move data).patchDisplay,chromiumConfigure,patchChromiumFlags,uploadExtensionsAndRestartareplatform(browser configuration, issued at session setup).processExecisplatformeven though a customer can call it directly — it isn't browser control.getTelemetryto generatecontrolevents; it now drivestakeScreenshot, which is stillcontrol.Follow-ups (not in this PR)
platformcategory needs to reach the browser-session telemetry config in the control plane (spec change ready) plus an SDK release before the dashboard can offer aplatformfilter chip. Until thenplatformevents are produced but nothing enables them, so this PR alone just makescontrolclean.Testing
make test-unitpasses (go vet ./...+ unit suite). e2e was not run here — it needs Docker.