fix: a sandboxed agent can request host node in an ex (#384) (#63880)

This commit is contained in:
Devin Robison
2026-04-10 10:40:27 -06:00
committed by GitHub
parent 777c6f7580
commit dffad08529
5 changed files with 91 additions and 16 deletions

View File

@@ -127,7 +127,20 @@ describe("resolveExecTarget", () => {
sandboxAvailable: true,
}),
).toThrow(
"exec host not allowed (requested gateway; configured host is auto; set tools.exec.host=gateway or auto to allow this override).",
"exec host not allowed (requested gateway; configured host is auto; set tools.exec.host=gateway to allow this override).",
);
});
it("rejects per-call host=node override from auto when sandbox is available", () => {
expect(() =>
resolveExecTarget({
configuredTarget: "auto",
requestedTarget: "node",
elevatedRequested: false,
sandboxAvailable: true,
}),
).toThrow(
"exec host not allowed (requested node; configured host is auto; set tools.exec.host=node to allow this override).",
);
});