fix: include context in elevated exec denial

This commit is contained in:
Peter Steinberger
2026-01-17 17:55:04 +00:00
parent 75588fe732
commit 252dfbcd40
4 changed files with 15 additions and 2 deletions

View File

@@ -150,6 +150,8 @@ describe("exec tool backgrounding", () => {
it("rejects elevated requests when not allowed", async () => {
const customBash = createExecTool({
elevated: { enabled: true, allowed: false, defaultLevel: "off" },
messageProvider: "telegram",
sessionKey: "agent:main:main",
});
await expect(
@@ -157,7 +159,7 @@ describe("exec tool backgrounding", () => {
command: "echo hi",
elevated: true,
}),
).rejects.toThrow("tools.elevated.allowFrom.<provider>");
).rejects.toThrow("Context: provider=telegram session=agent:main:main");
});
it("does not default to elevated when not allowed", async () => {