From ffbee8b5d1fa7145b580a2f193c5cd2afe9365c3 Mon Sep 17 00:00:00 2001 From: Dario Kondratiuk Date: Tue, 10 Nov 2026 18:59:17 -0300 Subject: [PATCH 1/3] Document MCP open_session without a config (#1509) as unported Upstream's open_session {engine} (tester-army/e2e#1665) names an engine package to load. The port builds engines in code from a target's platform and loads no packages, so the feature is recorded as not ported in COMPATIBILITY.md, with the reason. Co-Authored-By: Claude Haiku 5.5 --- COMPATIBILITY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/COMPATIBILITY.md b/COMPATIBILITY.md index 804468bb6..dd8904c44 100644 --- a/COMPATIBILITY.md +++ b/COMPATIBILITY.md @@ -637,6 +637,7 @@ Not ported: - The project's own tools (`defineTool`, `toModelOutput`), custom engines, mobile tools, and per-session telemetry. - Redaction of what user code prints: a config is JSON, so no user code runs in the server. +- Opening a session without a config (tester-army/e2e#1665, `3c9de80`, issue #1509), not ported. Upstream's `open_session {engine, app}` lets a directory with no config file name an engine package (`@e2e-dev/web`) or a factory call (`{package, export, options}`), loads it from the project, beside e2e, or from `~/.e2e/engines`, and answers `ENGINE_NOT_INSTALLED` with an install command. The port's engines are built in code from a target's platform (`TargetEngines.Create`: `web`, `ios`, `android`, `windows`), and it has no engine packages to load. Loading a .NET assembly by name would run code the agent names with the server's full authority, which the port declines. So `open_session` still needs a config, and `CONFIG_NOT_FOUND` keeps the port's wording. Upstream's `mcp-default-engine.test.ts`, and the engine cases of `mcp-server.test.ts` and `mcp-session-host.test.ts`, are not ported for this. `mobile()`'s platform check and the default exports of `@e2e-dev/web` and `@e2e-dev/mobile` have no counterpart. - `e2e init` registers the server (see [Coding agents](#coding-agents)); by hand, use `claude mcp add e2e -- e2e mcp` or a `.mcp.json` entry. ## Agents From edb7c12e4ac71a42a1c48c556dc9c09a50e97c36 Mon Sep 17 00:00:00 2001 From: Dario Kondratiuk Date: Tue, 10 Nov 2026 18:59:56 -0300 Subject: [PATCH 2/3] List every skipped upstream part of the MCP engine session (#1509) Co-Authored-By: Claude Haiku 5.5 --- COMPATIBILITY.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/COMPATIBILITY.md b/COMPATIBILITY.md index dd8904c44..ba4eff7b4 100644 --- a/COMPATIBILITY.md +++ b/COMPATIBILITY.md @@ -637,7 +637,14 @@ Not ported: - The project's own tools (`defineTool`, `toModelOutput`), custom engines, mobile tools, and per-session telemetry. - Redaction of what user code prints: a config is JSON, so no user code runs in the server. -- Opening a session without a config (tester-army/e2e#1665, `3c9de80`, issue #1509), not ported. Upstream's `open_session {engine, app}` lets a directory with no config file name an engine package (`@e2e-dev/web`) or a factory call (`{package, export, options}`), loads it from the project, beside e2e, or from `~/.e2e/engines`, and answers `ENGINE_NOT_INSTALLED` with an install command. The port's engines are built in code from a target's platform (`TargetEngines.Create`: `web`, `ios`, `android`, `windows`), and it has no engine packages to load. Loading a .NET assembly by name would run code the agent names with the server's full authority, which the port declines. So `open_session` still needs a config, and `CONFIG_NOT_FOUND` keeps the port's wording. Upstream's `mcp-default-engine.test.ts`, and the engine cases of `mcp-server.test.ts` and `mcp-session-host.test.ts`, are not ported for this. `mobile()`'s platform check and the default exports of `@e2e-dev/web` and `@e2e-dev/mobile` have no counterpart. +- Opening a session without a config (tester-army/e2e#1665, `3c9de80`, issue #1509), not ported. Upstream's `open_session {engine, app}` lets a directory with no config file name an engine package (`@e2e-dev/web`) or a factory call (`{package, export, options}`), loads it from the project, beside e2e, or from `~/.e2e/engines`, and answers `ENGINE_NOT_INSTALLED` with an install command. The port's engines are built in code from a target's platform (`TargetEngines.Create`: `web`, `ios`, `android`, `windows`), and it has no engine packages to load. Loading a .NET assembly by name would run code the agent names with the server's full authority, which the port declines. So `open_session` still needs a config, and `CONFIG_NOT_FOUND` keeps the port's wording, with no `engine` hint. What is skipped, by upstream file: + - `packages/e2e/src/mcp/default-engine.ts` (the lookup, the factory calls among options, the `__proto__` key check, the import-only entries) and its unit test `mcp-default-engine.test.ts`. + - `packages/e2e/src/mcp/config.ts` `loadEngineConfig` and the `engine` hint of `locateProjectConfig`; `src/config/load.ts` `missingConfigError`'s `alternative` argument. + - `packages/e2e/src/mcp/session.ts` (`engine`, `app`, `configSource`, the engine session's origin line) and `sessions.ts` (the `ENGINE_DEFAULTS` config claim), and the server's `loadEngineConfig` wiring and instructions in `server.ts`. + - The upstream test cases: the engine case of `mcp-server.test.ts`, the engine cases of `mcp-session-host.test.ts` (`opens sessions on a named engine...`, `refuses ... before anything loads`), and the stub of `mcp-test-run.test.ts`. + - Error codes this skips: `ENGINE_NOT_INSTALLED` (never raised), `INVALID_ARGUMENT` for `engine` with `target`, `config`, or `test`, for `app` without `engine`, and for a config beside `engine`, and `INVALID_CONFIG` for a factory that is not a function or refuses its options. `CONFIG_IN_USE` keeps the port's wording, which upstream changed only for engine sessions; a session on the port's config never meets an engine session. + - `packages/mobile` `mobile()`'s platform check and `default` exports of `@e2e-dev/web` and `@e2e-dev/mobile` (and their two unit tests), since there is no package to default-export from. + - Docs and non-code upstream changed: `.changeset/mcp-engine-session.md`, `AGENTS.md`, `docs/mcp-server.mdx`, `docs/reference/mcp.mdx` (the "Without a config" section), `docs/reference/errors.mdx`, `docs/reference/security.mdx`, `docs/writing-an-engine.mdx` ("Open it by name"), and `skills/e2e` and `plugins/e2e` (SKILL.md and the mcp and debugging references). The port's docs describe no engine session, so none of them change. - `e2e init` registers the server (see [Coding agents](#coding-agents)); by hand, use `claude mcp add e2e -- e2e mcp` or a `.mcp.json` entry. ## Agents From 405bc4007f9a8d28396aafa7057cdc78d3728687 Mon Sep 17 00:00:00 2001 From: Dario Kondratiuk Date: Tue, 10 Nov 2026 19:57:44 -0300 Subject: [PATCH 3/3] Gate the sloppy fixture's late rejections on the test's release (#1509) The rejection timers of Leaves_a_promise_behind (50 ms) and Leaves_a_promise_for_after_the_close (1 s) raced the run's own work: on a slow runner the 50 ms rejection landed inside the turn and failed the run. Each rejection now waits for the test to release it once its run has returned or its session has closed, so it lands at the same point every run. The assertions are unchanged. Co-Authored-By: Claude Haiku 5.5 --- .../McpTestRun/OpenSessionTestOverE2eMcpTests.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/E2E.NUnit.Tests/McpTestRun/OpenSessionTestOverE2eMcpTests.cs b/tests/E2E.NUnit.Tests/McpTestRun/OpenSessionTestOverE2eMcpTests.cs index 91a48c544..12e71de63 100644 --- a/tests/E2E.NUnit.Tests/McpTestRun/OpenSessionTestOverE2eMcpTests.cs +++ b/tests/E2E.NUnit.Tests/McpTestRun/OpenSessionTestOverE2eMcpTests.cs @@ -152,6 +152,7 @@ public async Task Partial_Fails_a_test_on_a_promise_it_left_rejected_and_keeps_s var left = await runner.RunAsync(assembly, typeof(SloppySessionFixture).FullName + "." + nameof(SloppySessionFixture.Leaves_a_promise_behind), CancellationToken.None); Assert.That(left, Is.Not.Null); Assert.That(left!.Failure, Is.Null); + SloppySessionFixture.LeftRelease.SetResult(); await Task.Delay(300); await using (left.Session) { @@ -168,6 +169,8 @@ public async Task Partial_Fails_a_test_on_a_promise_it_left_rejected_and_keeps_s Assert.That(early.Run!.End(), Is.Empty); } + SloppySessionFixture.EarlyRelease.SetResult(); + // .NET reports the faulted task when it is collected: look until it lands, as the host does for a few seconds after a close. for (var look = 0; look < 40 && warnings.IsEmpty; look++) { @@ -386,13 +389,22 @@ public async Task Forgets_an_await() await Expect.That(Screen.GetByLabel("Loads")).ToBeVisibleAsync(); } + /// + /// Released by the test once the run of "leaves a promise behind" has returned, so its rejection lands after the turn and not during it: + /// a timer of a fixed length races the run's own work on a slow runner. + /// + public static readonly TaskCompletionSource LeftRelease = new(TaskCreationOptions.RunContinuationsAsynchronously); + + /// Released by the test once the session of "leaves a promise for after the close" has closed. + public static readonly TaskCompletionSource EarlyRelease = new(TaskCreationOptions.RunContinuationsAsynchronously); + [Test] public async Task Leaves_a_promise_behind() { await App.OpenAsync("/browser"); _ = Task.Run(async () => { - await Task.Delay(50); + await LeftRelease.Task; throw new InvalidOperationException("late failure"); }); } @@ -403,7 +415,7 @@ public async Task Leaves_a_promise_for_after_the_close() await App.OpenAsync("/browser"); _ = Task.Run(async () => { - await Task.Delay(1_000); + await EarlyRelease.Task; throw new InvalidOperationException("later failure"); }); }