fix(rectification): prevent silent collect focus stalls
Independent Staging Quality Gate / validate (push) Successful in 20m38s
Independent Staging Quality Gate / publish (push) Successful in 24m14s

This commit is contained in:
Jesse_Chen
2026-08-30 23:07:17 +08:00
parent 0ae3e2d796
commit 79bfa73da3
5 changed files with 468 additions and 20 deletions
@@ -14,7 +14,7 @@ import {
userVisibleChoiceLine,
} from "../src/lib/rectification-agentic/v9/choice-action.ts";
import { isNearBottom, shouldFollowLatest, shouldShowJumpToLatest } from "../src/lib/rectification-sticky-scroll.ts";
import { persistServerOwnedFocus, stableFollowupQuestionId } from "../src/lib/rectification-agentic/v9/server-focus.ts";
import { stableFollowupQuestionId } from "../src/lib/rectification-agentic/v9/server-focus.ts";
import {
spokenCollectFallbackFollowup,
spokenFollowupForUser,
@@ -538,14 +538,12 @@ test("clicking A applies the choice without invoking a language model", async ()
start: "2015-01-01",
end: "2015-12-31",
});
assert.equal(applied.narration, composeChoiceNarration({
optionId: "A",
scoring: true,
appliedInference: true,
}));
assert.match(applied.narration, /已记录你的选择/);
assert.match(applied.narration, /当前可信区间/);
assert.match(applied.narration, /家里有没有结婚、添丁或住院/);
const fns = accounting.calls.map((call) => call.fn);
assert.ok(fns.includes("apply_agentic_rectification_choice_action"));
assert.equal(fns.includes("append_agentic_rectification_turn"), false);
assert.equal(fns.includes("append_agentic_rectification_turn"), true);
assert.equal(fns.includes("record_agentic_rectification_evidence_batch"), false);
assert.equal(fns.some((fn) => fn === "create_agentic_rectification_run_attempt" || fn.includes("stream")), false);
const persist = accounting.calls.find((call) => call.fn === "apply_agentic_rectification_choice_action");