fix: 提示词链里的引导提问不算轮数,分类器固定结果、跳过过短输入

- 引导对话和 AI 对话存在同一个对话里,提示词链把它当成一轮“AI 对话”,显示“没有网页”。
  现在标成“引导”,淡化显示,不计入轮数,也不能选中(↑↓ 跳过)
- 分类器 temperature 设为 0:同一句提示词以前约两成会被打成不同层级
- 不到 4 个字的提问(“1”“,”等)不打层级,--force 重标时清掉旧标签

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-10-27 20:26:29 +08:00
1 parent bc9da688ba
commit 30630e8125
6 files changed
+73 -10

No files matched your search

+13
View File
@@ -646,3 +646,16 @@ describe("课堂总结", () => {
expect(all.json.top_scored.map((t: any) => t.username)).toEqual(["weba2小李", "weba1小明"])
})
})
describe("提示词分类", () => {
test("太短的提问不打层级,以前打的也清掉", async () => {
const { classifyMessage } = await import("../src/services/classifier")
const { createConversation, insertMessage } = await import("../src/services/prompt")
const conv = createConversation(makeUser("stu"), makeTask("T"))
const id = insertMessage({ conversation_id: conv, role: "user", content: " 1 " })
run(`UPDATE prompt_message SET prompt_level = 6 WHERE id = $id`, { id })
expect(await classifyMessage(id)).toBeNull()
const row = get<{ prompt_level: number | null }>(`SELECT prompt_level FROM prompt_message WHERE id = $id`, { id })
expect(row!.prompt_level).toBeNull()
})
})