Browser: Playwright API metrics#316473
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds telemetry for the Integrated Browser run_playwright_code tool to capture Playwright page API usage, success, deferral, duration, and code-size metrics.
Changes:
- Injects telemetry into
RunPlaywrightCodeTooland logs completed/failed invocations. - Adds
pageMethodsCalledto Playwright invocation results. - Wraps Playwright
pagewith a proxy to count method calls and adds a telemetry event helper.
Show a summary per file
| File | Description |
|---|---|
src/vs/workbench/contrib/browserView/electron-browser/tools/runPlaywrightCodeTool.ts |
Logs telemetry for Playwright code tool invocations. |
src/vs/platform/browserView/node/playwrightService.ts |
Tracks Playwright page API calls via proxy and includes counts in invocation results. |
src/vs/platform/browserView/common/playwrightService.ts |
Extends invoke result shape with page method call counts. |
src/vs/platform/browserView/common/browserViewTelemetry.ts |
Defines and emits the new Playwright code telemetry event. |
Copilot's findings
Comments suppressed due to low confidence (1)
src/vs/platform/browserView/node/playwrightService.ts:722
- Recursively creating a fresh proxy on every object-property read changes Playwright object identity semantics (for example,
page.keyboard === page.keyboardbecomes false). Code that caches, compares, or uses nested API objects as map keys can behave differently under this proxy; cache proxies per target/prefix so repeated property reads return the same wrapper.
if (value !== null && typeof value === 'object') {
return createPageApiProxy(value as object, methodCalls, `${prefix}${prop}.`, depth + 1);
- Files reviewed: 4/4 changed files
- Comments generated: 4
kycutler
reviewed
Jun 1, 2026
Move completion telemetry out of the renderer chat tool and into PlaywrightSession in the shared process, so deferred executions are logged exactly once when the underlying page work settles - even if the agent never resumes the deferred result.
…before settling Make _logExecution idempotent and emit the definitive outcome synchronously for executions that complete or fail within the timeout. Previously a failure thrown before settleWith ran (e.g. the page could not be resolved) left deferred.p pending, so the settlement-promise logger never fired and the execution went unlogged.
…right-code-logs # Conflicts: # src/vs/code/electron-utility/sharedProcess/sharedProcessMain.ts
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @deepak1556Matched files:
|
Yoyokrazy
approved these changes
Jun 2, 2026
kycutler
approved these changes
Jun 2, 2026
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.
Playwright API metrics for Integrated Browser