Repository navigation
feat: plug in self onboarding capabilities for mm cli - #46916
Conversation
Builds ready [6cfcefb] [reused from 01401ca]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 4 warn · 🔴 3 fail)
Bundle Size Diffs
|
Builds ready [c379edf]
⚡ Performance Benchmarks (Total: 🟢 8 pass · 🟡 2 warn · 🔴 3 fail)
Bundle Size Diffs
|
Builds ready [89a9dc8] [reused from 0662e26]
⚡ Performance Benchmarks (Total: 🟢 10 pass · 🟡 1 warn · 🔴 2 fail)
Bundle Size Diffs
|
Builds ready [85e6420] [reused from 14d6dd2]
⚡ Performance Benchmarks (Total: 🟢 2 pass · 🟡 0 warn · 🔴 0 fail)
Bundle Size Diffs
|
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Bump @metamask/client-mcp-core to 0.11.0 which adds support for -self-onboarding flag, used by the mm cli and ai workflow Relates: MetaMask#46916 ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: ## **Related issues** Fixes: ## **Manual testing steps** 1. You can test the new functionality following the test steps on this other PR which consumes the changes MetaMask#46916 ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] 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). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] 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.
| if (this.options.stateMode !== 'onboarding') { | ||
| throw new Error( | ||
| "Configuration error: selfOnboarding requires stateMode 'onboarding'.", | ||
| ); | ||
| } |
There was a problem hiding this comment.
We can keep it, but this is dubious.. because on a prod context, it will always go through the onboarding (regardless of stateMode)
| await this.navigateToHome(); | ||
| await finishOnboarding(driver, DEFAULT_PASSWORD); |
There was a problem hiding this comment.
Why do we need to navigateToHome and then finishOnboarding?
The runSelfOnboarding already runs finishOnboarding. So what are we gaining from running it again here?
There was a problem hiding this comment.
oh indeed it seems confusing. This is because of sidepanel:
- The first reload lets the app send the tab to the unlock or completion page based on the wallet's real state. Without it, Done can be clicked while the wallet is locked, which does nothing; that's how we ended up stuck on the password page.
- The second reload is needed because, on Chrome with the side panel enabled, Done opens the side panel and leaves the tab on the completion page, so it never reaches home by itself.
I added a small comment
✨ Files requiring CODEOWNER review ✨🧪 @MetaMask/qa (1 files, +1 -1)
|
Builds ready [7bfe41c] [reused from 0999673]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 4 warn · 🔴 2 fail)
Bundle Size Diffs
|
|
|
||
| // Navigate directly to home page in current window | ||
| // With sidepanel enabled, this ensures we load home page in the test window | ||
| await driver.driver.get(`${driver.extensionUrl}/home.html`); |
There was a problem hiding this comment.
given I saw this I changed it here -> fix incompatibility with Playwright (as don't support driver.driver.get)
Builds ready [45cd3ca] [reused from 0999673]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 4 warn · 🔴 2 fail)
Bundle Size Diffs
|
|
|
No release label on PR. Adding release label release-13.55.0 on PR, as PR was added to branch 13.55.0 when release was cut. |



Description
Agents that run against the extension, such as visual validation in agent-orchestration, currently onboard a wallet by clicking through the onboarding UI with mm commands. That breaks whenever the onboarding screens change.
This PR adds self-onboarding to the llm-workflow launcher. mm launch --state onboarding --self-onboarding reads a secret recovery phrase from stdin and onboards to the wallet using the existing onboarding flows (used and maintained in our e2e, so no breaking change is possible).
This depends on
MetaMask/client-mcp-core#51, which adds the --self-onboarding flag to mm. It builds on the page-object refactor in
#47055.
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
(you need to copy the dist folder for @metamask/client-mcp-core build from the other repo braanch MetaMask/client-mcp-core#51) // this was already merged and released. Just do yarn
echo "SRP" | yarn mm launch --state onboarding --self-onboardingWithout stdin, yarn mm launch --state onboarding --self-onboarding should report that a phrase is required.
echo "" | yarn mm launch --state default --self-onboarding should report that self-onboarding requires stateMode: 'onboarding'.
Screenshots/Recordings
Before
After
Screen.Recording.2026-10-14.at.12.39.26.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Changes are limited to e2e/LLM launch tooling; production extension behavior is unchanged, with explicit SRP validation, clearing, and error redaction in the new path.
Overview
Adds
--self-onboardingto the LLM workflow launcher somm launchcan import a secret recovery phrase during startup (stdin via the provider) and land on home, reusing the same e2e onboarding page objects (importSRPOnboardingFlow, unlock/completion handling) instead of ad-hoc agent clicks.New
self-onboardinghelpers validate/normalize the phrase (12/24 words, canary rejection), run the import flow, thenfinishOnboardinghandles unlock vs completion and side-panel quirks (reload home before/after). The launcher clears the SRP from options after use; flow errors are redacted when they contain the phrase.Supporting fixes: Playwright
pasteIntoFielddispatches a realpasteevent (fallback toinsertText); onboarding flow navigates home viaopenNewURLfor sidepanel tests. README documents the mode; unit tests cover the self-onboarding module.Reviewed by Cursor Bugbot for commit 45cd3ca. Bugbot is set up for automated code reviews on this repo. Configure here.