mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 19:50:43 +00:00
fix(reply): keep text command replies visible
This commit is contained in:
@@ -87,13 +87,15 @@ describe("resolveSourceReplyDeliveryMode", () => {
|
||||
).toBe("automatic");
|
||||
});
|
||||
|
||||
it("treats native commands as explicit replies in groups", () => {
|
||||
expect(
|
||||
resolveSourceReplyDeliveryMode({
|
||||
cfg: emptyConfig,
|
||||
ctx: { ChatType: "group", CommandSource: "native" },
|
||||
}),
|
||||
).toBe("automatic");
|
||||
it("treats native and text commands as explicit replies in groups", () => {
|
||||
for (const CommandSource of ["native", "text"] as const) {
|
||||
expect(
|
||||
resolveSourceReplyDeliveryMode({
|
||||
cfg: emptyConfig,
|
||||
ctx: { ChatType: "group", CommandSource },
|
||||
}),
|
||||
).toBe("automatic");
|
||||
}
|
||||
});
|
||||
|
||||
it("falls back to automatic when message tool is unavailable", () => {
|
||||
@@ -177,20 +179,22 @@ describe("resolveSourceReplyVisibilityPolicy", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps native command replies visible in groups", () => {
|
||||
expect(
|
||||
resolveSourceReplyVisibilityPolicy({
|
||||
cfg: emptyConfig,
|
||||
ctx: { ChatType: "group", CommandSource: "native" },
|
||||
sendPolicy: "allow",
|
||||
}),
|
||||
).toMatchObject({
|
||||
sourceReplyDeliveryMode: "automatic",
|
||||
suppressAutomaticSourceDelivery: false,
|
||||
suppressDelivery: false,
|
||||
suppressHookReplyLifecycle: false,
|
||||
suppressTyping: false,
|
||||
});
|
||||
it("keeps native and text command replies visible in groups", () => {
|
||||
for (const CommandSource of ["native", "text"] as const) {
|
||||
expect(
|
||||
resolveSourceReplyVisibilityPolicy({
|
||||
cfg: emptyConfig,
|
||||
ctx: { ChatType: "group", CommandSource },
|
||||
sendPolicy: "allow",
|
||||
}),
|
||||
).toMatchObject({
|
||||
sourceReplyDeliveryMode: "automatic",
|
||||
suppressAutomaticSourceDelivery: false,
|
||||
suppressDelivery: false,
|
||||
suppressHookReplyLifecycle: false,
|
||||
suppressTyping: false,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
it("keeps configured automatic group delivery visible", () => {
|
||||
|
||||
@@ -20,7 +20,7 @@ export function resolveSourceReplyDeliveryMode(params: {
|
||||
? "automatic"
|
||||
: params.requested;
|
||||
}
|
||||
if (params.ctx.CommandSource === "native") {
|
||||
if (params.ctx.CommandSource === "native" || params.ctx.CommandSource === "text") {
|
||||
return "automatic";
|
||||
}
|
||||
const chatType = normalizeChatType(params.ctx.ChatType);
|
||||
|
||||
Reference in New Issue
Block a user