Repository navigation
0.13.1 - #82
Merged
Merged
0.13.1#82
Conversation
Updated changelog to categorize changes under 'Fixed' and removed uncategorized section.
cryptotavares
marked this pull request as ready for review
November 2, 2026 18:12
cryptotavares
enabled auto-merge (squash)
November 2, 2026 18:12
pnarayanaswamy
approved these changes
Nov 2, 2026
n3ps
pushed a commit
to n3ps/metamask-extension
that referenced
this pull request
Nov 4, 2026
## **Description** Bumps `@metamask/client-mcp-core` from 0.12.0 to 0.13.1 (release PRs [MetaMask#80](MetaMask/client-mcp-core#80) and [MetaMask#82](MetaMask/client-mcp-core#82)). 0.13.0 was not published, because its CI failed on Node 26. 0.13.1 only pins Node in CI, so its code is the same as 0.13.0. This also bumps the transitive `@metamask/device-mcp` dependency from 0.4.2 to 0.7.0, the latest version. 0.13.0 removes the knowledge store ([client-mcp-core#60](MetaMask/client-mcp-core#60)). Without the first commit, the `mm` daemon does not compile, because `daemon.ts` and `metamask-provider.ts` import `KnowledgeStore`, `setKnowledgeStore` and `knowledgeStore`. | Area | Before | After | |---|---|---| | `daemon.ts` | Creates a `KnowledgeStore` and passes it to `createServer` | No knowledge store | | `metamask-provider.ts` | `knowledgeStore.writeSessionMetadata()` to `test-artifacts/llm-knowledge/<id>/session.json` | `writeSessionMetadata(artifactsDir, …)` to `test-artifacts/<id>/session.json`. Launch still fails if the write fails | | Session metadata | Has `goal` and `flowTags` | Those fields are removed; `tags` is kept | | `mm knowledge-*`, `mm launch --goal / --flow-tags` | Supported | Removed in core: `unknown command` / `unknown launch flag` warning | | `AGENTS.md`, llm-workflow `README.md` | Tell agents to run `mm knowledge-search` first | That step is removed | Other 0.13.x changes that agents will notice (no Extension code change needed): - Global `--observe none|diff|full` flag. Only mutating commands and `run-steps` return observations by default, and observations have no app state (use `mm get-state`). - One-line JSON output when stdout is not a terminal (`--pretty` / `MM_PRETTY=1` to indent), and `meta.timing` on every response. - `run-steps` takes `observe` instead of `includeObservations`. - Timed-out calls are cancelled, and each Extension ref resolves to exactly one element. The `visual-testing` skill is updated for these changes in MetaMask/skills#210. Commits: 1. `chore(llm-workflow): drop the knowledge store`: the consumer migration, with tests. 2. `bump: @metamask/client-mcp-core to 0.13.0 and @metamask/device-mcp to 0.7.0`: `package.json` and `yarn.lock`. 3. `bump: @metamask/client-mcp-core to 0.13.1`: the published version, with its `yarn.lock` checksum. No LavaMoat policy changes: both packages are dev-only and are not in the webpack bundle. Neither package has install scripts. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: Related: MetaMask/client-mcp-core#80 ## **Manual testing steps** 1. Build a test build (`yarn build:test`), or reuse an existing `dist/chrome` test build. 2. Run `yarn mm launch`. Verify that the wallet opens on the unlock screen and that `test-artifacts/<sessionId>/session.json` is created. 3. Run `yarn mm type --testid unlock-password "correct horse battery staple" --observe none`. Verify that the response has no `observations` and has `meta.timing`. 4. Run `yarn mm click --testid unlock-submit`. Verify that the response has `observations` with `testIds` and `a11y`, and no `state`. 5. Run `yarn mm get-state`. Verify `isUnlocked: true` and `currentScreen: "home"`. 6. Run `yarn mm knowledge-last`. Verify `Error: unknown command 'knowledge-last'`. 7. Run `yarn mm cleanup --shutdown`. <!-- ## **Screenshots/Recordings** ### **Before** ### **After** --> <details> <summary>Local validation with 0.13.1 from npm (headless, test build from this branch)</summary> - `yarn install --immutable` passes. `yarn jest test/e2e/playwright/llm-workflow`: 12 suites, 144 tests passed. `tsc`: no errors in `test/e2e/playwright/llm-workflow`. - `yarn build:test` from this branch, then a scripted `yarn mm` run (`MM_HEADLESS=true`). Every check below passed. Three first-run failures were mistakes in the test script, not in the CLI. One ran the knowledge commands with no daemon running. Two triggered a change big enough that the CLI correctly returned a full observation instead of a diff. I fixed the script and re-ran those checks. | Area | Check | Result | |---|---|---| | Knowledge store removed | `mm --help` has no `knowledge-*`, `--goal` or `--flow-tags` | Pass | | | `knowledge-search/last/sessions/summarize` with a daemon running | `unknown command`, exit 1 | | | `launch --goal x --flow-tags send` | Warns `unknown launch flag`; launch succeeds | | | `session.json` | Written to `test-artifacts/<id>/session.json`; keys `schemaVersion, sessionId, createdAt, tags, launch`; no `llm-knowledge/` dir | | | `describe-screen` | No `priorKnowledge`; browser nodes have `path` | | `--observe` | Invalid level | `--observe requires one of: none, diff, full`, exit 1 | | | `type --observe none` | No `observations`; `observationMs: 0` | | | `click` (default `diff`) | `observations` with `testIds` + `a11y`, no `state` | | | `get-state` / `cdp` (default `none`) | No `observations` | | | `get-state --observe full` | Full observation, no `diff` | | | Diff after a small change | `{"added":["e18"],"removed":[],"unchanged":17}`; only the new node returned | | | `--observe none` keeps the baseline | Next call returns a diff | | Output | Default / `--pretty` / `MM_PRETTY=1` | 1 line / indented / indented | | | `meta.timing` | On `launch`, tools and `cleanup` | | `run-steps` | `includeObservations` | Rejected: `includeObservations was removed; use observe` | | | `batchTimeoutMs: 60000` | Rejected: `expected number to be <=30000` | | | Top-level `observe: "none"` / default | No observation / observation | | | `batchTimeoutMs: 1000` with a slow step | Remaining steps skipped (`skipped: 2`) | | Timeouts | Request timed out (30 s) while a click waited for its target; target added afterwards | No late click; daemon serves the next request | | | Element timeout (60 s) | `Click timed out`, no late click | | Refs and settle | Refs unique; click by ref from the latest response | Pass | | | Click that starts a 600 ms off-screen animation | Observation waited (`observationMs: 659`) and includes the animated element | | Regression | `screenshot`, `navigate-home`, `cleanup --shutdown` | Pass | </details> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Dev-only E2E/agent CLI wiring and documentation; no extension runtime, auth, or user wallet code changes. > > **Overview** > Upgrades **`@metamask/client-mcp-core`** to **0.13.1** (and **`@metamask/device-mcp`** to **0.7.0**) so the Playwright **`mm`** daemon matches core **0.13.x**, which **removes the knowledge store** and related CLI commands. > > The extension-side migration **stops wiring `KnowledgeStore` into `createServer`** in `daemon.ts` and **`MetaMaskSessionManager` now calls `writeSessionMetadata(artifactsDir, …)`** instead of the old singleton. Session **`session.json`** is written under **`test-artifacts/<sessionId>/`** (or workflow **`artifactsDir`**), with **`goal` / `flowTags` dropped** from metadata while **`tags`** remains; launch still **fails if metadata cannot be written**. > > **Agent docs** (`AGENTS.md`, `llm-workflow/README.md`) no longer tell agents to run **`mm knowledge-*`** before visual flows. Integration and provider **tests** drop **`knowledge_*` tools** from expectations and add coverage for the new metadata path and failure behavior. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 620e474. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
weitingsun
pushed a commit
to Poovarasan-Sandhanam/metamask-mobile
that referenced
this pull request
Nov 6, 2026
…@metamask/device-mcp 0.7.0 (MetaMask#38594) ## **Description** <!-- mms-check: type=text required=true --> Upgrades the visual testing workflow (`tests/llm-workflow`, the `yarn mm` CLI) to `@metamask/client-mcp-core` **0.13.1** ([release PR MetaMask#82](MetaMask/client-mcp-core#82); 0.13.0 ([MetaMask#80](MetaMask/client-mcp-core#80)) was not published, 0.13.1 is the same code) and `@metamask/device-mcp` **0.7.0**, and adapts the mobile consumer to the core changes. Only dev tooling changes; no app code is touched. **Changes (one commit each):** | Commit | Change | | --- | --- | | device-mcp ^0.5.0 + Origin in the iOS liveness probe | Metro rejects Hermes CDP connections without an `Origin` header. `verifyJsLiveness` now sends the same `Origin` that device-mcp uses, so the launch health check stops falling back to target-presence-only. | | Drop the knowledge store | Core 0.13.x removes the knowledge store. The daemon no longer creates one, and the provider writes `session.json` with `writeSessionMetadata` to `<artifactsDir>/<sessionId>/session.json`. | | Report only known app state fields | Core no longer puts app state in observations, and the mobile driver no longer guesses wallet fields. The state snapshot capability reports `isLoaded`, `extensionId` and `source: 'stub'`, plus `currentScreen` only when a known testId identifies it. Note: on mobile, core (0.13.x and 0.9.0) returns the driver's state directly and does not call this capability, so `get-state` never shows `currentScreen`. | | Use device-mcp Android snapshots | device-mcp's ADB backend ships its own signer-verified snapshot helper (`helper-first`), so the local `agent-device` snapshot wrapper (~770 lines) is removed. `DEVICE_MCP_ADB_SNAPSHOT` still overrides the mode. | | device-mcp ^0.6.0 → ^0.7.0 | 0.6.0 brings `helper-first` and the nested idb format. 0.7.0 adds session-scoped idb companion teardown and fixes idb recovery error reporting. | | Dispose the iOS driver in adapter cleanup | On a failed launch, core cannot see the driver, so its private idb companion leaked. `IOSPlatformAdapter.cleanup()` now disposes it (idempotent with core's own disposal). | | Call `node_modules/.bin/mm` directly (docs) | Skips Yarn startup, about 0.4–0.5 s per call. | | client-mcp-core ^0.13.0 → ^0.13.1 | Version bump, README version notes and `yarn.lock` (client-mcp-core 0.13.1, one `@metamask/device-mcp` 0.7.0). | **What agents see from core 0.13.x:** one-line JSON output by default (`--pretty` to indent), a per-call `--observe none|diff|full`, observations only for mutating and batch tools, no app state in observations, `meta.timing` on every response, cancelled timed-out calls, a flat mobile a11y tree without status/nav bars and the dev overlay, `run-steps` `observe` instead of `includeObservations`, and `batchTimeoutMs` capped at 30 s. The matching skill update is MetaMask/skills#211 (`testing/mobile-visual-testing`). ## **Changelog** <!-- mms-check: type=changelog required=true blocking=true --> CHANGELOG entry: null ## **Related issues** <!-- mms-check: type=issue-link required=true --> Refs: MetaMask/client-mcp-core#80, MetaMask/client-mcp-core#82 ## **Manual testing steps** <!-- mms-check: type=manual-testing required=true --> ```gherkin Feature: mm CLI visual testing workflow with client-mcp-core 0.13.1 Background: And an iOS Simulator is booted with a MetaMask dev build installed And Metro is running from this branch on port 8085 Scenario: launch and observe on iOS When I run "yarn mm:doctor" Then every iOS prerequisite passes When I run "node_modules/.bin/mm launch --platform ios --metro-port 8085" Then the launch succeeds and "state" is {"isLoaded":true,"extensionId":"io.metamask.MetaMask","source":"stub"} When I run "node_modules/.bin/mm describe-screen" Then the output is one line of JSON with "a11y.nodes", "testIds" and "meta.timing" When I click an a11y ref with "--observe full" Then the response has "observations" with only "a11y" and "testIds" When I run "node_modules/.bin/mm knowledge-search send" Then the CLI reports "unknown command 'knowledge-search'" When I run "node_modules/.bin/mm cleanup" Then the response is {"cleanedUp":true, ...} ``` ## **Screenshots/Recordings** <!-- mms-check: type=screenshot required=true --> ### **Before** N/A (dev tooling only) ### **After** N/A (dev tooling only). Validation with client-mcp-core 0.13.0 (yalc from `release/0.13.0`, before publish) and re-checked with **0.13.1 and device-mcp 0.7.0 from npm**, with Metro from this branch: - `yarn test:unit:llm-workflow`: 16 suites, 219 tests passed (0.13.0 via yalc and 0.13.1 from npm). - `yarn install --immutable` and `yarn dedupe --check`: pass with 0.13.1. - Smoke with 0.13.1 from npm, iOS and Android: launch, unlock, wallet home, `click --observe full` (observation has only `a11y` and `testIds`), account picker, Send opened and closed (nothing sent or signed), `cdp` `isUnlocked()` = `true`, `cleanup`. - `tsc --noEmit` and ESLint on the changed files: clean. - `yarn mm:doctor`: all iOS prerequisites passed. **Live sessions** (existing wallet, unlock screen; no transactions): | Check | iOS (iPhone 17 Pro sim, main dev build 8.20.0) | Android (emulator-5554, API 36, Metro-attached dev build) | | --- | --- | --- | | `launch --metro-port 8085` | ✅ `state` = `{isLoaded, extensionId, source: "stub"}` | ✅ | | `describe-screen` (flat a11y tree, testIds, `meta.timing`) | ✅ unlock screen testIds found | ✅ unlock screen testIds found; no status/nav bar nodes | | `get-state` (partial, no guessed wallet fields) | ✅ | ✅ | | `type --testid` → diff observation | ✅ | ✅ | | `get-text` (read → no observation) | ✅ | ✅ | | `click --observe none` / `--observe full` | ✅ / ✅ (64 nodes) | ✅ / ✅ | | `run-steps` with `observe: "none"`, `batchTimeoutMs: 20000` | ✅ `summary.ok` | ✅ `summary.ok` | | `includeObservations` rejected; `batchTimeoutMs` > 30000 rejected | ✅ | ✅ | | `--pretty`, one-line JSON by default | ✅ | ✅ | | `wait-for` timeout | ✅ cancelled with error | — | | `press-button back` | — | ✅ | | `cdp` / `hermes-targets` with `--metro-port 8085` | ✅ | ✅ | | `screenshot`, `list-testids`, `accessibility-snapshot` | ✅ | ✅ | | `knowledge-*` | ✅ `unknown command` | ✅ | | `cleanup` | ✅ | ✅ | **Unlocked flows** (existing wallet, read-only: nothing was sent or signed; Send was only opened and closed): | Step | iOS (iPhone 17 Pro sim, iOS 27, dev build 8.20.0) | Android (emulator-5554, API 36, dev build 8.20.0 + Metro JS from this branch) | | --- | --- | --- | | Type password and unlock | ✅ `type`, then `click --testid Done` (keyboard return submits) | ✅ `type`, `press-button back`, `click --testid log-in-button` | | Wallet home (`wait-for --testid wallet-screen`, `describe-screen`) | ✅ | ✅ | | Account picker opens, back to home | ✅ `click --testid account-picker` | ❌ `click --testid account-picker` and `click <ref>` open the profile screen (see 6 below). ✅ `tap-coordinates` at the center of `account-picker` opens Accounts | | Open Send, back to home | ✅ with `tap-coordinates` (see 2 below) | ✅ `click --testid wallet-send-button` | | `cdp` `KeyringController.isUnlocked()` | ✅ `true` | ✅ `true` | | `cleanup` | ✅ | ✅ | Known behavior (not a regression, the same with client-mcp-core 0.9.0 / earlier device-mcp versions). The skill PR documents each one; fixes are tracked for a later client-mcp-core / device-mcp release, not this PR: 1. `mm cdp` / `hermes-targets` do not reuse the launch's `--metro-port` and default to 8081. Pass `--metro-port` on each call when Metro runs on another port. 2. iOS 18+: device-mcp reads the tree with idb `--api axbridge`, which merges the wallet home balance and the Buy / Swap / Send / Receive row into one unlabelled container. `wallet-send-button` is missing, so `click --testid wallet-send-button` times out. `--api ax` lists it. Workaround: `tap-coordinates`. Fix: MetaMask/device-mcp#52. 3. iOS: `mm dismiss-keyboard` fails because idb rejects `idb ui key RETURN`. Workaround: `click --testid Done`. Fix: MetaMask/device-mcp#48. 4. Mobile `get-state` has no `currentScreen` (see the table of changes above). 5. After a tap that opens a slow screen (the first Send of a session on Android), the observation can still show the previous screen. `wait-for` on a testId of the new screen confirms the navigation. 6. Test ID match is substring-based (device-mcp `findElement` → `fuzzyMatch` returns the first element whose identifier *contains* the query, in tree order). On the Android wallet home, `account-picker-avatar` (inside `profile-button`, earlier in the tree) matches `account-picker`, so the tap lands on the profile avatar (85, 138) instead of the account picker (384, 136). An a11y ref resolves to the same testId query, so it fails the same way. iOS passes only because its tree has no `account-picker-avatar`. Workaround: `tap-coordinates`. Fix: MetaMask/device-mcp#52 (exact match first). ## **Pre-merge author checklist** <!-- mms-check: type=checklist required=true --> <!-- Every checklist item must be consciously assessed before marking this PR as "Ready for review". A checked box means you deliberately considered that responsibility, not that you literally performed every action listed. Unchecked boxes are ambiguous: they are not an implicit "N/A" and they are not a silent "skip". See `docs/readme/ready-for-review.md` for the full checklist semantics. --> - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. #### Performance checks (if applicable) - [x] I've tested on Android - Ideally on a mid-range device; emulator is acceptable - [x] I've tested with a power user scenario - Use these [power-user SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93) to import wallets with many accounts and tokens - [x] I've instrumented key operations with Sentry traces for production performance metrics - See [`trace()`](/app/util/trace.ts) for usage and [`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274) for an example For performance guidelines and tooling, see the [Performance Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers). ## **Pre-merge reviewer checklist** <!-- Reviewer checklist items follow the same semantics as the author checklist: an unchecked box is ambiguous, a checked box means the reviewer consciously assessed that responsibility. See `docs/readme/ready-for-review.md`. --> - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Changes are confined to LLM workflow dev dependencies and tests under `tests/llm-workflow`; production mobile app behavior is unaffected. > > **Overview** > Upgrades the **`yarn mm` / `tests/llm-workflow`** dev tooling to **`@metamask/client-mcp-core` 0.13.1** and **`@metamask/device-mcp` 0.7.0**. No application code under `app/` is changed. > > **Core 0.13.x alignment:** The daemon no longer registers a **`KnowledgeStore`**; session metadata is written with **`writeSessionMetadata`** into `<artifactsDir>/<sessionId>/session.json` (default **`test-artifacts`**). The state snapshot capability returns a minimal stub when there is no driver and **drops `currentScreen`** unless a known testId maps to a screen. > > **Android snapshots:** The local **`agent-device` snapshot wrapper** (`snapshot-backend`, helper ADB executor, and their tests) is removed. The Android adapter passes **`device-mcp`'s `AdbBackend` through unchanged** for **`helper-first`** snapshots and **`DEVICE_MCP_ADB_SNAPSHOT`** overrides; README documents the new helper package and modes. > > **iOS Hermes / cleanup:** **`verifyJsLiveness`** sends Metro's expected **`Origin`** header (via **`debuggerOrigin`** or **`HERMES_CDP_ORIGIN`**). **`IOSPlatformAdapter.cleanup`** disposes the driver/backend after closing the app so failed launches do not leak idb companions. > > Docs note calling **`node_modules/.bin/mm`** directly; Babel excludes **`hermes-health.ts`** for runtime env; **`tsconfig`** drops the **`agent-device`** path mapping. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit b508bf7. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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.
This is the release candidate for version 0.13.1.