refactor(auto-reply): reuse abort session-entry resolver

This commit is contained in:
Peter Steinberger
2026-02-18 23:08:46 +00:00
parent c0c10f42e2
commit 8b257703d8
3 changed files with 15 additions and 15 deletions

View File

@@ -12,26 +12,13 @@ import { normalizeUsageDisplay, resolveResponseUsageMode } from "../thinking.js"
import {
formatAbortReplyText,
isAbortTrigger,
resolveSessionEntryForKey,
setAbortMemory,
stopSubagentsForRequester,
} from "./abort.js";
import type { CommandHandler } from "./commands-types.js";
import { clearSessionQueues } from "./queue.js";
function resolveSessionEntryForKey(
store: Record<string, SessionEntry> | undefined,
sessionKey: string | undefined,
) {
if (!store || !sessionKey) {
return {};
}
const direct = store[sessionKey];
if (direct) {
return { entry: direct, key: sessionKey };
}
return {};
}
function resolveAbortTarget(params: {
ctx: { CommandTargetSessionKey?: string | null };
sessionKey?: string;