mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 09:10:45 +00:00
fix: preserve heartbeat wake compatibility (#76086)
This commit is contained in:
@@ -441,6 +441,7 @@ describe("emitExecSystemEvent", () => {
|
||||
to: "telegram:-100123:topic:47",
|
||||
threadId: 47,
|
||||
},
|
||||
trusted: false,
|
||||
});
|
||||
expect(requestHeartbeatMock).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
@@ -460,6 +461,7 @@ describe("emitExecSystemEvent", () => {
|
||||
expect(enqueueSystemEventMock).toHaveBeenCalledWith("Exec finished", {
|
||||
sessionKey: "global",
|
||||
contextKey: "exec:run-global",
|
||||
trusted: false,
|
||||
});
|
||||
expect(requestHeartbeatMock).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
|
||||
@@ -426,6 +426,7 @@ export function emitExecSystemEvent(
|
||||
sessionKey,
|
||||
contextKey: opts.contextKey,
|
||||
deliveryContext: opts.deliveryContext,
|
||||
trusted: false,
|
||||
});
|
||||
requestHeartbeat(
|
||||
scopedHeartbeatWakeOptions(sessionKey, {
|
||||
|
||||
@@ -185,7 +185,7 @@ describe("plugin runtime command execution", () => {
|
||||
expectRuntimeValue(readValue, expected);
|
||||
});
|
||||
|
||||
it("maps deprecated runtime.system.requestHeartbeatNow to a structured event wake", async () => {
|
||||
it("maps deprecated runtime.system.requestHeartbeatNow to an immediate compatibility wake", async () => {
|
||||
vi.useFakeTimers();
|
||||
resetHeartbeatWakeStateForTests();
|
||||
const handler = vi.fn(async () => ({ status: "skipped" as const, reason: "disabled" }));
|
||||
@@ -199,7 +199,7 @@ describe("plugin runtime command execution", () => {
|
||||
expect(handler).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
source: "other",
|
||||
intent: "event",
|
||||
intent: "immediate",
|
||||
reason: "legacy-plugin",
|
||||
}),
|
||||
);
|
||||
|
||||
@@ -18,7 +18,7 @@ export function createRuntimeSystem(): PluginRuntime["system"] {
|
||||
const requestHeartbeatNow: PluginRuntime["system"]["requestHeartbeatNow"] = (opts) =>
|
||||
requestHeartbeat({
|
||||
source: opts?.source ?? "other",
|
||||
intent: opts?.intent ?? "event",
|
||||
intent: opts?.intent ?? "immediate",
|
||||
reason: opts?.reason,
|
||||
coalesceMs: opts?.coalesceMs,
|
||||
agentId: opts?.agentId,
|
||||
|
||||
Reference in New Issue
Block a user