Merge nucleic/lucid-river-toad-6efj into dev
This commit is contained in:
@@ -51,6 +51,31 @@ public sealed class BrokerServiceTests
|
||||
var caps = result.GetProperty("capabilities").EnumerateArray().Select(c => c.GetString()).ToList();
|
||||
Assert.Contains("proc", caps);
|
||||
Assert.DoesNotContain("ai", caps); // UnavailableAiProvider
|
||||
// The facade's own capabilities ride the same list as the RPC families, because hostd
|
||||
// needs both to decide what to attempt (docs/WINDOWS_PORT.md D13).
|
||||
Assert.Contains("tty", caps);
|
||||
Assert.Contains("reattach", caps);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A compat-SDK-only facade reports no `tty`/`reattach`/`enumerate`, and that MUST reach
|
||||
/// hostd through `hello` — it is the whole degradation mechanism D13 relies on, and the
|
||||
/// difference between the Terminal panel being disabled and it failing in the user's face.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task Hello_OmitsCapabilitiesTheFacadeCannotServe()
|
||||
{
|
||||
wslc.CapabilityList = ["stats"]; // what WslcFacade reports with only the compat SDK
|
||||
var result = Result(Assert.Single(await RoundTrip("""{"jsonrpc":"2.0","id":1,"method":"hello"}""")));
|
||||
var caps = result.GetProperty("capabilities").EnumerateArray().Select(c => c.GetString()).ToList();
|
||||
Assert.Contains("stats", caps);
|
||||
Assert.DoesNotContain("tty", caps);
|
||||
Assert.DoesNotContain("reattach", caps);
|
||||
Assert.DoesNotContain("enumerate", caps);
|
||||
// The RPC families are still advertised: the methods exist and answer, they just answer
|
||||
// `unsupported` for the parts the surface cannot do.
|
||||
Assert.Contains("container", caps);
|
||||
Assert.Contains("proc", caps);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -24,6 +24,12 @@ public sealed class FakeWslc : IWslc
|
||||
|
||||
public string? WslcVersion => "9.9-test";
|
||||
|
||||
/// The fake is deliberately fully-capable: it stands in for a facade with BOTH wslc surfaces
|
||||
/// bound, so the broker's happy path is what these tests exercise. Degradation is the
|
||||
/// facade's business (docs/WINDOWS_PORT.md D13), and tests that care set this directly.
|
||||
public List<string> CapabilityList = ["enumerate", "reattach", "tty", "stats"];
|
||||
public IReadOnlyList<string> Capabilities => CapabilityList;
|
||||
|
||||
public void SetEvents(IBrokerEvents events) => Events = events;
|
||||
|
||||
private void Record(string call)
|
||||
|
||||
Reference in New Issue
Block a user