mirror of
https://github.com/Youzini-afk/ST-Bionic-Memory-Ecology.git
synced 2026-06-14 02:40:45 +08:00
Fix extraction defer and dry-run recall guards
This commit is contained in:
@@ -2697,6 +2697,16 @@ async function testGenerationRecallBeforeCombineRunsStandalone() {
|
||||
);
|
||||
}
|
||||
|
||||
async function testGenerationRecallDryRunPreviewDoesNotTriggerBeforeCombineRecall() {
|
||||
const harness = await createGenerationRecallHarness();
|
||||
harness.chat = [{ is_user: true, mes: "Prompt Viewer 预览" }];
|
||||
|
||||
harness.result.onGenerationStarted("normal", {}, true);
|
||||
await harness.result.onBeforeCombinePrompts();
|
||||
|
||||
assert.equal(harness.runRecallCalls.length, 0);
|
||||
}
|
||||
|
||||
async function testGenerationRecallDifferentKeyCanRunAgain() {
|
||||
const harness = await createGenerationRecallHarness();
|
||||
harness.chat = [{ is_user: true, mes: "第一条" }];
|
||||
@@ -2874,6 +2884,19 @@ async function testAutoExtractionDefersWhenGraphNotReady() {
|
||||
assert.equal(statuses[0]?.[0], "等待图谱加载");
|
||||
}
|
||||
|
||||
async function testAutoExtractionDefersWhenAlreadyExtracting() {
|
||||
const deferredReasons = [];
|
||||
|
||||
await runExtractionController({
|
||||
getIsExtracting: () => true,
|
||||
deferAutoExtraction(reason) {
|
||||
deferredReasons.push(reason);
|
||||
},
|
||||
});
|
||||
|
||||
assert.deepEqual(deferredReasons, ["extracting"]);
|
||||
}
|
||||
|
||||
async function testAutoExtractionDefersWhenHistoryRecoveryBusy() {
|
||||
const deferredReasons = [];
|
||||
|
||||
@@ -3986,12 +4009,14 @@ await testGenerationRecallSameKeyCanRunAgainImmediatelyAsNewGeneration();
|
||||
await testGenerationRecallSameKeyCanRunAgainAfterBridgeWindow();
|
||||
await testBeforeCombineRecallNotSkippedWhenGraphLoadingButRuntimeGraphReadable();
|
||||
await testGenerationRecallBeforeCombineRunsStandalone();
|
||||
await testGenerationRecallDryRunPreviewDoesNotTriggerBeforeCombineRecall();
|
||||
await testGenerationRecallDifferentKeyCanRunAgain();
|
||||
await testGenerationRecallSkippedStateDoesNotLoopToBeforeCombine();
|
||||
await testGenerationRecallSentMessageClearsStaleTransactionForSameKey();
|
||||
await testRegisterCoreEventHooksIsIdempotent();
|
||||
await testChatChangedDoesNotClearCoreEventBindings();
|
||||
await testAutoExtractionDefersWhenGraphNotReady();
|
||||
await testAutoExtractionDefersWhenAlreadyExtracting();
|
||||
await testAutoExtractionDefersWhenHistoryRecoveryBusy();
|
||||
await testRemoveNodeHandlesCyclicChildGraph();
|
||||
await testGenerationRecallAppliesFinalInjectionOncePerTransaction();
|
||||
|
||||
Reference in New Issue
Block a user