fix(rectification): resolve typed focus answers deterministically
This commit is contained in:
@@ -1448,10 +1448,10 @@ test("persisted choice prompt replaces a competing model follow-up without a top
|
||||
);
|
||||
});
|
||||
|
||||
test("year-locked agent follow-up is kept instead of the server template", async () => {
|
||||
test("persisted choice card owns a matching year-locked follow-up", async () => {
|
||||
const spoken = "好,实习和离职都记下了。\n\n2023 年前后,你有没有入职或者职责明显加重过?";
|
||||
const prompt = "2023 年前后 · 入职、升职或职责明显加重";
|
||||
assert.equal(bindSpokenToOpenQuestion(spoken, prompt), spoken);
|
||||
assert.equal(bindSpokenToOpenQuestion(spoken, prompt), "好,实习和离职都记下了。");
|
||||
|
||||
const { options, emitted } = runOptions({
|
||||
buildAgent: async () => fakeAgentStream([
|
||||
@@ -1471,12 +1471,12 @@ test("year-locked agent follow-up is kept instead of the server template", async
|
||||
});
|
||||
const result = await runV9AgentTurn(options);
|
||||
assert.equal(result.ok, true);
|
||||
assert.equal(result.answerText, spoken);
|
||||
assert.match(result.answerText, /你有没有入职或者职责明显加重过/);
|
||||
assert.equal(result.answerText, "好,实习和离职都记下了。");
|
||||
assert.doesNotMatch(result.answerText, /你有没有入职或者职责明显加重过/);
|
||||
assert.doesNotMatch(result.answerText, /有没有明显入职、升职或职责明显加重/);
|
||||
assert.deepEqual(
|
||||
emitted.filter((event) => event.type === "answer.delta"),
|
||||
[{ type: "answer.delta", text: spoken }],
|
||||
[{ type: "answer.delta", text: result.answerText }],
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1486,10 +1486,10 @@ test("lock-only prompt is not spliced into speech", () => {
|
||||
assert.equal(bindSpokenToOpenQuestion("记下了。", lock), "记下了。");
|
||||
});
|
||||
|
||||
test("legacy full-sentence lock remains a last-resort spoken fallback", () => {
|
||||
test("full-sentence lock is rendered only by the persisted choice card", () => {
|
||||
const spoken = "好的。\n\n2016 年高考发挥失常过吗?";
|
||||
const prompt = "2023 年前后,有没有明显入职、升职或职责明显加重?";
|
||||
assert.equal(bindSpokenToOpenQuestion(spoken, prompt), `好的。\n\n${prompt}`);
|
||||
assert.equal(bindSpokenToOpenQuestion(spoken, prompt), "好的。");
|
||||
});
|
||||
|
||||
test("model terminal text-delta is the reply even when Case narration could be composed", async () => {
|
||||
|
||||
Reference in New Issue
Block a user