Skip to content

Commit a2f1d1d

Browse files
committed
fix(reply): keep text command replies visible
1 parent 5e218b4 commit a2f1d1d

2 files changed

Lines changed: 26 additions & 22 deletions

File tree

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

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,15 @@ describe("resolveSourceReplyDeliveryMode", () => {
8787
).toBe("automatic");
8888
});
8989

90-
it("treats native commands as explicit replies in groups", () => {
91-
expect(
92-
resolveSourceReplyDeliveryMode({
93-
cfg: emptyConfig,
94-
ctx: { ChatType: "group", CommandSource: "native" },
95-
}),
96-
).toBe("automatic");
90+
it("treats native and text commands as explicit replies in groups", () => {
91+
for (const CommandSource of ["native", "text"] as const) {
92+
expect(
93+
resolveSourceReplyDeliveryMode({
94+
cfg: emptyConfig,
95+
ctx: { ChatType: "group", CommandSource },
96+
}),
97+
).toBe("automatic");
98+
}
9799
});
98100

99101
it("falls back to automatic when message tool is unavailable", () => {
@@ -177,20 +179,22 @@ describe("resolveSourceReplyVisibilityPolicy", () => {
177179
});
178180
});
179181

180-
it("keeps native command replies visible in groups", () => {
181-
expect(
182-
resolveSourceReplyVisibilityPolicy({
183-
cfg: emptyConfig,
184-
ctx: { ChatType: "group", CommandSource: "native" },
185-
sendPolicy: "allow",
186-
}),
187-
).toMatchObject({
188-
sourceReplyDeliveryMode: "automatic",
189-
suppressAutomaticSourceDelivery: false,
190-
suppressDelivery: false,
191-
suppressHookReplyLifecycle: false,
192-
suppressTyping: false,
193-
});
182+
it("keeps native and text command replies visible in groups", () => {
183+
for (const CommandSource of ["native", "text"] as const) {
184+
expect(
185+
resolveSourceReplyVisibilityPolicy({
186+
cfg: emptyConfig,
187+
ctx: { ChatType: "group", CommandSource },
188+
sendPolicy: "allow",
189+
}),
190+
).toMatchObject({
191+
sourceReplyDeliveryMode: "automatic",
192+
suppressAutomaticSourceDelivery: false,
193+
suppressDelivery: false,
194+
suppressHookReplyLifecycle: false,
195+
suppressTyping: false,
196+
});
197+
}
194198
});
195199

196200
it("keeps configured automatic group delivery visible", () => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function resolveSourceReplyDeliveryMode(params: {
2020
? "automatic"
2121
: params.requested;
2222
}
23-
if (params.ctx.CommandSource === "native") {
23+
if (params.ctx.CommandSource === "native" || params.ctx.CommandSource === "text") {
2424
return "automatic";
2525
}
2626
const chatType = normalizeChatType(params.ctx.ChatType);

0 commit comments

Comments
 (0)