59559d4b24
Thinking disappeared on failure and never reached session storage. Keep the sanitized chain on disk and on errors, and regroup the sidebar around reports, charts, favorites, and dated history titles. Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
931 B
TypeScript
27 lines
931 B
TypeScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
|
|
import { deriveConsultationFollowUps } from "../src/lib/consultation-follow-ups.ts";
|
|
|
|
test("daily answers surface grounded next questions instead of theme lookup chips", () => {
|
|
const followUps = deriveConsultationFollowUps({
|
|
question: "深入看今日",
|
|
answer: "今天更适合推进已经开过口的事,也要避开临时加塞的承诺。这股节奏会把注意力放在一件主线上。",
|
|
theme: "timing",
|
|
entrypoint: "daily_starlanguage",
|
|
});
|
|
assert.deepEqual(followUps, [
|
|
"今天最该先推进哪一件",
|
|
"这周哪些事最好先放一放",
|
|
"这股节奏大概还会持续多久",
|
|
]);
|
|
});
|
|
|
|
test("short or empty answers do not invent follow-ups", () => {
|
|
assert.deepEqual(deriveConsultationFollowUps({
|
|
question: "事业下一步怎么走?",
|
|
answer: "可以。",
|
|
theme: "career",
|
|
}), []);
|
|
});
|