v4-native-model-config.test.ts 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. // L2:v4 原生 switchModelConfig——验证自旧 server-operations.switchModelConfig 搬运的
  2. // 决策语义在原生层保真:previous 在 setModel 之前从 getSessionModelSelection 快照、
  3. // 跨模型由 setModel 解析目标兼容 thought、同模型显式 thought 才调 setThoughtLevel、
  4. // session 不存在拒绝。08-phasing M4 完成定义的 L2 层。
  5. // R-19(10 §4.2.3)追加:同值切换 → V4CommandNoopError(config.unchanged);
  6. // applyRequestedSessionConfig(createSession.config 消费共用件)。
  7. import { describe, expect, it, vi } from "vitest";
  8. import { parseCommandEnvelope, type CommandEnvelope } from "@zcode/shared/zcode-protocol-v4";
  9. import {
  10. V4CommandExecutor,
  11. V4SessionNotFoundError,
  12. } from "../src/zcode-protocol-v4/commands/executor.js";
  13. import { applyRequestedSessionConfig } from "../src/zcode-protocol-v4/commands/handlers/model-config.js";
  14. import { V4CommandNoopError } from "../src/zcode-protocol-v4/index.js";
  15. import type {
  16. V4CommandCoreHost,
  17. V4SessionRecordView,
  18. } from "../src/zcode-protocol-v4/commands/types.js";
  19. /** 切换前的结构化选型。 */
  20. const PREVIOUS_SELECTION = { providerId: "prov-a", modelId: "old-model" };
  21. const TRACE = { traceId: "trace-1", sessionId: "s1" };
  22. const SUPPORTED_THOUGHT_LEVELS = ["low", "medium", "high", "max"];
  23. function makeApp() {
  24. // calls 记录跨方法调用顺序(顺序本身是搬运语义:先快照 previous,再切模型,最后补发事件)。
  25. const calls: string[] = [];
  26. return {
  27. calls,
  28. sessionId: "s1",
  29. runtime: {
  30. getPlanEnabled: vi.fn(() => false),
  31. setExecutionState: vi.fn(async () => {}),
  32. getSessionModelSelection: vi.fn(() => {
  33. calls.push("getSessionModelSelection");
  34. return PREVIOUS_SELECTION;
  35. }),
  36. emitModelSelected: vi.fn(async () => {
  37. calls.push("emitModelSelected");
  38. }),
  39. emitModeChanged: vi.fn(async () => {
  40. calls.push("emitModeChanged");
  41. }),
  42. },
  43. setModel: vi.fn(async () => {
  44. calls.push("setModel");
  45. return { thoughtLevel: undefined };
  46. }),
  47. setThoughtLevel: vi.fn(async (level: string) => {
  48. calls.push("setThoughtLevel");
  49. return { thoughtLevel: level };
  50. }),
  51. getThoughtLevel: vi.fn((): string | undefined => undefined),
  52. listThoughtLevels: vi.fn(() => ["low", "medium", "high", "max"]),
  53. getMode: vi.fn(() => {
  54. calls.push("getMode");
  55. return "build";
  56. }),
  57. setMode: vi.fn(async () => {
  58. calls.push("setMode");
  59. return {};
  60. }),
  61. setFollowupMode: vi.fn(async () => {
  62. calls.push("setFollowupMode");
  63. }),
  64. };
  65. }
  66. function makeRecord(app: ReturnType<typeof makeApp>): V4SessionRecordView {
  67. return {
  68. app: app as unknown as V4SessionRecordView["app"],
  69. workspace: { workspacePath: "/w" },
  70. persistence: "immediate",
  71. traceContext: TRACE,
  72. } as V4SessionRecordView;
  73. }
  74. function makeHost(record: V4SessionRecordView): V4CommandCoreHost {
  75. return {
  76. getRecord: (id) => (id === "s1" ? record : undefined),
  77. };
  78. }
  79. function envelope(sessionId: string, payload: unknown): CommandEnvelope {
  80. return {
  81. type: "switchModelConfig",
  82. payload,
  83. sessionId,
  84. commandId: "cmd-1",
  85. baseRevision: 0,
  86. } as unknown as CommandEnvelope;
  87. }
  88. describe("v4 原生 switchModelConfig", () => {
  89. it("跨模型且 payload thought 不受目标支持:setModel 解析目标实际 thought,不把源模型 thought 再次强写", async () => {
  90. const app = makeApp();
  91. app.setModel.mockImplementationOnce(async () => {
  92. app.calls.push("setModel");
  93. return { thoughtLevel: "high" };
  94. });
  95. const record = makeRecord(app);
  96. await new V4CommandExecutor(makeHost(record)).execute(
  97. envelope("s1", { provider: "prov-a", model: "new-model", thought: "enabled" }),
  98. );
  99. // 顺序:Selection 必须在 setModel 之前快照,否则 previous 会在切换后丢失。
  100. expect(app.calls).toEqual(["getSessionModelSelection", "setModel", "emitModelSelected"]);
  101. // setModel 仍接收协议边界的 "providerId/modelId" 文本选择。
  102. expect(app.setModel).toHaveBeenCalledWith("prov-a/new-model");
  103. expect(app.setThoughtLevel).not.toHaveBeenCalled();
  104. // payload.enabled 是源模型附带值;effective 档位单独投影,稀疏 Selection 不 pin 默认值。
  105. expect(app.runtime.emitModelSelected).toHaveBeenCalledWith({
  106. modelSelection: { providerId: "prov-a", modelId: "new-model" },
  107. effectiveReasoningLevel: "high",
  108. previousModelSelection: PREVIOUS_SELECTION,
  109. supportedThoughtLevels: SUPPORTED_THOUGHT_LEVELS,
  110. traceContext: TRACE,
  111. });
  112. });
  113. it("跨 provider 且源 thought 不兼容:模型切换成功,默认档位不反写 Selection", async () => {
  114. const app = makeApp();
  115. app.setModel.mockImplementationOnce(async () => {
  116. app.calls.push("setModel");
  117. return { thoughtLevel: "max" };
  118. });
  119. const record = makeRecord(app);
  120. await new V4CommandExecutor(makeHost(record)).execute(
  121. envelope("s1", {
  122. provider: "default-deepseek",
  123. model: "deepseek-v4-flash",
  124. thought: "enabled",
  125. }),
  126. );
  127. expect(app.setModel).toHaveBeenCalledWith("default-deepseek/deepseek-v4-flash");
  128. expect(app.setThoughtLevel).not.toHaveBeenCalled();
  129. expect(app.runtime.emitModelSelected).toHaveBeenCalledWith({
  130. modelSelection: {
  131. providerId: "default-deepseek",
  132. modelId: "deepseek-v4-flash",
  133. },
  134. effectiveReasoningLevel: "max",
  135. previousModelSelection: PREVIOUS_SELECTION,
  136. supportedThoughtLevels: SUPPORTED_THOUGHT_LEVELS,
  137. traceContext: TRACE,
  138. });
  139. });
  140. it("跨模型且目标支持 payload thought:切模型后显式收敛到用户选择的 thought", async () => {
  141. const app = makeApp();
  142. app.setModel.mockImplementationOnce(async () => {
  143. app.calls.push("setModel");
  144. return { thoughtLevel: "medium" };
  145. });
  146. const record = makeRecord(app);
  147. await new V4CommandExecutor(makeHost(record)).execute(
  148. envelope("s1", { provider: "prov-a", model: "new-model", thought: "high" }),
  149. );
  150. expect(app.calls).toEqual([
  151. "getSessionModelSelection",
  152. "setModel",
  153. "setThoughtLevel",
  154. "emitModelSelected",
  155. ]);
  156. expect(app.setModel).toHaveBeenCalledWith("prov-a/new-model");
  157. expect(app.setThoughtLevel).toHaveBeenCalledWith("high");
  158. expect(app.runtime.emitModelSelected).toHaveBeenCalledWith({
  159. modelSelection: {
  160. providerId: "prov-a",
  161. modelId: "new-model",
  162. options: { reasoningLevel: "high" },
  163. },
  164. effectiveReasoningLevel: "high",
  165. previousModelSelection: PREVIOUS_SELECTION,
  166. supportedThoughtLevels: SUPPORTED_THOUGHT_LEVELS,
  167. traceContext: TRACE,
  168. });
  169. });
  170. it("同模型显式切 thought:只调 setThoughtLevel,再发布实际档位", async () => {
  171. const app = makeApp();
  172. const record = makeRecord(app);
  173. await new V4CommandExecutor(makeHost(record)).execute(
  174. envelope("s1", { provider: "prov-a", model: "old-model", thought: "max" }),
  175. );
  176. expect(app.setModel).not.toHaveBeenCalled();
  177. expect(app.setThoughtLevel).toHaveBeenCalledWith("max");
  178. expect(app.calls).toEqual(["getSessionModelSelection", "setThoughtLevel", "emitModelSelected"]);
  179. expect(app.runtime.emitModelSelected).toHaveBeenCalledWith({
  180. modelSelection: {
  181. providerId: "prov-a",
  182. modelId: "old-model",
  183. options: { reasoningLevel: "max" },
  184. },
  185. effectiveReasoningLevel: "max",
  186. previousModelSelection: PREVIOUS_SELECTION,
  187. supportedThoughtLevels: SUPPORTED_THOUGHT_LEVELS,
  188. traceContext: TRACE,
  189. });
  190. });
  191. it("同模型显式选择 effective 默认档位仍保存为稀疏 Selection pin", async () => {
  192. const app = makeApp();
  193. app.getThoughtLevel.mockReturnValue("high");
  194. const record = makeRecord(app);
  195. await new V4CommandExecutor(makeHost(record)).execute(
  196. envelope("s1", { provider: "prov-a", model: "old-model", thought: "high" }),
  197. );
  198. expect(app.setThoughtLevel).toHaveBeenCalledWith("high");
  199. expect(app.runtime.emitModelSelected).toHaveBeenCalledWith(
  200. expect.objectContaining({
  201. modelSelection: {
  202. providerId: "prov-a",
  203. modelId: "old-model",
  204. options: { reasoningLevel: "high" },
  205. },
  206. effectiveReasoningLevel: "high",
  207. }),
  208. );
  209. });
  210. it("同模型显式切到不支持的 thought:失败且不触碰模型身份", async () => {
  211. const app = makeApp();
  212. app.setThoughtLevel.mockRejectedValueOnce(new Error("Unsupported reasoning effort: enabled"));
  213. const record = makeRecord(app);
  214. await expect(
  215. new V4CommandExecutor(makeHost(record)).execute(
  216. envelope("s1", { provider: "prov-a", model: "old-model", thought: "enabled" }),
  217. ),
  218. ).rejects.toThrow("Unsupported reasoning effort: enabled");
  219. expect(app.setModel).not.toHaveBeenCalled();
  220. expect(app.runtime.emitModelSelected).not.toHaveBeenCalled();
  221. });
  222. it("thought 缺省(空串):不调 setThoughtLevel,selection 不带 reasoning option", async () => {
  223. const app = makeApp();
  224. const record = makeRecord(app);
  225. await new V4CommandExecutor(makeHost(record)).execute(
  226. envelope("s1", { provider: "prov-a", model: "new-model", thought: "" }),
  227. );
  228. expect(app.setThoughtLevel).not.toHaveBeenCalled();
  229. expect(app.calls).toEqual(["getSessionModelSelection", "setModel", "emitModelSelected"]);
  230. expect(app.runtime.emitModelSelected).toHaveBeenCalledWith({
  231. modelSelection: { providerId: "prov-a", modelId: "new-model" },
  232. previousModelSelection: PREVIOUS_SELECTION,
  233. supportedThoughtLevels: SUPPORTED_THOUGHT_LEVELS,
  234. traceContext: TRACE,
  235. });
  236. });
  237. it("session 不存在:拒绝且不触碰任何 core 方法", async () => {
  238. const app = makeApp();
  239. const record = makeRecord(app);
  240. await expect(
  241. new V4CommandExecutor(makeHost(record)).execute(
  242. envelope("missing", { provider: "p", model: "m", thought: "" }),
  243. ),
  244. ).rejects.toThrow(V4SessionNotFoundError);
  245. expect(app.setModel).not.toHaveBeenCalled();
  246. expect(app.runtime.emitModelSelected).not.toHaveBeenCalled();
  247. });
  248. // R-19:同值切换不得以 accepted 静默吞掉——UI 需要区分「已生效」与「本来就是这个值」。
  249. it("同值切换:抛 V4CommandNoopError(config.unchanged),不切模型不补发事件", async () => {
  250. const app = makeApp();
  251. const record = makeRecord(app);
  252. await expect(
  253. new V4CommandExecutor(makeHost(record)).execute(
  254. envelope("s1", { provider: "prov-a", model: "old-model", thought: "" }),
  255. ),
  256. ).rejects.toThrow(V4CommandNoopError);
  257. expect(app.setModel).not.toHaveBeenCalled();
  258. expect(app.setThoughtLevel).not.toHaveBeenCalled();
  259. expect(app.runtime.emitModelSelected).not.toHaveBeenCalled();
  260. });
  261. it("同模型显式选择 effective 值:仍固定为 option pin", async () => {
  262. const app = makeApp();
  263. app.getThoughtLevel.mockReturnValue("max");
  264. const record = makeRecord(app);
  265. await new V4CommandExecutor(makeHost(record)).execute(
  266. envelope("s1", { provider: "prov-a", model: "old-model", thought: "max" }),
  267. );
  268. expect(app.setModel).not.toHaveBeenCalled();
  269. expect(app.setThoughtLevel).toHaveBeenCalledWith("max");
  270. });
  271. });
  272. // M5 additive:switchCollaborationMode(UI 模式选择器 → app.setMode + SessionModeChanged 补发)。
  273. describe("v4 原生 switchCollaborationMode", () => {
  274. it("guarded 经同一模式命令切换,未知值报错而不降级", async () => {
  275. const app = makeApp();
  276. const executor = new V4CommandExecutor(makeHost(makeRecord(app)));
  277. const requested = {
  278. ...modeEnvelope("s1", { mode: "guarded" }),
  279. clientId: "test",
  280. issuedAt: Date.now(),
  281. };
  282. const parsed = parseCommandEnvelope(requested);
  283. if (!parsed.ok) throw parsed.error;
  284. await executor.execute(parsed.envelope);
  285. expect(app.setMode).toHaveBeenCalledWith("guarded");
  286. // executor 只消费协议边界已经校验的 envelope,未知模式应在同一边界被拒绝。
  287. expect(parseCommandEnvelope({ ...requested, payload: { mode: "unsupported" } }).ok).toBe(false);
  288. expect(app.setMode).toHaveBeenCalledTimes(1);
  289. });
  290. function modeEnvelope(sessionId: string, payload: unknown): CommandEnvelope {
  291. return {
  292. type: "switchCollaborationMode",
  293. payload,
  294. sessionId,
  295. commandId: "cmd-mode-1",
  296. baseRevision: 0,
  297. } as unknown as CommandEnvelope;
  298. }
  299. it("正路径:setMode 内部统一更新状态和事件,命令层不重复补发", async () => {
  300. const app = makeApp();
  301. const record = makeRecord(app);
  302. await new V4CommandExecutor(makeHost(record)).execute(modeEnvelope("s1", { mode: "plan" }));
  303. expect(app.calls).toEqual(["getMode", "setMode"]);
  304. expect(app.setMode).toHaveBeenCalledWith("plan");
  305. expect(app.runtime.emitModeChanged).not.toHaveBeenCalled();
  306. });
  307. // R-19:同值切换从静默 return(被当 accepted)改为显式 noop——旧行为与投影种子缺失
  308. // 叠加成过「点完全访问没反应」的用户可见 bug(runtime 已是 yolo、投影种子还是 build)。
  309. it("同值切换:抛 V4CommandNoopError(config.unchanged)——不调 setMode、不补发事件(不 bump revision)", async () => {
  310. const app = makeApp();
  311. const record = makeRecord(app);
  312. await expect(
  313. new V4CommandExecutor(makeHost(record)).execute(modeEnvelope("s1", { mode: "build" })),
  314. ).rejects.toThrow(V4CommandNoopError);
  315. expect(app.setMode).not.toHaveBeenCalled();
  316. expect(app.runtime.emitModeChanged).not.toHaveBeenCalled();
  317. });
  318. it("session 不存在:拒绝且不触碰任何 core 方法", async () => {
  319. const app = makeApp();
  320. const record = makeRecord(app);
  321. await expect(
  322. new V4CommandExecutor(makeHost(record)).execute(modeEnvelope("missing", { mode: "plan" })),
  323. ).rejects.toThrow(V4SessionNotFoundError);
  324. expect(app.setMode).not.toHaveBeenCalled();
  325. });
  326. it("supports 分流:switchCollaborationMode 已原生", () => {
  327. const executor = new V4CommandExecutor(makeHost(makeRecord(makeApp())));
  328. expect(executor.supports("switchCollaborationMode")).toBe(true);
  329. });
  330. });
  331. // R-19:createSession.config 消费共用件——请求 config 覆盖 runtime 缺省,
  332. // 只对差异部分生效并补发与 switch 命令同源的事件(日志自足)。
  333. describe("切模型前校验当前 Environment Provider", () => {
  334. function makeResolvingHost(
  335. record: V4SessionRecordView,
  336. outcome: { available: boolean; reason?: string },
  337. captured: string[],
  338. ): V4CommandCoreHost {
  339. return {
  340. getRecord: (id) => (id === "s1" ? record : undefined),
  341. ensureProviderAvailable: async (_sessionId, providerId) => {
  342. captured.push(providerId);
  343. return outcome;
  344. },
  345. };
  346. }
  347. it("provider 已在 registry:setModel 之前解析放行,跨 provider 切换生效", async () => {
  348. const app = makeApp();
  349. const record = makeRecord(app);
  350. const captured: string[] = [];
  351. await new V4CommandExecutor(makeResolvingHost(record, { available: true }, captured)).execute(
  352. envelope("s1", { provider: "prov-b", model: "new-model", thought: "" }),
  353. );
  354. expect(captured).toEqual(["prov-b"]);
  355. expect(app.setModel).toHaveBeenCalledWith("prov-b/new-model");
  356. expect(app.runtime.emitModelSelected).toHaveBeenCalled();
  357. });
  358. it("provider 不在 registry(applied:false):failed reasonCode=provider.notInRegistry,不切模型/不补发", async () => {
  359. const app = makeApp();
  360. const record = makeRecord(app);
  361. const captured: string[] = [];
  362. await expect(
  363. new V4CommandExecutor(
  364. makeResolvingHost(
  365. record,
  366. { available: false, reason: "provider_not_in_registry" },
  367. captured,
  368. ),
  369. ).execute(envelope("s1", { provider: "prov-x", model: "m", thought: "" })),
  370. ).rejects.toMatchObject({ reasonCode: "provider.notInRegistry" });
  371. expect(app.setModel).not.toHaveBeenCalled();
  372. expect(app.runtime.emitModelSelected).not.toHaveBeenCalled();
  373. });
  374. });
  375. describe("applyRequestedSessionConfig(createSession.config 消费)", () => {
  376. it("模型差异:setModel → setThoughtLevel → emitModelSelected(previous 保真)", async () => {
  377. const app = makeApp();
  378. app.setModel.mockImplementationOnce(async () => {
  379. app.calls.push("setModel");
  380. return { thoughtLevel: "medium" };
  381. });
  382. const record = makeRecord(app);
  383. await applyRequestedSessionConfig(makeHost(record), record, {
  384. provider: "prov-b",
  385. model: "new-model",
  386. thought: "high",
  387. });
  388. expect(app.setModel).toHaveBeenCalledWith("prov-b/new-model");
  389. expect(app.setThoughtLevel).toHaveBeenCalledWith("high");
  390. expect(app.runtime.emitModelSelected).toHaveBeenCalledWith({
  391. modelSelection: {
  392. providerId: "prov-b",
  393. modelId: "new-model",
  394. options: { reasoningLevel: "high" },
  395. },
  396. effectiveReasoningLevel: "high",
  397. previousModelSelection: PREVIOUS_SELECTION,
  398. supportedThoughtLevels: SUPPORTED_THOUGHT_LEVELS,
  399. traceContext: TRACE,
  400. });
  401. });
  402. it("模型差异且 thought 不受目标支持:保留 setModel 实际档位并照常发布目标模型", async () => {
  403. const app = makeApp();
  404. app.setModel.mockImplementationOnce(async () => {
  405. app.calls.push("setModel");
  406. return { thoughtLevel: "max" };
  407. });
  408. const record = makeRecord(app);
  409. await applyRequestedSessionConfig(makeHost(record), record, {
  410. provider: "default-deepseek",
  411. model: "deepseek-v4-flash",
  412. thought: "enabled",
  413. });
  414. expect(app.setThoughtLevel).not.toHaveBeenCalled();
  415. expect(app.runtime.emitModelSelected).toHaveBeenCalledWith({
  416. modelSelection: {
  417. providerId: "default-deepseek",
  418. modelId: "deepseek-v4-flash",
  419. },
  420. effectiveReasoningLevel: "max",
  421. previousModelSelection: PREVIOUS_SELECTION,
  422. supportedThoughtLevels: SUPPORTED_THOUGHT_LEVELS,
  423. traceContext: TRACE,
  424. });
  425. });
  426. it("部分字段(只给 thought):provider/model 回落 runtime 当前值", async () => {
  427. const app = makeApp();
  428. const record = makeRecord(app);
  429. await applyRequestedSessionConfig(makeHost(record), record, { thought: "max" });
  430. expect(app.setModel).not.toHaveBeenCalled();
  431. expect(app.setThoughtLevel).toHaveBeenCalledWith("max");
  432. expect(app.runtime.emitModelSelected).toHaveBeenCalledWith({
  433. modelSelection: {
  434. providerId: "prov-a",
  435. modelId: "old-model",
  436. options: { reasoningLevel: "max" },
  437. },
  438. effectiveReasoningLevel: "max",
  439. previousModelSelection: PREVIOUS_SELECTION,
  440. supportedThoughtLevels: SUPPORTED_THOUGHT_LEVELS,
  441. traceContext: TRACE,
  442. });
  443. });
  444. it("与 runtime 全同值:零调用零事件(不产空转 delta)", async () => {
  445. const app = makeApp();
  446. const record = makeRecord(app);
  447. await applyRequestedSessionConfig(makeHost(record), record, {
  448. provider: "prov-a",
  449. model: "old-model",
  450. thought: "",
  451. mode: "build",
  452. followupMode: "queue",
  453. });
  454. expect(app.setModel).not.toHaveBeenCalled();
  455. expect(app.setMode).not.toHaveBeenCalled();
  456. expect(app.setFollowupMode).not.toHaveBeenCalled();
  457. expect(app.runtime.emitModelSelected).not.toHaveBeenCalled();
  458. expect(app.runtime.emitModeChanged).not.toHaveBeenCalled();
  459. });
  460. it("mode 差异由 Runtime 原子更新;非法 mode 值被值域收口忽略", async () => {
  461. const app = makeApp();
  462. const record = makeRecord(app);
  463. await applyRequestedSessionConfig(makeHost(record), record, { mode: "yolo" });
  464. expect(app.runtime.setExecutionState).toHaveBeenCalledWith({ mode: "yolo" }, TRACE);
  465. expect(app.runtime.emitModeChanged).not.toHaveBeenCalled();
  466. const app2 = makeApp();
  467. const record2 = makeRecord(app2);
  468. await applyRequestedSessionConfig(makeHost(record2), record2, { mode: "auto" });
  469. expect(app2.setMode).not.toHaveBeenCalled();
  470. expect(app2.runtime.emitModeChanged).not.toHaveBeenCalled();
  471. });
  472. it("followupMode=guide 显式写;queue(缺省同值)跳过避免空转事件", async () => {
  473. const app = makeApp();
  474. const record = makeRecord(app);
  475. await applyRequestedSessionConfig(makeHost(record), record, { followupMode: "guide" });
  476. expect(app.setFollowupMode).toHaveBeenCalledWith("guide");
  477. });
  478. });