Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Builds ready [9ebb5b9]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
- Prevent shell injection in BuildCapability by validating buildType
against an allowlist and using spawn with shell: false
- Redirect build stdout/stderr to process.stderr to avoid corrupting
the MCP stdio protocol
- Wrap launch() in try/catch with rollback of partially started
capabilities (fixture, chain, mock server, browser)
- Isolate cleanup() stop failures with Promise.allSettled so one
failing stop cannot block the rest; reset state in finally
- Apply input.ports.fixtureServer at launch time via setPort()
- Best-effort dispose prior capabilities on setContext() switch
- Clear forceKill timer when build process exits after SIGTERM
- Replace unsafe as-casts with instanceof type guards for
MetaMaskFixtureCapability and MetaMaskContractSeedingCapability
- Record resolved extensionPath in session metadata instead of
possibly-undefined input value
9ebb5b9 to
1e6ac1e
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| if (stops.length > 0) { | ||
| Promise.allSettled(stops).catch(() => undefined); | ||
| } | ||
| } |
There was a problem hiding this comment.
Unawaited promises in disposeCurrentCapabilities causes race condition
Medium Severity
disposeCurrentCapabilities is a synchronous void method that creates stop promises but never awaits them. The Promise.allSettled(stops) on line 145 is fire-and-forget. The caller setContext immediately proceeds to create and set a new workflow context while old capability servers (fixture, mock, chain) may still be shutting down. This can cause port conflicts or resource leaks if the new context's launch() tries to bind to ports still held by the old capabilities.
|
|
||
| const mockServerCapability = this.getMockServerCapability(); | ||
| if (mockServerCapability) { | ||
| await mockServerCapability.stop(); |
There was a problem hiding this comment.
Resource leak when post-launch setup throws errors
High Severity
After the try-catch block in launch, errors thrown between lines 482–492 (e.g., getStateSnapshotCapability() returning null, or stateSnapshot.getState() failing) leave the launcher and all started capabilities (fixture, chain, mock server) running with no cleanup. rollbackStartedCapabilities is only called inside the catch block, and this.activeSession isn't set until line 498, so the caller can't use cleanup() either.
|
Builds ready [1e6ac1e]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|





Description
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Moderate risk because it changes how build commands are spawned and how fixture/chain/mock-server capabilities are started/stopped during session launch and cleanup, which could affect e2e workflow stability despite added tests and validation.
Overview
Hardens
mm_buildexecution.MetaMaskBuildCapabilitynow runsyarnviaspawn('yarn', args)withshell: false, pipes child output tostderrto avoid corrupting MCPstdout, and adds an allowlist/validation forbuildTypeand customcommandparts to prevent injection.Improves session lifecycle reliability. The MCP session manager now disposes capabilities on context switches, adds rollback logic to stop any partially-started services (fixture server, Anvil chain, mock server, launcher) when launch fails, and makes
cleanup()stop services in parallel with warning logs.Config/docs updates. The LLM workflow README updates MCP client configs to prefer absolute
node+ localtsxpaths (avoidingyarn tsxin GUI clients), documents OpenCode timeouts, and adds startup troubleshooting guidance.Written by Cursor Bugbot for commit 1e6ac1e. This will update automatically on new commits. Configure here.