Auto-reply: fix reset test gate

This commit is contained in:
Peter Steinberger
2026-04-07 12:40:14 +01:00
parent 98822fdd63
commit c83db77629
2 changed files with 1 additions and 25 deletions

View File

@@ -14,7 +14,7 @@ vi.mock("./reply/dispatch-from-config.js", () => ({
}));
vi.mock("./reply/inbound-context.js", () => ({
finalizeInboundContext: (...args: unknown[]) => hoisted.finalizeInboundContextMock(...args),
finalizeInboundContext: (ctx: unknown) => hoisted.finalizeInboundContextMock(ctx),
}));
vi.mock("./reply/reply-dispatcher.js", async () => {

View File

@@ -1,7 +1,6 @@
import { resetConfiguredBindingTargetInPlace } from "../../channels/plugins/binding-targets.js";
import { logVerbose } from "../../globals.js";
import { isAcpSessionKey } from "../../routing/session-key.js";
import { normalizeOptionalLowercaseString } from "../../shared/string-coerce.js";
import { resolveBoundAcpThreadSessionKey } from "./commands-acp/targets.js";
import { emitResetCommandHooks, type ResetCommandAction } from "./commands-reset-hooks.js";
import type { CommandHandlerResult, HandleCommandsParams } from "./commands-types.js";
@@ -16,29 +15,6 @@ function applyAcpResetTailContext(ctx: HandleCommandsParams["ctx"], resetTail: s
mutableCtx.BodyStripped = resetTail;
mutableCtx.AcpDispatchTailAfterReset = true;
}
function resolveSessionEntryForHookSessionKey(
sessionStore: HandleCommandsParams["sessionStore"] | undefined,
sessionKey: string,
): HandleCommandsParams["sessionEntry"] | undefined {
if (!sessionStore) {
return undefined;
}
const directEntry = sessionStore[sessionKey];
if (directEntry) {
return directEntry;
}
const normalizedTarget = sessionKey.trim().toLowerCase();
if (!normalizedTarget) {
return undefined;
}
for (const [candidateKey, candidateEntry] of Object.entries(sessionStore)) {
if (normalizeOptionalLowercaseString(candidateKey) === normalizedTarget) {
return candidateEntry;
}
}
return undefined;
}
export async function maybeHandleResetCommand(
params: HandleCommandsParams,
): Promise<CommandHandlerResult | null> {