Status: Proposal — not yet implemented. Facts re-checked 2026-11-14 against @wdio/mcp origin/main (982d6e7,
v4.1.0), webdriverio tag v10.2.0 (5743972, published 2026-11-06), and devtools main (5c7d21a6;
@wdio/devtools-service 11.2.0, @wdio/elements 1.3.0). webdriverio paths below are at that tag. Claims marked
(unverified) were not checked against code.
Release model: v5 is a coordinated release. It does not ship until the cross-repo changes it depends on are merged and published. Until then MCP prepares in non-breaking v4.x minors.
@wdio/mcp started as the proof of concept for element detection and trace recording. Each later extraction copied the
code forward and nobody deleted the source, so several implementations are live:
mcp src/scripts + src/locators original POC — still used by get_elements, the elements and
│ accessibility resources, and the ./snapshot export
└─► devtools @wdio/elements cleaned-up copy; used by @wdio/devtools-service
└─► @wdio/snapshot re-extraction; used by @wdio/session, and by MCP through the agent
mcp src/trace one trace step per MCP tool call, Playwright-compatible zip, vibium player
devtools packages/trace per-WebDriver-command capture, own format and player, multi-framework
The element collectors are true copies. The two trace implementations are different products, not a copy: MCP's records tool calls and works on mobile, cloud, attach and Electron sessions; devtools records WebDriver commands across frameworks. Replacing one with the other is a feature swap with regressions (see Trace swap acceptance criteria).
Launch logic is duplicated as well. @wdio/session and MCP each carry their own target planning and cloud provider
table, and every launch fix lands in session first. Session reaches targets MCP cannot: Windows Appium (windows in
APPIUM_TARGETS), Tauri and Dioxus (DESKTOP_APP_TARGETS), and wdio.conf.ts files (isConfigTarget)
(packages/wdio-session/src/targets/index.ts:16-17, :30-32). Session has Electron too
(packages/wdio-session/src/targets/electron.ts:51, :139, electronPlan/launchElectron). Digital.ai is the only
cloud provider MCP has that session lacks; session's are BrowserStack, Sauce Labs, TestingBot and TestMu
(packages/wdio-session/src/targets/cloud.ts:13).
The interaction layer is already shared: v4 routes snapshots, refs and actions through @wdio/session/agent
(src/session/agent.ts), and agent actions already return generated code, which MCP records at src/session/agent.ts:75.
| Package | Owns | Depends on |
|---|---|---|
@wdio/snapshot |
Page-tree collection, refs, selector candidates, native XML parsing, text output, diffs | — |
@wdio/elements |
The JSON element format (ranked locators per element), kept for compatibility, then deprecated | @wdio/snapshot — since 1.3.0 an optional peer dependency, ^10.2.0 (devtools #429; packages/elements/package.json:54, :58-59) |
| devtools | Capture, trace format, player, dashboard, framework adapters (WebdriverIO, Selenium, Nightwatch, Python) | @wdio/snapshot |
@wdio/session |
Launch (targets, cloud, config files, tunnels), page model, actions, code export, daemon; emits action events (not implemented: the agent has no onAction or emitter, only the pull-style history getter at packages/wdio-session/src/agent.ts:228; Chain B step 1) |
@wdio/snapshot |
@wdio/mcp |
Transport, toolsets, tool descriptions, resources, docs search, multiple sessions for sub-agents | session, devtools-service |
Anything a non-MCP consumer could use lives below MCP. MCP composes those packages and shapes tools.
Trace belongs to devtools. Session emits what happened (an action ran, the page changed, code was generated); a
recorder subscribes. Devtools already has BiDi capture (packages/core/src/bidi.ts), mobile support
(packages/service/src/mobile.ts) and a conformance suite (packages/conformance), so MCP's roadmap items
"Trace: WebDriver BiDi Mode" and "Trace: Mobile / Appium Support" (ROADMAP.md) are devtools work.
@wdio/session already has its own trace: the trace and record actions (packages/wdio-session/src/actions/index.ts:83-84,
implemented in packages/wdio-session/src/actions/evidence.ts:205 and :255). trace writes a directory with a JSONL event
log (trace.trace), a transcript.md with one section per step (code, text, error), and optional screenshots and
snapshots; record saves a video of the session (BiDi screencast, frame sequence, or Appium recording).
Page model: MCP uses the @wdio/session agent. get_elements and the elements/accessibility resources become
views over the agent snapshot. MCP does not adopt @wdio/elements, which this layering deprecates. @wdio/snapshot is
the single collector; collectScript() (packages/wdio-snapshot/src/collect.ts:43, exported from src/index.ts)
returns the collector as one self-contained JS expression string that any page-eval API can run.
Work MCP can do now, without waiting on other repos. It shrinks v5 to integration work.
-
Done (#177). Concurrent sessions — PR #177 (issue #170 Phase 1). Additive, so it ships in v4.x, not v5.
-
Prepared, not yet submitted. Deprecate in place. A new
src/utils/deprecation.ts(warnDeprecated,src/utils/deprecation.ts:13-17) writes(@wdio/mcp) DeprecationWarning: …to stderr once per entry, synchronously, and honoursprocess.noDeprecation. It is synchronous becauseprocess.emitWarningis asynchronous and its output was lost whenwdio-show-tracecalledprocess.exit(1).src/snapshot.ts:16,src/trace.ts:14andsrc/show-trace.ts:8call it at module load, so importing./snapshotor./traceor runningwdio-show-tracewarns once on stderr. Each export of./snapshotand./traceis re-declared with its own@deprecatedJSDoc (src/snapshot.ts:18-38,src/trace.ts:16-33), because a JSDoc onexport { … } fromdid not reach the emitted.d.ts. One machine:lib/snapshot.d.tshas 8@deprecatedtags andlib/trace.d.ts9, matching the source; the implementations are unchanged. Thewdio-show-tracemessage points to devtools'show-tracebin (devtools/packages/service/package.json:16). Thetraceparameter descriptions ofstart_sessionandattach_session(src/tools/session.tool.ts) end with the suffix "Format, location and player change in v5." No re-exports from the new packages: devtools has no equivalent of./trace's API (buildTraceZip,createTraceSession,mapToolToTraceAction), and re-exporting./snapshotfrom another package would change its shape inside a minor. Still open: size the window with a GitHub code search for@wdio/mcp/snapshotand@wdio/mcp/trace; npm downloads cannot show subpath usage. -
Move
get_elements,elementsandaccessibilityonto the agent, keeping the input schema (inViewportOnly,includeContainers,includeBounds,limit,offset). The output is read by a model, so this is not semver-breaking.src/scriptsstays only to back the deprecated./snapshotexport. Gate: run both collectors on a fixed page set (about 10 web pages, 1 Android app, 1 iOS app) and compare selector uniqueness ($$(sel).length === 1), uniqueness after reload, TOON tokens per page, and coverage (elements found by one but not the other). Switch only if the agent matches or beats the current collector within run-to-run noise. Not done: these tools and resources are still onsrc/scriptson bothmainand the prep change (not yet submitted).Constraint:
get_elementsis listed only forios,androidandelectronsessions (src/toolsets.ts:17), and the router rejects it on other session types (src/session/routing.ts:108). A web-page A/B therefore measures the browserelementsandaccessibilityresources, not theget_elementstool. The tool needs a mobile or Electron measurement before its switch can be decided; a web A/B can decide only the browser resources.Gate result: incomplete. A web-only A/B on 9 pages in one run (2026-11-14, webdriverio and
@wdio/session10.2.0) found the snapshot collector returns more elements and higher selector uniqueness (93% against 75%; both figures driven largely by MDN, where most snapshot selectors are unvalidated fallbacks) but is far slower (348-522 ms against 9-71 ms per page outside MDN). The mobile half was not run, andget_elementsserves only mobile and Electron sessions, so there is noget_elementsswitch in v4.x; the numbers inform only the browserelementsandaccessibilityresources. -
Done as a document:
provider-parity-matrix.md. Provider parity matrix as the acceptance spec for session'slaunch: tunnels, cloud result marking viaonSessionClose, attach, the external provider (src/providers/external.provider.ts), local Appium (src/providers/local-appium.provider.ts), Electron, regions, Digital.ai. It compares MCP at982d6e7with@wdio/session10.2.0 over 56 behaviours: 7 covered, 29 partial, 20 absent. Take it to the session owner; it turns open decision 1 into a review of something concrete. Findings that change the plan:- Ten of the 29 partial rows exist only in session's daemon or CLI path (among them the post-launch viewport, the
headless user-agent rewrite, initial navigation, the process-group kill, named and concurrent sessions, the
deleteSessiontime bound and close-all on shutdown). A caller of an in-processlaunchwould not get them, so exporting./launchas it is today does not close them. - Session has no cloud result marking and no pass/fail notion at close, for any provider (rows 11a–11f).
- Session starts and stops a tunnel for BrowserStack only; for Sauce Labs, TestMu and TestingBot it sets the capability and the user must start the tunnel (rows 10b–10e).
- Session cannot attach to an existing session by id (row 7a). This needs no session change: on real Chrome,
webdriverio
attach()followed bycreateAgentSessiongave a working snapshot (2026-11-15; with caps-only attachisBidiwas false, and BiDi-dependent features were not checked), so MCP'sattach_sessionkeeps callingattach()itself and never callscleanup. Detach is fixed when the session is opened;closetakes no detach argument (row 7d).
Rows added by #181 and #177 (verified on
982d6e7):- Chrome driver-tree kill (
src/session/driver-tree.ts;tracksDriverTree,src/providers/local-browser.provider.ts:9); connectionRetryTimeout45 s andconnectionRetryCount: 0(local-browser.provider.ts:6,:28-29);networkLogsmapped togoog:loggingPrefs/ms:loggingPrefs(local-browser.provider.ts:83,:90);- per-session trace finalize, including orphan takeover (
src/session/lifecycle.ts:98,:163); - named and routable sessions (
src/session/routing.ts). - Tunnels: the
tunnelparameter (src/tools/session.tool.ts:84) is the only contract. The legacybrowserstackLocal/saucelabsLocal/testmuLocalaliases were removed by #182 (982d6e7).
- Ten of the 29 partial rows exist only in session's daemon or CLI path (among them the post-launch viewport, the
headless user-agent rewrite, initial navigation, the process-group kill, named and concurrent sessions, the
-
Drafted, not filed:
v5-upstream-issue-drafts.md. The paste-ready version isv5-upstream-issues-to-file.md: 17 issues, 9 inwebdriverio/webdriverio(S1–S6, W1–W3) and 8 inwebdriverio/devtools(D1–D8). File the devtools contract as issues, so they become release criteria instead of v5 surprises. Behaviour measured with@wdio/devtools-service11.2.0 indevtools-trace-probe-results.md(one machine, each probe run once):- a supported way to select trace mode.
setupForDevtools()constructs the service without options (packages/service/src/standalone.ts:46) and ignoreswdio:devtoolsOptions.mode, so no trace is written; trace mode needs a hand-builtDevToolsHookService({ mode: 'trace' }); - behaviour on non-BiDi sessions.
#injectScriptSyncthrowsSevereServiceError(packages/service/src/index.ts:1052-1057), but the caller catches it and logs an error (:282-289); the session continues and a trace is still written. Whether that trace is complete was not assessed; - console patching per session, not per process. It is process-wide today (
patchConsole,packages/core/src/session-capturer.ts:667-670, reassignsconsole[method];patchStreams,:697, wrapsprocess.stdout.writeandprocess.stderr.write), and the patched functions are not restored to the originals after the session ends. With concurrent sessions now onmain, this is a blocker, not a risk. In one run on one machine, a Node console line logged after A closed while B was still open was missing from B's trace (probe P6, observed once); - no writes to stdout. The service prints
DevTools trace saved to …withprocess.stdout.write(packages/service/src/index.ts:1001-1004), which would corrupt MCP's stdio transport; - output directory:
test-results/is always appended, also to a customoutputDir(see Corrections); - finalizing a trace through
after()withoutdeleteSession.after()writes the trace and leaves the session usable, butsetupForDevtools()does not return the service, soafter()is not reachable from the published API, anddeleteSession()finalizes a second time; - published types: the package's
.d.tsfiles import../packages/{shared,core,elements}/src/index.ts, paths that are not in the tarball.
- a supported way to select trace mode.
-
Done (#181 to
10.1.0);10.2.0prepared, not yet submitted. Bump@wdio/sessionandwebdriverio:mainpins both at exact10.1.0(package.json:63,:70); the prep branch bumps both to exact10.2.0. Exact pinning is a decision taken on 2026-11-14, because@wdio/session/agentis still experimental, even though session and snapshot now peer onwebdriverio ^10.0.0. The bump also fixesset_cookiewithsameSite: onmain(pinned 10.1.0)'lax'and'strict'throwinvalid argument: invalid 'sameSite', and 10.2.0 accepts both (one machine, 3 repetitions per cell;src/tools/cookies.tool.ts:36passes the value through). -
Prepared, not yet submitted. Route non-agent tools through agent actions.
execute_script(exec), mocks (mock/unmock), cookies (cookies/storage) and device tools (app,deeplink,rotate,keyboard,background,lock,unlock) exist as actions inpackages/wdio-session/src/actions/index.ts:28,:59-65,:75-78, but only some could be routed without changing behaviour:- Routed:
set_cookieanddelete_cookies(cookies). - Held until a device run:
rotate_device(rotate),hide_keyboard(keyboard) anddrag_and_dropwith a target selector and no duration (drag). All three are restricted toiosandandroidbysrc/toolsets.ts, and no device was available to run them, so they stay direct androtate_device/hide_keyboardstay unrecorded. - Newly recorded via
instrument(src/server.ts):switch_frame,set_geolocation,set_cookieanddelete_cookies. - Kept direct (session paths relative to
packages/wdio-session/):execute_script— session'sexectakes a code string and no script arguments, and its result has nocode, only a history entry (src/actions/exec.ts:96-155;src/session.ts:405-415appends that entry and strips it from the result). The mock tools — session'smockkeeps its own registry in the session store (src/actions/network.ts:114-118), so routing only creation would leave two mock stores.scroll— session's usesbrowser.scroll, a wheel action (src/actions/interact.ts:1179); MCP's useswindow.scrollBy(src/tools/scroll.tool.ts:32in MCP).swipeand drag with a duration — session'sswipeanddragtake no duration (src/actions/interact.ts:1167-1171,:1202-1210). Coordinate tap and offset drag, and all Electron tools, also stay direct.
This did not shrink
src/recording/code-generator.ts. On the prep branch it grew by two cases:switch_frame(src/recording/code-generator.ts:298-301, a comment-only fallback) andset_geolocation(:302-303). The cookie tools never had acasethere, and thedrag_and_dropcase (:308-312onmain) is still needed for the duration and offset paths. The gain is that the routed tools' steps now appear in generated scripts, as code the agent returned.AgentActionResult.codeis optional (packages/wdio-session/src/agent/types.ts:62); onlyexecwas checked for leaving it empty.Frame recording. On a BiDi session the agent's
frameaction returns variable-based code, and later in-frame steps reference that variable.switch_frameis registered withoutinstrumentonmain(src/server.ts:170at982d6e7), so without a recordedswitch_framestep a generated script with in-frame actions uses undeclared variables. This is inferred from the captured code; no base-commit run was made.browser.switchFrame(null)throws on BiDi sessions in WebdriverIO 10 (the error saysswitchFramewas removed for WebDriver BiDi sessions), which is why theswitch_framecase emits a comment.Generated frame code is not JavaScript. The page declaration carries a TypeScript non-null assertion, so a script with a frame switch fails with
SyntaxError: Unexpected token '!'(see the code-generator row above). One machine: with that!removed,let browserhoisted (the prep branch now generates it that way) and thebrowser.switchFrame(null)lines removed by hand, a script with two nested frame switches, an in-frame click, a third frame switch on another page, cookie set/delete and geolocation ran to completion (exit 0). - Routed:
Do not port the feature/wdio-elements trace wiring. Its hooks attach to the options MCP passes to
remote()/attach(). Once session owns launch, MCP no longer builds those options, so the wiring would be thrown away.
| Change | Current state on origin/main |
Needs |
|---|---|---|
Delete src/scripts/ and src/locators/ |
Only src/scripts/get-visible-mobile-elements.ts imports src/locators/ |
v4.x item 3 |
Remove the ./snapshot and ./trace exports and the wdio-show-trace bin |
In package.json exports and bin |
v4.x deprecation window |
Trace via devtools recording session action events, one step per agent action; delete src/trace/ |
src/trace/ holds recorder, state, tool-mapping, types, zip-writer |
Chain A + B, devtools release |
User-visible break: the trace parameter's contract (Playwright-compatible zip in .trace/, vibium player) changes |
Promised in src/tools/session.tool.ts trace descriptions |
— |
Delete src/providers/ except what attach_session and provider: 'external' need (Digital.ai only if the S3 port slips out of the gating release); start_session takes target | config | provider and hands it to session's plan builder |
MCP's own provider table (5 cloud providers + local + external). provider-parity-matrix.md shows 49 of 56 behaviours partial or absent in session 10.2.0, so this row depends on more than a ./launch export |
@wdio/session/launch that closes the matrix gaps (issue drafts S1, S3) |
Reduce src/recording/code-generator.ts (710 lines) to what session cannot generate; per-action code comes from the agent |
Session returns code per action. Its only whole-file exporter (run('export'); generateSpec, packages/wdio-session/src/export/spec.ts:244, not exported from the package root) writes a describe/it spec on @wdio/globals, with no remote(), capabilities, cloud, Appium, Electron, attach or teardown. So it cannot replace the generator entirely. MCP keeps: the launch preamble for every runtime (:156-286) and teardown (:709); cloud hub, tunnel and status code (:382-394, :457-707); the Electron header (:427-445); the attach file shape (:40-120, :447-455); the session-transition sentinel (:137-140); the $/$$ shim (:134, :413-415); and the per-step cases for coordinate gestures (:301-312), Electron (:318-322, :357-368), mocks (:323-356) and web extensions (:369-376) |
A session code exporter with a launch preamble (issue draft S5); until then MCP keeps the reduced generator |
Decided (2026-11-15): one launch path for session-backed targets. v5 start_session goes buildPlan → launch → createAgentSession, with no fallback to the v4 launch code. MCP becomes a protocol layer without its own launch logic. MCP keeps these outside that path: attach_session (calls webdriverio attach(), see the attach finding above), provider: 'external' (src/providers/external.provider.ts), and Digital.ai (src/providers/cloud/digitalai.provider.ts) only if the S3 port slips out of the gating session release. Chain B step 2 puts that port inside the gate, so no Digital.ai exception is expected at release. The code generator's launch preamble is generation, not launch; see the code-generator row above.
Two defects in generated scripts were found on 2026-11-14 (one machine). Neither blocks v5, and each needs an owner:
- Non-null assertion in frame code (session).
pageExpressionappends!to the page lookup (packages/wdio-session/src/actions/contexts.ts:172-173atv10.2.0), and frame declarations build on that variable (declareHeld,packages/wdio-session/src/actions/contexts.ts:341-366). The emitted code is TypeScript, so a JavaScript script with a frame switch fails withSyntaxError: Unexpected token '!'. Session owns the fix (issue draft S6). browserout of scope infinally(MCPmain). The plain local template wraps the steps intry { … } finally { await browser.deleteSession(); }(src/recording/code-generator.ts:709at982d6e7), while the localstart_sessionstep emitsconst browser = await remote({inside thattry(:275). Infinally,browseris not defined, so cleanup throwsReferenceErrorand masks the real error. The cloud and Electron templates declarelet browseroutside thetry. MCP owns the fix; it is fixed in the prep change, not yet submitted (src/recording/code-generator.ts:716).
Step 0 — owner decisions. Nothing below has a date until these are answered (see Open decisions 1–2; decision 3 is answered).
Chain A — collector and trace capture:
- Done in 10.2.0 (webdriverio #16344).
@wdio/snapshotand@wdio/sessionlistwebdriveriounderpeerDependenciesas^10.0.0(packages/wdio-snapshot/package.json:43-44,packages/wdio-session/package.json:80,:86); theworkspace:*entry is now adevDependencyin both. Still true: session's./launchis not exported, and the plannerbuildPlanis internal (packages/wdio-session/src/targets/index.ts:39). - Done. devtools #429 (snapshot-backed
@wdio/elements) is merged and released as@wdio/elements1.3.0. - Open. Feasibility check of
collectScript(), then devtools captures trace snapshots with it. - Open. devtools deletes
core/locatorsandelement-scripts.
Chain B — engine (critical path), S1 and S2 in review upstream (webdriverio/webdriverio#16464, #16466); S3 not started:
- Design session's
launchAPI (against the parity matrix, including hook/service injection) and the action-event schema. - Session release with
@wdio/session/launchand the Digital.ai port. - Devtools accepts session action events as a step source, and the same call accepts steps from tools that stay outside the agent (see Trace swap acceptance criteria).
- Devtools release that meets the trace acceptance criteria. (Peering on webdriverio 10 is already met:
@wdio/devtools-service@11.2.0, npmlatest, peerswebdriverio ^9.19.1 || ^10.0.0.)
Then: MCP pinning policy (exact pins, decided 2026-11-14; see Open decisions 8) → MCP v5.
Every cross-repo step is gated on merged and published at a named version, not just merged.
Edges the first draft missed:
- Launch × trace hooks. Once session builds the browser,
launch()must accept hooks or services, or devtools must attach to an already-running browser. Otherwise trace has nowhere to attach. - Session's own webdriverio dependency — resolved in 10.2.0. Session listed
"webdriverio": "workspace:*"underdependencies, the same exact-pin problem as snapshot. #16344 moved it topeerDependencies(^10.0.0,packages/wdio-session/package.json:86) together with the snapshot change. - Who connects session events to the devtools recorder — MCP (it owns the agent and the recorder wiring) or devtools subscribing to session directly. This decides which repo's release closes Chain B (open decision 5).
devtools #442 (capture only for page-changing commands; merged on main) is useful for devtools' existing users but
not on MCP's critical path: session action events replace command-name heuristics for agent traces.
After #429, packages/core/src/action-snapshot.ts on devtools main still imports buildElementScripts (:5) and
./locators/xml-parsing.js (:12), so devtools keeps two collectors until Chain A step 3 lands.
| Package | Version MCP v5 pins | Gate |
|---|---|---|
@wdio/snapshot |
10.2.0 | peerDependency change published — met |
@wdio/session |
TBD | own webdriverio dependency fixed — met in 10.2.0; ./launch + action events published — still missing |
@wdio/devtools-service |
TBD | accepts session events; acceptance criteria met — 11.2.0 does not meet them (devtools-trace-probe-results.md), though it peers on webdriverio 10 |
@wdio/elements |
not a direct dependency | transitive through devtools-service only |
The devtools release MCP v5 adopts must not regress these, relative to MCP's current src/trace:
| Area | Today (MCP src/trace) |
|---|---|
| Granularity | One step per tool call — preserved by one step per agent action |
| Direct-tool steps | execute_script, mocks, scroll, swipe, coordinate tap_element, offset drag_and_drop and Electron tools get a step today through instrument() in src/server.ts, but stay outside the agent in v5; devtools must accept a step for them too (D7), or they lose their step while their WebDriver commands are still captured |
| Format and player | Playwright-compatible zip, vibium player — users must be told what replaces it |
| Location | .trace/ under cwd |
| Coverage | Local browser, mobile, cloud, attach, Electron sessions |
| BiDi | Not required by MCP today, so devtools must record without it. In one run a classic session logged an injection error and still wrote a trace; completeness not assessed (probe P4) |
| Console | MCP redirects console to stderr. Measured on 11.2.0: devtools patches console.* and process.stdout/stderr.write process-wide and does not restore them after the session ends; with two concurrent sessions one trace missed a console line (probes P5, P6) |
| Stdout cleanliness | MCP's stdio transport needs a clean stdout; src/server.ts reassigns console output to stderr. Measured on 11.2.0: the service prints DevTools trace saved to … on stdout when a trace is finalized; nothing else from the service reached stdout (probes P1c, P3, P5) |
| Install footprint | yazl only. Measured on one machine: @wdio/devtools-service 11.2.0 adds +43 MB and +106 packages over webdriverio 10.2.0 alone, with one webdriverio copy; fluent-ffmpeg (a wrapper, no bundled binary) and the dashboard backend and app are present |
- Output directory is configurable.
#outputDir(packages/service/src/index.ts:1041) usesbrowser.options.outputDir || rootDir;resolveAdapterOutputDir(packages/core/src/output-dir.ts:61) honours it as the base but always appends atest-results/subfolder. Confirmed by measurement (probe P1c indevtools-trace-probe-results.md). - Detached sessions can be traced.
after()is public on the class (packages/service/src/index.ts:978); MCP'scloseSessioncan call it before detaching, asfinalizeTraceworks today. The probe (P3) confirms the session stays usable afterafter(), but only on a hand-built service:setupForDevtools()does not return the instance. setupForDevtools()cannot record traces. It constructs the service without options (packages/service/src/standalone.ts:46), and the service defaults tomode: 'live'(packages/service/src/index.ts:254). Confirmed by measurement on 11.2.0: no trace is written, with or withoutwdio:devtoolsOptions.mode(probes P1b, P2).@wdio/session/launchdoes not exist. Unchanged at 10.2.0:wdio-sessionexports.,./cli,./daemon,./agentand./package.json(packages/wdio-session/package.json:10-30).- The snapshot peerDependency affects MCP — resolved in 10.2.0. The published exact pin would have pulled a second
webdriverionext to MCP's own once devtools-service is in MCP's tree. With the peer range in place, the probe measured a singlewebdriveriocopy with@wdio/devtools-service11.2.0 installed.
Based on v3.12.1, before v4 introduced the session agent (commits 3799594, 26cc501, 0c2e490, 27c01cd). Reference
only — not a merge or port candidate.
- Its probe findings on devtools still hold:
beforeSession()rejects capabilities without top-levelbrowserName/platformName; published types rejectmodewithout a cast;remote()andattach()both honourbeforeCommand/afterCommand; Electron sessions (startWdioSession()) are not traced. - Its
eNref store (element-refs.ts,withRefs()) is superseded by the agent's refs. Two ref systems in one server would let a ref from one model reach tools that resolve the other. - Known gap: upstream
packages/core/src/element-snapshot.tshardcodesuiautomator2for Android, so Espresso sessions get selectors that do not resolve (not re-checked on current devtools).
- Cost of waiting. Until v5, v4.x keeps every collector copy, its own trace and its own provider table, and keeps falling behind session's targets.
- Agent API stability.
@wdio/session/agentis experimental. MCP usescreateAgentSession,SessionError,ActionArgsOf,AgentActionName,AgentSession,PageChange(src/session/agent.ts:1) andHintFormatter(src/session/hints.ts:1);src/tools/page-input.tool.ts:5andsrc/tools/session.tool.ts:17import symbols from the same list. That list is the contract to stabilise or release in lockstep. The agent surface did not change between v10.1.0 and v10.2.0:git diff v10.1.0 v10.2.0is empty forpackages/wdio-session/src/agent.tsandsrc/agent/. - Owners and release cadence. Session, devtools and snapshot have different owners; a breaking snapshot change breaks another team's product. Semver discipline and a contract test are needed.
- Reviewer objections to pre-empt. Session owner: the symbol list above, a
launchsketch covering the parity matrix, anonActionschema, and who does the session-side work. Devtools owners: MCP must not depend on unsupported internals (hand-built service,modecast); running devtools' conformance suite in webdriverio CI moves CI cost to another organisation. - No test or migration plan yet for what replaces the deleted
src/scriptsandsrc/tracetests. The install size comparison now exists (devtools-trace-probe-results.md, Install footprint). - webdriverio fixes MCP needs — resolved by the bump. #16244 (stale ref without selector), #16131 (BiDi selector
attach), #16150 (Android UiSelector) and #16273 (scoped mock restore) are all in v10.2.0. MCP gets them with the
10.2.0pins of v4.x item 6, which are prepared and not yet submitted. The general cost stays: with exact pins, every later fix needs a release plus a manual bump. getCookies()under-reports on BiDi sessions (worked around in MCP; upstream draft W1). Inwebdriverio10.1.0 and 10.2.0, BiDigetCookies()reads the page-originstorageKeypartition, which Chrome fills only with Secure cookies, and falls back to classic only on an empty result. MCP'sreadCookiesin the prep change passessourceOrigin: null, which reads the whole jar across domains. Cause and repro are inv5-upstream-issue-drafts.md(W1), unfiled.
- Session owner: is
@wdio/sessionthe engine and MCP the adapter? Engine features would land in session first even when MCP needs them first. - Devtools owners: does devtools accept session action events as a step source alongside WebDriver commands?
- Answered (webdriverio #16344, in 10.2.0). webdriverio monorepo: is
workspace:*independencies(snapshot and session) a deliberate lockstep policy? No: both packages now peer onwebdriverio ^10.0.0(Chain A step 1). - Investment: how many MCP users run shell-based agents (where the session CLI plus a skill is often better) versus clients without a shell? The answer decides whether MCP grows or goes into maintenance after v5.
- Connector: who wires session action events into the devtools recorder — MCP or devtools?
- Cutoff: if decisions 1–2 stay open past an agreed date, is v5 explicitly parked while v4.x preparation continues?
- Session trace: does session's
traceaction stay, merge into devtools, or get dropped? Otherwise there is a third trace implementation next to MCP'ssrc/traceand devtools'packages/trace. - Taken (2026-11-14). Pin policy: MCP pins
@wdio/sessionandwebdriverioat exact versions, because@wdio/session/agentis still experimental. Revisit when the agent contract is declared stable.
This proposal supersedes trace-extraction-proposal.md, whose standalone @wdio/trace package is replaced by
devtools owning trace.