fix(rectification): keep opening greeting across set-focus
set-focus only attaches the question stem. Retracting live Chinese before it wiped the opening hello with an empty replace. Other public tools still retract planning prose. BUG-533. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -106,6 +106,42 @@ test("retracts a live spoken prefix if that step later calls a public tool", ()
|
||||
assert.deepEqual(spoken, { kind: "live", text: "诊断已经看过。接下来确认入职年份。" });
|
||||
});
|
||||
|
||||
test("keeps a live opening greeting when the next public tool is set-focus", () => {
|
||||
const state = createStepAnswerState();
|
||||
assert.deepEqual(
|
||||
applyStepAnswerChunk(
|
||||
state,
|
||||
chunk("text-delta", { text: "你好,我们从你最容易想起的经历开始就行。" }),
|
||||
isPublicTool,
|
||||
),
|
||||
{ kind: "live", text: "你好,我们从你最容易想起的经历开始就行。" },
|
||||
);
|
||||
assert.equal(
|
||||
applyStepAnswerChunk(
|
||||
state,
|
||||
chunk("tool-call", { toolName: "rectification-set-focus" }),
|
||||
isPublicTool,
|
||||
).kind,
|
||||
"none",
|
||||
);
|
||||
assert.equal(
|
||||
applyStepAnswerChunk(
|
||||
state,
|
||||
chunk("tool-result", { toolName: "rectification-set-focus" }),
|
||||
isPublicTool,
|
||||
).kind,
|
||||
"none",
|
||||
);
|
||||
assert.deepEqual(
|
||||
applyStepAnswerChunk(
|
||||
state,
|
||||
chunk("text-delta", { text: "我们慢慢来就好——想到哪件就聊哪件,不用一次说完。" }),
|
||||
isPublicTool,
|
||||
),
|
||||
{ kind: "live", text: "我们慢慢来就好——想到哪件就聊哪件,不用一次说完。" },
|
||||
);
|
||||
});
|
||||
|
||||
test("does not live-publish English planning before a tool-call", () => {
|
||||
const state = createStepAnswerState();
|
||||
assert.equal(
|
||||
|
||||
Reference in New Issue
Block a user