feat: Adds platform domain with Extension runtime architecture and failure modes - #166
Merged
Merged
Conversation
CHANGELOG.md tracks consumer-facing changes to the `@metamask/skills` package, per CONTRIBUTING's "CLI / tooling changes" section. No merged skill-only PR adds an entry (#80, #78, #70, #62, #61 all touch zero changelog lines). It was also the sole source of this branch's conflict with `main`, since every skill PR edits the same `[Unreleased]` block.
`benchmark-design` and `browser-extension-profiling` both cover E2E benchmarking with statistical rigor, and they sat in different domains here while the rest of the measurement work — `data-analysis`, `react-render-proof` — lives in the performance PR. Splitting one subject across two PRs made both harder to review. Moves `benchmark-design`, its `benchmark-statistical-hygiene` knowledge, and `browser-extension-profiling`. Neither skill referenced the other by path, so nothing needed rewriting. What remains is the extension-runtime work this PR is named for.
Generic scripting guidance — paginate an API, handle rate limits, retry transient errors — with no MetaMask specificity and no relationship to this PR's extension-runtime subject. `coding/` otherwise holds MetaMask internals. Nothing referenced it and it referenced nothing, so removal is self-contained. The content stays in this branch's history if it is wanted later.
The keepalive row was the one entry here resting on a live implementation detail rather than on an absent handler or persistent storage, and it was cited as `background.js:750-758` — a line range that drifts. If the interval grows past the idle timeout or the keepalive is removed, the conclusion inverts from "eviction is prevented" to "eviction happens routinely", and a skill still asserting the first is worse than no skill. Replaces the line range with a symbol grep (`saveTimestamp`, `SAVE_TIMESTAMP_INTERVAL_MS`), names the two conditions the conclusion depends on — sub-idle-timeout interval, and an extension API call rather than a bare timer — and records what was verified, against which commit.
Both platform teams co-own the domain, as they do `coding`, `general`, `performance` and `pr-workflow`. A client's overlay is owned by that client's platform team, placed directly under the domain line so it wins on last-match and so each domain PR inserts at its own anchor.
…termination metamask-extension#44348 (move keep-alive polling to service worker startup) moved the keepalive out of `background.js`, #44373 (remove the enableMV3TimestampSave debug preference) removed its gate, and #44433 (remove browserify) took `app-init.js` with it. The re-check grep searched the file the keepalive left, so it told readers to treat eviction as live. Cold starts are measured and frequent, and whether idle termination is among their causes is not established.
…start does to cronjobs Wallet state persists in `chrome.storage.local` with an IndexedDB backup. On a restart, `CronjobController` runs a recurring job that came due while the worker was down and drops a one-off background event that did. Chrome also ends a worker whose single event runs past five minutes or whose `fetch()` response takes over 30 seconds, the update debounce has a 1s `maxWait`, and an error's tag split counts errors rather than users.
MajorLift
marked this pull request as ready for review
September 18, 2026 14:25
platform domain - Extension runtime architecture and failure modesplatform domain with Extension runtime architecture and failure modes
…/` overlay A skill with no `repos/` directory is repo-agnostic to `tools/install`, so this MV3 and `chrome.storage` skill was installing into `metamask-mobile` and `core` as well. Moving the platform detail into `repos/metamask-extension.md` scopes it, and matches the shape the merged `platform` skills use: a thin shared body, specifics in the overlay.
rvelaz
approved these changes
Sep 18, 2026
MajorLift
enabled auto-merge (squash)
September 18, 2026 17:58
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.
Overview
Adds a
platformdomain: the extension's runtime architecture and its failure modes.extension-errors-debugging— triage a runtime error to root cause. Ships ametamask-extensionoverlay.extension-lifecycle-decoupling— decouple work from the Manifest V3 service-worker lifecycle, so a suspended worker doesn't strand it.extension-architecture,mv3-service-worker.Needs a decision:
/domains/platform/has no CODEOWNERS entry, falling to the*catch-all — which team should own it?Motivation
Nothing in mobile or
corecorresponds, making these a domain rather than a corner ofcoding.extension-lifecycle-decouplingis argued as always-loaded, spending shared description budget. It preempts confidently wrong MV3 claims that disrupted the platform team — recurring reports attributing unrelated bugs to the service worker dying mid-session, which it does not do due to a keepalive. Nobody holding a wrong model searches for the skill that corrects it: from the inside, the model is not in question.Showcase
Neither skill has a trial run reported here, so nothing here speaks to their hit rate.
Adjacent, not a trial run: #44003 (error-handling capture) in the
mms-evidenceshowcase — write gap 631 ms against a 192 ms control, recovery beacons 1 against 0, error toast absent and asserted twice. Handled, not skipped.