phase2-4 recall prompt-flow hardening

This commit is contained in:
Youzini-afk
2026-04-11 18:51:50 +08:00
parent 3a10dbb9ba
commit 0cb95c4f2b
14 changed files with 1069 additions and 143 deletions

View File

@@ -450,6 +450,23 @@ export async function onGenerationAfterCommandsController(
const runtimeRecallOptions =
recallContext.recallOptions || recallOptions || {};
if (
params &&
typeof params === "object" &&
runtimeRecallOptions?.authoritativeInputUsed === true
) {
const authoritativePrompt = String(
runtimeRecallOptions?.overrideUserMessage ||
runtimeRecallOptions?.userMessage ||
"",
).trim();
if (authoritativePrompt) {
params.prompt = authoritativePrompt;
if (Object.prototype.hasOwnProperty.call(params, "user_input")) {
params.user_input = authoritativePrompt;
}
}
}
const deliveryMode =
runtime.resolveGenerationRecallDeliveryMode?.(
recallContext.hookName,