Skip to content

Commit ba8b437

Browse files
committed
fix: keep explicit quiet replies suppressed
1 parent d4b98f0 commit ba8b437

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

‎src/auto-reply/reply/source-reply-delivery-mode.test.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ describe("resolveSourceReplyDeliveryMode", () => {
178178
).toBe("message_tool_only");
179179
});
180180

181-
it("falls back to automatic when message tool is unavailable", () => {
181+
it("falls back to automatic only for implicit message-tool-only mode", () => {
182182
expect(
183183
resolveSourceReplyDeliveryMode({
184184
cfg: emptyConfig,
@@ -200,7 +200,7 @@ describe("resolveSourceReplyDeliveryMode", () => {
200200
requested: "message_tool_only",
201201
messageToolAvailable: false,
202202
}),
203-
).toBe("automatic");
203+
).toBe("message_tool_only");
204204
});
205205

206206
it("keeps message-tool-only delivery when message tool availability is unknown", () => {
@@ -378,7 +378,7 @@ describe("resolveSourceReplyVisibilityPolicy", () => {
378378
},
379379
);
380380
});
381-
it("keeps delivery automatic when message-tool-only mode cannot send visibly", () => {
381+
it("falls back to automatic only for implicit message-tool-only mode", () => {
382382
expectPolicyFields(
383383
resolveSourceReplyVisibilityPolicy({
384384
cfg: emptyConfig,
@@ -403,10 +403,10 @@ describe("resolveSourceReplyVisibilityPolicy", () => {
403403
messageToolAvailable: false,
404404
}),
405405
{
406-
sourceReplyDeliveryMode: "automatic",
407-
suppressAutomaticSourceDelivery: false,
408-
suppressDelivery: false,
409-
deliverySuppressionReason: "",
406+
sourceReplyDeliveryMode: "message_tool_only",
407+
suppressAutomaticSourceDelivery: true,
408+
suppressDelivery: true,
409+
deliverySuppressionReason: "sourceReplyDeliveryMode: message_tool_only",
410410
},
411411
);
412412
});

‎src/auto-reply/reply/source-reply-delivery-mode.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ export function resolveSourceReplyDeliveryMode(params: {
2828
defaultVisibleReplies?: "automatic" | "message_tool";
2929
}): SourceReplyDeliveryMode {
3030
if (params.requested) {
31-
return params.messageToolAvailable === false && params.requested === "message_tool_only"
32-
? "automatic"
33-
: params.requested;
31+
return params.requested;
3432
}
3533
if (isExplicitSourceReplyCommand(params.ctx)) {
3634
return "automatic";

0 commit comments

Comments
 (0)