fix(chat): restore forked context
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
buildPromptWithLearningContext,
|
||||
extractLatestFrontendTurn,
|
||||
generateSessionTitle,
|
||||
shouldRestoreConversationForRuntime,
|
||||
shouldGenerateSessionTitle,
|
||||
} from "../../src/routes/chatSession.js";
|
||||
import { type SessionTurnRecord } from "../../src/sessions/transcriptStore.js";
|
||||
@@ -161,6 +162,21 @@ describe("buildPromptWithLearningContext", () => {
|
||||
expect(prompt).not.toContain("[Previous conversation context]");
|
||||
expect(prompt).toBe("基于刚才结果继续分析");
|
||||
});
|
||||
|
||||
it("restores copied fork context when metadata exists but runtime has no conversation", () => {
|
||||
expect(
|
||||
shouldRestoreConversationForRuntime({
|
||||
hadExistingSessionRecord: true,
|
||||
runtimeHasConversation: false,
|
||||
}),
|
||||
).toBe(true);
|
||||
expect(
|
||||
shouldRestoreConversationForRuntime({
|
||||
hadExistingSessionRecord: true,
|
||||
runtimeHasConversation: true,
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("extractLatestFrontendTurn", () => {
|
||||
|
||||
Reference in New Issue
Block a user