mirror of
https://github.com/Youzini-afk/ST-Bionic-Memory-Ecology.git
synced 2026-05-15 22:30:38 +08:00
merge: sync main into dev after PR #29
This commit is contained in:
@@ -284,6 +284,36 @@ async function testSkipFlagTtlExpires() {
|
||||
}
|
||||
}
|
||||
|
||||
async function testPromptViewerSyntheticGenerationSkipsRecall() {
|
||||
const harness = await createGenerationRecallHarness();
|
||||
const fakeDialog = {
|
||||
textContent: "Prompt Viewer",
|
||||
querySelector(selector) {
|
||||
if (selector === ".fa-rotate-right.animate-spin") {
|
||||
return {};
|
||||
}
|
||||
return null;
|
||||
},
|
||||
};
|
||||
harness.document.querySelectorAll = (selector) =>
|
||||
selector === '[role="dialog"]' ? [fakeDialog] : [];
|
||||
harness.__sendTextareaValue = "hello world";
|
||||
|
||||
const startResult = harness.result.onGenerationStarted("normal", {}, false);
|
||||
assert.equal(startResult, null);
|
||||
assert.equal(
|
||||
harness.result.getCurrentGenerationTrivialSkip()?.reason,
|
||||
"tavern-helper-prompt-viewer",
|
||||
);
|
||||
|
||||
const beforeCombine = await harness.result.onBeforeCombinePrompts();
|
||||
assert.deepEqual(beforeCombine, {
|
||||
skipped: true,
|
||||
reason: "tavern-helper-prompt-viewer",
|
||||
});
|
||||
assert.equal(harness.runRecallCalls.length, 0);
|
||||
}
|
||||
|
||||
await Promise.resolve();
|
||||
testIsTrivialUserInputTable();
|
||||
await testSlashCommandSkipsRecallAndExtraction();
|
||||
@@ -297,5 +327,6 @@ await testNonTrivialGenerationClearsResidualTrivialSkip();
|
||||
await testNonTargetMessageIdDoesNotConsumeFlag();
|
||||
await testNullMessageIdFallsBackToLastAssistantIndex();
|
||||
await testSkipFlagTtlExpires();
|
||||
await testPromptViewerSyntheticGenerationSkipsRecall();
|
||||
|
||||
console.log("trivial-user-input tests passed");
|
||||
|
||||
Reference in New Issue
Block a user