






















@@ -103,6 +103,20 @@ describe("exec approval followup", () => {
103103expect(sendMessage).not.toHaveBeenCalled();
104104});
105105106+it("suppresses denied followups for normal sessions", async () => {
107+await expect(
108+sendExecApprovalFollowup({
109+approvalId: "req-denied-main",
110+sessionKey: "agent:main:main",
111+turnSourceChannel: "webchat",
112+resultText: "Exec denied (gateway id=req-denied-main, user-denied): uname -a",
113+}),
114+).resolves.toBe(false);
115+116+expect(callGatewayTool).not.toHaveBeenCalled();
117+expect(sendMessage).not.toHaveBeenCalled();
118+});
119+106120it.each([
107121{
108122channel: "slack",
@@ -263,9 +277,7 @@ describe("exec approval followup", () => {
263277});
264278});
265279266-it("uses safe denied copy when session resume fails", async () => {
267-vi.mocked(callGatewayTool).mockRejectedValueOnce(new Error("session missing"));
268-280+it("uses safe direct denied copy without resuming the session", async () => {
269281await sendExecApprovalFollowup({
270282approvalId: "req-denied-resume-failed",
271283sessionKey: "agent:main:telegram:-100123",
@@ -277,10 +289,10 @@ describe("exec approval followup", () => {
277289});
278290279291expectDirectSend({
280-content:
281-"Automatic session resume failed, so sending the status directly.\n\nCommand did not run: approval timed out.",
292+content: "Command did not run: approval timed out.",
282293idempotencyKey: "exec-approval-followup:req-denied-resume-failed",
283294});
295+expect(callGatewayTool).not.toHaveBeenCalled();
284296});
285297286298it("suppresses denied followups for subagent sessions", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。