Skip to content

Commit c6817d8

Browse files
committed
fix: preserve heartbeat wake compatibility (#76086)
1 parent c06739d commit c6817d8

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/agents/bash-tools.exec-runtime.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ describe("emitExecSystemEvent", () => {
441441
to: "telegram:-100123:topic:47",
442442
threadId: 47,
443443
},
444+
trusted: false,
444445
});
445446
expect(requestHeartbeatMock).toHaveBeenCalledWith(
446447
expect.objectContaining({
@@ -460,6 +461,7 @@ describe("emitExecSystemEvent", () => {
460461
expect(enqueueSystemEventMock).toHaveBeenCalledWith("Exec finished", {
461462
sessionKey: "global",
462463
contextKey: "exec:run-global",
464+
trusted: false,
463465
});
464466
expect(requestHeartbeatMock).toHaveBeenCalledWith(
465467
expect.objectContaining({

src/agents/bash-tools.exec-runtime.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ export function emitExecSystemEvent(
426426
sessionKey,
427427
contextKey: opts.contextKey,
428428
deliveryContext: opts.deliveryContext,
429+
trusted: false,
429430
});
430431
requestHeartbeat(
431432
scopedHeartbeatWakeOptions(sessionKey, {

src/plugins/runtime/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ describe("plugin runtime command execution", () => {
185185
expectRuntimeValue(readValue, expected);
186186
});
187187

188-
it("maps deprecated runtime.system.requestHeartbeatNow to a structured event wake", async () => {
188+
it("maps deprecated runtime.system.requestHeartbeatNow to an immediate compatibility wake", async () => {
189189
vi.useFakeTimers();
190190
resetHeartbeatWakeStateForTests();
191191
const handler = vi.fn(async () => ({ status: "skipped" as const, reason: "disabled" }));
@@ -199,7 +199,7 @@ describe("plugin runtime command execution", () => {
199199
expect(handler).toHaveBeenCalledWith(
200200
expect.objectContaining({
201201
source: "other",
202-
intent: "event",
202+
intent: "immediate",
203203
reason: "legacy-plugin",
204204
}),
205205
);

src/plugins/runtime/runtime-system.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function createRuntimeSystem(): PluginRuntime["system"] {
1818
const requestHeartbeatNow: PluginRuntime["system"]["requestHeartbeatNow"] = (opts) =>
1919
requestHeartbeat({
2020
source: opts?.source ?? "other",
21-
intent: opts?.intent ?? "event",
21+
intent: opts?.intent ?? "immediate",
2222
reason: opts?.reason,
2323
coalesceMs: opts?.coalesceMs,
2424
agentId: opts?.agentId,

0 commit comments

Comments
 (0)