fix(types): align restart sentinel and typing test mocks

This commit is contained in:
Peter Steinberger
2026-02-18 18:25:14 +00:00
parent 0def1ac1d2
commit 307719abe9
2 changed files with 3 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
import { beforeEach, describe, expect, it, vi } from "vitest"; import { beforeEach, describe, expect, it, vi } from "vitest";
import type { ReplyPayload } from "../types.js"; import type { ReplyPayload } from "../types.js";
import type { TypingSignaler } from "./typing-mode.js";
const hoisted = vi.hoisted(() => { const hoisted = vi.hoisted(() => {
const loadSessionStoreMock = vi.fn(); const loadSessionStoreMock = vi.fn();
@@ -100,7 +101,7 @@ describe("agent runner helpers", () => {
it("signals typing only when any payload has text or media", async () => { it("signals typing only when any payload has text or media", async () => {
const signalRunStart = vi.fn().mockResolvedValue(undefined); const signalRunStart = vi.fn().mockResolvedValue(undefined);
const typingSignals = { signalRunStart }; const typingSignals = { signalRunStart } as unknown as TypingSignaler;
const emptyPayloads: ReplyPayload[] = [{ text: " " }, {}]; const emptyPayloads: ReplyPayload[] = [{ text: " " }, {}];
await signalTypingIfNeeded(emptyPayloads, typingSignals); await signalTypingIfNeeded(emptyPayloads, typingSignals);
expect(signalRunStart).not.toHaveBeenCalled(); expect(signalRunStart).not.toHaveBeenCalled();

View File

@@ -34,7 +34,7 @@ export async function scheduleRestartSentinelWake(_params: { deps: CliDeps }) {
const { baseSessionKey, threadId: sessionThreadId } = parseSessionThreadInfo(sessionKey); const { baseSessionKey, threadId: sessionThreadId } = parseSessionThreadInfo(sessionKey);
const { cfg, entry } = loadSessionEntry(sessionKey); const { cfg, entry } = loadSessionEntry(sessionKey);
const parsedTarget = resolveAnnounceTargetFromKey(baseSessionKey); const parsedTarget = resolveAnnounceTargetFromKey(baseSessionKey ?? sessionKey);
// Prefer delivery context from sentinel (captured at restart) over session store // Prefer delivery context from sentinel (captured at restart) over session store
// Handles race condition where store wasn't flushed before restart // Handles race condition where store wasn't flushed before restart