fix(rectification): keep opening greeting across set-focus
Independent Staging Quality Gate / validate (push) Successful in 9m24s
Independent Staging Quality Gate / publish (push) Successful in 1m57s

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:
Jesse_Chen
2026-09-04 19:51:24 +08:00
co-authored by Cursor
parent be6cf145c2
commit a793edb1ad
4 changed files with 69 additions and 2 deletions
@@ -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(