Repository navigation
feat: add support for self onboarding - #51
Merged
Merged
Conversation
7 tasks
seaona
marked this pull request as ready for review
October 14, 2026 11:36
cryptotavares
previously approved these changes
Oct 14, 2026
cryptotavares
left a comment
Collaborator
There was a problem hiding this comment.
Looks good. The only small issue that I found is if the launch step is run in the batch tool (run_steps). If that happens we are not redacting the SRP from the knowledge store. But we can tackle it in a subsequent PR
Member
Author
oh good point! Thank you @cryptotavares I've added a fix here 91978bf |
cryptotavares
approved these changes
Oct 15, 2026
LabinatorSolutions
pushed a commit
to LabinatorSolutions/metamask-extension
that referenced
this pull request
Oct 19, 2026
<!-- 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** 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](MetaMask/client-mcp-core#51), which adds the --self-onboarding flag to mm. It builds on the page-object refactor in [MetaMask#47055](MetaMask#47055). ## **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** (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 1. Build the wallet yarn start 2. Stop any running daemon so it picks up the new code: yarn mm cleanup --shutdown. 3. Launch with a test phrase ` echo "SRP" | yarn mm launch --state onboarding --self-onboarding` 4. Run yarn mm get-state. Check that isUnlocked is true, currentScreen is home, and accountAddress. 5. Check that the phrase does not appear in .mm-daemon.log: rg -c abandon .mm-daemon.log should find nothing. 6. Check the error cases, which should each fail with a clear message: Without stdin, yarn mm launch --state onboarding --self-onboarding should report that a phrase is required. echo "<phrase>" | yarn mm launch --state default --self-onboarding should report that self-onboarding requires stateMode: 'onboarding'. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** https://github.com/user-attachments/assets/de2a6a94-8238-426d-913b-e1c39c6c4288 <!-- [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. <!-- CURSOR_SUMMARY --> --- > [!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-onboarding`** to the LLM workflow launcher so `mm launch` can 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-onboarding`** helpers validate/normalize the phrase (12/24 words, canary rejection), run the import flow, then **`finishOnboarding`** handles 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 **`pasteIntoField`** dispatches a real **`paste`** event (fallback to `insertText`); onboarding flow navigates home via **`openNewURL`** for sidepanel tests. README documents the mode; unit tests cover the self-onboarding module. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 45cd3ca. 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.
Description
The launch schema rejects self-onboarding unless that phrase is present. The error text does not include the words.
Before a launch step is written to the knowledge store, srp is removed. In prod mode, the usual “unlock the wallet” prerequisites are omitted, because onboarding is supposed to finish during launch.
Manual testing
Create a file phrase.txt with the 12 or 24 words SRP.
Test:
mm launch --context prod --state onboarding --self-onboarding < phrase.txt