mirror of
https://github.com/Youzini-afk/ST-Bionic-Memory-Ecology.git
synced 2026-05-15 22:30:38 +08:00
Narrow trivial input skip rules
This commit is contained in:
@@ -21,9 +21,9 @@ function testIsTrivialUserInputTable() {
|
||||
["/echo hello", true, "slash-command"],
|
||||
["/", true, "slash-command"],
|
||||
[" /echo", true, "slash-command"],
|
||||
["a", true, "under-min-tokens"],
|
||||
["好", true, "under-min-tokens"],
|
||||
["ok", true, "under-min-tokens"],
|
||||
["a", false, ""],
|
||||
["好", false, ""],
|
||||
["ok", false, ""],
|
||||
["ok a", false, ""],
|
||||
["好的", false, ""],
|
||||
["好的呀", false, ""],
|
||||
@@ -68,27 +68,6 @@ async function testSlashCommandSkipsRecallAndExtraction() {
|
||||
assert.equal(harness.result.getCurrentGenerationTrivialSkip(), null);
|
||||
}
|
||||
|
||||
async function testUnderMinTokensSkipsRecallAndExtraction() {
|
||||
const harness = await createGenerationRecallHarness();
|
||||
harness.chat = [];
|
||||
harness.__sendTextareaValue = "a";
|
||||
|
||||
const startResult = harness.result.onGenerationStarted("normal", {}, false);
|
||||
assert.equal(startResult, null);
|
||||
assert.equal(
|
||||
harness.result.getCurrentGenerationTrivialSkip()?.reason,
|
||||
"under-min-tokens",
|
||||
);
|
||||
|
||||
await harness.result.onGenerationAfterCommands("normal", {}, false);
|
||||
assert.equal(harness.runRecallCalls.length, 0);
|
||||
|
||||
harness.chat.push({ is_user: false, mes: "assistant reply" });
|
||||
harness.invokeOnMessageReceived(0, "");
|
||||
assert.equal(harness.runExtractionCalls.length, 0);
|
||||
assert.equal(harness.result.getCurrentGenerationTrivialSkip(), null);
|
||||
}
|
||||
|
||||
async function testEmptyInputSkipsPriorHistoryFallback() {
|
||||
const harness = await createGenerationRecallHarness();
|
||||
harness.chat = [{ is_user: true, mes: "older real user message" }];
|
||||
@@ -284,7 +263,6 @@ async function testSkipFlagTtlExpires() {
|
||||
await Promise.resolve();
|
||||
testIsTrivialUserInputTable();
|
||||
await testSlashCommandSkipsRecallAndExtraction();
|
||||
await testUnderMinTokensSkipsRecallAndExtraction();
|
||||
await testEmptyInputSkipsPriorHistoryFallback();
|
||||
await testNormalInputStillRecalls();
|
||||
await testSentinelBlocksHistoryFallback();
|
||||
|
||||
Reference in New Issue
Block a user