mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-13 08:20:34 +00:00
fix(gateway): harden message action channel fallback and startup grace
Take the safe, tested subset from #32367:\n- per-channel startup connect grace in health monitor\n- tool-context channel-provider fallback for message actions\n\nCo-authored-by: Munem Hashmi <munem.hashmi@gmail.com>
This commit is contained in:
@@ -349,6 +349,37 @@ describe("runMessageAction context isolation", () => {
|
||||
expect(result.channel).toBe("slack");
|
||||
});
|
||||
|
||||
it("falls back to tool-context provider when channel param is an id", async () => {
|
||||
const result = await runDrySend({
|
||||
cfg: slackConfig,
|
||||
actionParams: {
|
||||
channel: "C12345678",
|
||||
target: "#C12345678",
|
||||
message: "hi",
|
||||
},
|
||||
toolContext: { currentChannelId: "C12345678", currentChannelProvider: "slack" },
|
||||
});
|
||||
|
||||
expect(result.kind).toBe("send");
|
||||
expect(result.channel).toBe("slack");
|
||||
});
|
||||
|
||||
it("falls back to tool-context provider for broadcast channel ids", async () => {
|
||||
const result = await runDryAction({
|
||||
cfg: slackConfig,
|
||||
action: "broadcast",
|
||||
actionParams: {
|
||||
targets: ["channel:C12345678"],
|
||||
channel: "C12345678",
|
||||
message: "hi",
|
||||
},
|
||||
toolContext: { currentChannelProvider: "slack" },
|
||||
});
|
||||
|
||||
expect(result.kind).toBe("broadcast");
|
||||
expect(result.channel).toBe("slack");
|
||||
});
|
||||
|
||||
it("blocks cross-provider sends by default", async () => {
|
||||
await expect(
|
||||
runDrySend({
|
||||
|
||||
Reference in New Issue
Block a user