conversation-session-composer-recent-mode.test.ts 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. // ZCT-2098314627607224320:首发迁移 Root 后,再新建任务必须继承最近接纳的权限。
  2. // 新建草稿按项目隔离;未归类任务仅在首发接纳后分配下一工作区。
  3. import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
  4. import { join } from "node:path";
  5. import { TID_CHAT_MODE_SELECT_TRIGGER, TID_V4_COMPOSER_SEND } from "@zcode/shared/test-ids";
  6. import { ServiceChannels } from "@zcode/shared";
  7. import {
  8. installHandoffRpcProbe,
  9. callHandoffHost,
  10. restoreHandoffProbes,
  11. } from "../helpers/remote-project-handoff-probe.js";
  12. import {
  13. UPSTREAM_PROVIDER_ID,
  14. ensureUpstreamProviderForE2E,
  15. UPSTREAM_MODEL,
  16. UPSTREAM_SECONDARY_MODEL,
  17. } from "../helpers/upstream-provider.js";
  18. import { skipOccupationOnboardingIfPresent } from "../helpers/occupation-onboarding.js";
  19. import { startDraftFromProject } from "../helpers/project-sidebar.js";
  20. import { clearAppData, DEFAULT_WORKSPACE } from "../helpers/desktop-app.js";
  21. import { resolveE2ERuntimePath, resolveE2EToolPath } from "../helpers/e2e-runtime-paths.js";
  22. import { getLatestUpstreamToolResultByToolCallId } from "../helpers/conversation-session-network.js";
  23. import { getV4ComposerDraftScopeSnapshot } from "../helpers/conversation-session-store.js";
  24. import {
  25. getV4ModelConfig,
  26. getV4PaneSnapshot,
  27. selectV4TaskById,
  28. sendV4PromptAndWaitAccepted as sendPrompt,
  29. switchV4Mode,
  30. switchV4Model,
  31. setV4ComposerText,
  32. waitForV4ComposerSelectionReady,
  33. waitForV4TimelineContaining,
  34. waitForV4ComposerText,
  35. sendV4Prompt,
  36. } from "../helpers/v4-conversation.js";
  37. declare global {
  38. interface Window {
  39. __pdSendGate?: { count: number; release(): void; restore(): void };
  40. }
  41. }
  42. async function sendV4PromptAndWaitAccepted(prompt: string, marker: string, message: string) {
  43. try {
  44. await sendPrompt(prompt, marker, message);
  45. } catch (error) {
  46. const details = $('[data-testid="chat-error-details-button"]');
  47. if (await details.isExisting()) {
  48. await details.click();
  49. const content = $('[role="dialog"] pre');
  50. await content.waitForDisplayed();
  51. throw new Error(`${message}: ${await content.getText()}`, { cause: error });
  52. }
  53. throw error;
  54. }
  55. }
  56. const CASE_NAME = "conversation-session-composer-recent-mode";
  57. const CASE_DIR = resolveE2ERuntimePath(CASE_NAME);
  58. const OUTPUT_PATH = resolveE2EToolPath(CASE_NAME, "result.txt");
  59. const EVIDENCE_DIR = join(
  60. process.env.ZCODE_E2E_ARTIFACT_DIR ?? join(process.cwd(), ".e2e-artifacts"),
  61. CASE_NAME,
  62. );
  63. async function captureState(step: string) {
  64. await mkdir(EVIDENCE_DIR, { recursive: true });
  65. const permissionTrigger = $(`[data-testid="${TID_CHAT_MODE_SELECT_TRIGGER}"]`);
  66. await permissionTrigger.waitForDisplayed();
  67. const state = {
  68. pane: await getV4PaneSnapshot(),
  69. composer: await getV4ModelConfig(),
  70. rootDraft: await getV4ComposerDraftScopeSnapshot(DEFAULT_WORKSPACE, null),
  71. permissionLabel: await permissionTrigger.getText(),
  72. persisted: await browser.execute(() => ({
  73. entries: Object.entries(localStorage).filter(
  74. ([key]) => key.includes("composer-") || key.includes("pending-command"),
  75. ),
  76. navigation: (
  77. window as unknown as { __zcodeTabStoreE2E: { getState(): unknown } }
  78. ).__zcodeTabStoreE2E.getState(),
  79. })),
  80. };
  81. await writeFile(join(EVIDENCE_DIR, `${step}.json`), JSON.stringify(state, null, 2));
  82. await browser.saveScreenshot(join(EVIDENCE_DIR, `${step}.png`));
  83. return state;
  84. }
  85. async function expectMode(mode: string) {
  86. await $(`[data-testid="${TID_CHAT_MODE_SELECT_TRIGGER}"]`).waitForDisplayed();
  87. await waitForV4ComposerSelectionReady();
  88. expect((await getV4ModelConfig()).mode).toBe(mode);
  89. }
  90. describe("Composer Recent 权限继承", () => {
  91. it("PD01/02: 任务草稿复用执行目录,接纳后新任务换目录并继承模型权限", async () => {
  92. await skipOccupationOnboardingIfPresent();
  93. await startDraftFromProject(DEFAULT_WORKSPACE);
  94. await ensureUpstreamProviderForE2E({ skipToolbarSelection: true });
  95. const startTask = async () => {
  96. const button = $('[data-testid="virtual-project-new-task"]');
  97. await $('[data-testid="conversation-section"]').moveTo();
  98. await button.waitForDisplayed();
  99. await button.click();
  100. await browser.waitUntil(
  101. async () =>
  102. (await getV4PaneSnapshot()).sessionId === "draft" &&
  103. (await browser.execute(() => {
  104. const w = window as unknown as {
  105. __zcodeTabStoreE2E: { getState(): { activeWorkspacePath: string } };
  106. };
  107. const pending = JSON.parse(
  108. localStorage.getItem('zcode-pending-task-draft:v1:["desktop","local",null]') ??
  109. "null",
  110. );
  111. return Boolean(
  112. pending?.workspacePath &&
  113. pending.workspacePath === w.__zcodeTabStoreE2E.getState().activeWorkspacePath,
  114. );
  115. })),
  116. );
  117. };
  118. const activePath = () =>
  119. browser.execute(
  120. () =>
  121. (
  122. window as unknown as {
  123. __zcodeTabStoreE2E: { getState(): { activeWorkspacePath: string } };
  124. }
  125. ).__zcodeTabStoreE2E.getState().activeWorkspacePath,
  126. );
  127. await startTask();
  128. await switchV4Model(UPSTREAM_PROVIDER_ID, UPSTREAM_MODEL, "");
  129. await switchV4Mode("yolo");
  130. await setV4ComposerText("E2E_PD01_UNSENT");
  131. const firstPath = await activePath();
  132. await startDraftFromProject(DEFAULT_WORKSPACE);
  133. await startTask();
  134. await waitForV4ComposerText("E2E_PD01_UNSENT", "任务草稿未恢复");
  135. expect(await activePath()).toBe(firstPath);
  136. await expectMode("yolo");
  137. const selected = await getV4ModelConfig();
  138. await sendV4PromptAndWaitAccepted(
  139. "E2E_COMPOSER_RECENT_MODE_SEED 请回复测试标记。",
  140. "E2E_COMPOSER_RECENT_MODE_SEED",
  141. "任务首发未接纳",
  142. );
  143. await startTask();
  144. await waitForV4ComposerText("", "新任务不应复制已发送正文");
  145. expect(await activePath()).not.toBe(firstPath);
  146. await expectMode("yolo");
  147. expect(await getV4ModelConfig()).toMatchObject({
  148. provider: selected.provider,
  149. model: selected.model,
  150. });
  151. });
  152. it("PD03/04/09: 同目录项目独立保存草稿和默认配置,修改主要目录保留项目草稿", async () => {
  153. await installHandoffRpcProbe();
  154. try {
  155. const p = await callHandoffHost<{ id: string }>(ServiceChannels.Project, "saveProject", [
  156. { name: "E2E_PD_P", roots: [DEFAULT_WORKSPACE], primaryRoot: DEFAULT_WORKSPACE },
  157. ]);
  158. const q = await callHandoffHost<{ id: string }>(ServiceChannels.Project, "saveProject", [
  159. { name: "E2E_PD_Q", roots: [DEFAULT_WORKSPACE], primaryRoot: DEFAULT_WORKSPACE },
  160. ]);
  161. const start = async (id: string) => {
  162. const section = $(`[data-project-id="${id}"]`);
  163. await section.waitForDisplayed();
  164. await section.moveTo();
  165. await section.$('[data-testid="virtual-project-create-task"]').click();
  166. };
  167. await start(p.id);
  168. await setV4ComposerText("E2E_PD_PROJECT_P");
  169. await switchV4Mode("yolo");
  170. await start(q.id);
  171. await waitForV4ComposerText("", "Q 错读 P 的草稿");
  172. await setV4ComposerText("E2E_PD_PROJECT_Q");
  173. await switchV4Mode("build");
  174. await start(p.id);
  175. await waitForV4ComposerText("E2E_PD_PROJECT_P", "P 草稿被覆盖");
  176. await expectMode("yolo");
  177. await start(q.id);
  178. await waitForV4ComposerText("E2E_PD_PROJECT_Q", "Q 草稿被覆盖");
  179. await expectMode("build");
  180. await switchV4Model(UPSTREAM_PROVIDER_ID, UPSTREAM_SECONDARY_MODEL, "");
  181. await sendV4PromptAndWaitAccepted(
  182. "E2E_COMPOSER_RECENT_MODE_SECOND Q",
  183. "E2E_COMPOSER_RECENT_MODE_SECOND",
  184. "Q 首发未接纳",
  185. );
  186. await waitForV4TimelineContaining("RECENT_MODE_SECOND_DONE");
  187. await start(p.id);
  188. await waitForV4ComposerText("E2E_PD_PROJECT_P", "Q 接纳污染 P 草稿");
  189. await expectMode("yolo");
  190. await switchV4Model(UPSTREAM_PROVIDER_ID, UPSTREAM_MODEL, "");
  191. await sendV4PromptAndWaitAccepted(
  192. "E2E_COMPOSER_RECENT_MODE_SECOND P",
  193. "E2E_COMPOSER_RECENT_MODE_SECOND",
  194. "P 首发未接纳",
  195. );
  196. await waitForV4TimelineContaining("RECENT_MODE_SECOND_DONE");
  197. const pSession = (await getV4PaneSnapshot()).sessionId;
  198. await start(q.id);
  199. await waitForV4ComposerText("", "Q 已发送正文复活");
  200. await expectMode("build");
  201. expect((await getV4ModelConfig()).model).toBe(UPSTREAM_SECONDARY_MODEL);
  202. await start(p.id);
  203. await expectMode("yolo");
  204. expect((await getV4ModelConfig()).model).toBe(UPSTREAM_MODEL);
  205. await setV4ComposerText("E2E_PD_PROJECT_MOVED_ROOT");
  206. const nextRoot = join(CASE_DIR, "new-primary");
  207. await mkdir(nextRoot, { recursive: true });
  208. await callHandoffHost(ServiceChannels.Project, "saveProject", [
  209. {
  210. id: p.id,
  211. name: "E2E_PD_P_RENAMED",
  212. roots: [DEFAULT_WORKSPACE, nextRoot],
  213. primaryRoot: nextRoot,
  214. },
  215. ]);
  216. await start(p.id);
  217. await waitForV4ComposerText("E2E_PD_PROJECT_MOVED_ROOT", "项目换主要目录丢失草稿");
  218. await expectMode("yolo");
  219. const directories = await callHandoffHost<{ workspacePath: string }>(
  220. ServiceChannels.Project,
  221. "resolveSessionDirectories",
  222. [{ workspacePath: DEFAULT_WORKSPACE, taskId: pSession }],
  223. );
  224. expect(directories.workspacePath).toBe(DEFAULT_WORKSPACE);
  225. } finally {
  226. await restoreHandoffProbes();
  227. }
  228. });
  229. it("PD06/07: 首发在途切走再返回保留目录,迟到接纳完成原任务交接", async () => {
  230. const startTask = async () => {
  231. await $('[data-testid="conversation-section"]').moveTo();
  232. await $('[data-testid="virtual-project-new-task"]').click();
  233. await browser.waitUntil(
  234. async () =>
  235. (await getV4PaneSnapshot()).sessionId === "draft" &&
  236. (await browser.execute(() => {
  237. const w = window as unknown as {
  238. __zcodeTabStoreE2E: { getState(): { activeWorkspacePath: string } };
  239. };
  240. const pending = JSON.parse(
  241. localStorage.getItem('zcode-pending-task-draft:v1:["desktop","local",null]') ??
  242. "null",
  243. );
  244. return Boolean(
  245. pending?.workspacePath &&
  246. pending.workspacePath === w.__zcodeTabStoreE2E.getState().activeWorkspacePath,
  247. );
  248. })),
  249. );
  250. };
  251. const path = () =>
  252. browser.execute(
  253. () =>
  254. (
  255. window as unknown as {
  256. __zcodeTabStoreE2E: { getState(): { activeWorkspacePath: string } };
  257. }
  258. ).__zcodeTabStoreE2E.getState().activeWorkspacePath,
  259. );
  260. await startTask();
  261. await switchV4Model(UPSTREAM_PROVIDER_ID, UPSTREAM_MODEL, "");
  262. await switchV4Mode("yolo");
  263. const pendingPath = await path();
  264. await browser.execute(() => {
  265. const original = MessagePort.prototype.postMessage;
  266. const held: Array<() => void> = [];
  267. let holding = true;
  268. const gate = {
  269. count: 0,
  270. release() {
  271. holding = false;
  272. held.splice(0).forEach((send) => send());
  273. },
  274. restore() {
  275. gate.release();
  276. MessagePort.prototype.postMessage = original;
  277. delete window.__pdSendGate;
  278. },
  279. };
  280. MessagePort.prototype.postMessage = function (
  281. this: MessagePort,
  282. ...args: [unknown, (Transferable[] | StructuredSerializeOptions)?]
  283. ) {
  284. const data = args[0];
  285. const bytes =
  286. data instanceof ArrayBuffer
  287. ? new Uint8Array(data)
  288. : ArrayBuffer.isView(data)
  289. ? new Uint8Array(data.buffer, data.byteOffset, data.byteLength)
  290. : null;
  291. const wire = bytes ? new TextDecoder().decode(bytes) : "";
  292. const forward = () => Reflect.apply(original, this, args);
  293. if (wire.includes("sendConversationCommandV4") && wire.includes('"type":"sendText"')) {
  294. gate.count += 1;
  295. if (holding) {
  296. held.push(forward);
  297. return;
  298. }
  299. }
  300. forward();
  301. };
  302. window.__pdSendGate = gate;
  303. });
  304. try {
  305. await sendV4Prompt("E2E_COMPOSER_RECENT_MODE_SECOND LATE_ACK");
  306. await browser.waitUntil(() => browser.execute(() => window.__pdSendGate?.count === 1));
  307. await startDraftFromProject(DEFAULT_WORKSPACE);
  308. await startTask();
  309. expect(await path()).toBe(pendingPath);
  310. expect(await $(`[data-testid="${TID_V4_COMPOSER_SEND}"]`).isEnabled()).toBe(false);
  311. await browser.execute(() => window.__pdSendGate!.release());
  312. await waitForV4TimelineContaining("RECENT_MODE_SECOND_DONE");
  313. expect(await browser.execute(() => window.__pdSendGate!.count)).toBe(1);
  314. expect((await getV4PaneSnapshot()).sessionId).not.toBe("draft");
  315. await startTask();
  316. expect(await path()).not.toBe(pendingPath);
  317. await waitForV4ComposerText("", "迟到接纳污染下一份任务草稿");
  318. await expectMode("yolo");
  319. } finally {
  320. await browser.execute(() => window.__pdSendGate?.restore());
  321. }
  322. });
  323. after(async () => {
  324. await clearAppData();
  325. await rm(CASE_DIR, { recursive: true, force: true });
  326. });
  327. it("TD01/03/04: 空白不保存,文字刷新恢复,删空后 New Task 重新取默认", async () => {
  328. await skipOccupationOnboardingIfPresent();
  329. await startDraftFromProject(DEFAULT_WORKSPACE);
  330. await ensureUpstreamProviderForE2E({ skipToolbarSelection: true });
  331. await switchV4Model(UPSTREAM_PROVIDER_ID, UPSTREAM_MODEL, "");
  332. await switchV4Mode("yolo");
  333. expect((await getV4ComposerDraftScopeSnapshot(DEFAULT_WORKSPACE, null)).exists).toBe(false);
  334. await setV4ComposerText("unsent text persistence");
  335. await browser.waitUntil(
  336. async () =>
  337. (await getV4ComposerDraftScopeSnapshot(DEFAULT_WORKSPACE, null)).text ===
  338. "unsent text persistence",
  339. );
  340. await browser.refresh();
  341. try {
  342. await waitForV4ComposerText("unsent text persistence", "刷新没有恢复文字草稿");
  343. } catch (error) {
  344. const diagnosis = await browser.executeAsync(async (done) => {
  345. const script = document.querySelector<HTMLScriptElement>('script[type="module"]');
  346. let moduleError = "";
  347. try {
  348. if (script?.src) await import(script.src);
  349. } catch (cause) {
  350. moduleError = String(cause);
  351. }
  352. done({
  353. body: document.body.innerText,
  354. moduleError,
  355. url: location.href,
  356. storage: Object.entries(localStorage).filter(([key]) => key.includes("composer-")),
  357. });
  358. });
  359. await mkdir(EVIDENCE_DIR, { recursive: true });
  360. await writeFile(
  361. join(EVIDENCE_DIR, "refresh-failure.json"),
  362. JSON.stringify(diagnosis, null, 2),
  363. );
  364. throw error;
  365. }
  366. await expectMode("yolo");
  367. await setV4ComposerText(" ");
  368. await browser.waitUntil(
  369. async () => !(await getV4ComposerDraftScopeSnapshot(DEFAULT_WORKSPACE, null)).exists,
  370. );
  371. await startDraftFromProject(DEFAULT_WORKSPACE);
  372. await expectMode("build");
  373. await switchV4Mode("yolo");
  374. await startDraftFromProject(DEFAULT_WORKSPACE);
  375. await expectMode("build");
  376. expect((await getV4ComposerDraftScopeSnapshot(DEFAULT_WORKSPACE, null)).exists).toBe(false);
  377. await captureState("00-text-only-draft");
  378. });
  379. it("I74/I75: 完全访问首发后 New Task 保留权限,已有草稿与 Session 选择仍各自独立", async () => {
  380. await rm(CASE_DIR, { recursive: true, force: true });
  381. await mkdir(CASE_DIR, { recursive: true });
  382. await skipOccupationOnboardingIfPresent();
  383. await startDraftFromProject(DEFAULT_WORKSPACE);
  384. await ensureUpstreamProviderForE2E({ skipToolbarSelection: true });
  385. // 本用例验证模型身份和权限,不强制当前模型目录未提供的思考档位。
  386. await switchV4Model(UPSTREAM_PROVIDER_ID, UPSTREAM_MODEL, "");
  387. await expectMode("build");
  388. await switchV4Mode("yolo");
  389. await expectMode("yolo");
  390. const selected = await getV4ModelConfig();
  391. await sendV4PromptAndWaitAccepted(
  392. "E2E_COMPOSER_RECENT_MODE_SEED 请回复测试标记。",
  393. "E2E_COMPOSER_RECENT_MODE_SEED",
  394. "第一次输入未被接纳",
  395. );
  396. await waitForV4TimelineContaining("RECENT_MODE_STREAMING");
  397. const firstSession = (await getV4PaneSnapshot()).sessionId!;
  398. const first = await captureState("01-accepted-yolo");
  399. expect(first.composer.mode).toBe("yolo");
  400. expect(first.pane.canStop).toBe(true);
  401. await startDraftFromProject(DEFAULT_WORKSPACE);
  402. await waitForV4ComposerSelectionReady();
  403. const next = await captureState("02-new-task-mode");
  404. // 修复前这里稳定取得 actual=build,证明是新 Root 初始化回退。
  405. expect(next.composer.mode).toBe("yolo");
  406. expect(next.rootDraft.exists).toBe(false);
  407. expect(next.composer).toMatchObject({ provider: selected.provider, model: selected.model });
  408. await sendV4PromptAndWaitAccepted(
  409. `E2E_COMPOSER_RECENT_MODE_WRITE 请写入 ${OUTPUT_PATH}`,
  410. "E2E_COMPOSER_RECENT_MODE_WRITE",
  411. "继承权限后的输入未被接纳",
  412. );
  413. await waitForV4TimelineContaining("RECENT_MODE_DONE", 60_000);
  414. const secondSession = (await getV4PaneSnapshot()).sessionId!;
  415. expect(secondSession).not.toBe(firstSession);
  416. expect(await readFile(join(CASE_DIR, "result.txt"), "utf8")).toBe("RECENT_MODE_WRITE_OK\n");
  417. expect(
  418. (await getLatestUpstreamToolResultByToolCallId("toolu_recent_mode_write"))?.isError,
  419. ).toBe(false);
  420. await captureState("03-inherited-mode-executed");
  421. await startDraftFromProject(DEFAULT_WORKSPACE);
  422. await expectMode("yolo");
  423. // TD02:先打开空白页,再回原 Session 改选 B 并发送,旧空白页不能覆盖 Recent。
  424. await selectV4TaskById(secondSession);
  425. await switchV4Mode("build");
  426. await switchV4Model(UPSTREAM_PROVIDER_ID, UPSTREAM_SECONDARY_MODEL, "");
  427. await sendV4PromptAndWaitAccepted(
  428. "E2E_COMPOSER_RECENT_MODE_SECOND 回复标记。",
  429. "E2E_COMPOSER_RECENT_MODE_SECOND",
  430. "第二次选择未被接纳",
  431. );
  432. await waitForV4TimelineContaining("RECENT_MODE_SECOND_DONE");
  433. await startDraftFromProject(DEFAULT_WORKSPACE);
  434. await expectMode("build");
  435. const updated = await captureState("04-new-task-model-b");
  436. expect(updated.composer.model).toBe(UPSTREAM_SECONDARY_MODEL);
  437. expect(updated.rootDraft.exists).toBe(false);
  438. // TD04:同一个空白页面再次 New Task,丢弃未提交配置;删空文字后也不留记录。
  439. await switchV4Mode("yolo");
  440. await startDraftFromProject(DEFAULT_WORKSPACE);
  441. await expectMode("build");
  442. await setV4ComposerText("temporary draft");
  443. await browser.waitUntil(
  444. async () =>
  445. (await getV4ComposerDraftScopeSnapshot(DEFAULT_WORKSPACE, null)).text === "temporary draft",
  446. );
  447. await setV4ComposerText("");
  448. await browser.waitUntil(
  449. async () => !(await getV4ComposerDraftScopeSnapshot(DEFAULT_WORKSPACE, null)).exists,
  450. );
  451. await setV4ComposerText("unsent root draft");
  452. await switchV4Mode("plan");
  453. await selectV4TaskById(firstSession);
  454. await expectMode("yolo");
  455. await setV4ComposerText("unsent session draft");
  456. await switchV4Mode("build");
  457. await selectV4TaskById(secondSession);
  458. await expectMode("build");
  459. await startDraftFromProject(DEFAULT_WORKSPACE);
  460. await expectMode("build");
  461. await $('[data-testid="v4-composer-plan-marker"]').waitForDisplayed();
  462. await browser.refresh();
  463. await expectMode("build");
  464. await $('[data-testid="v4-composer-plan-marker"]').waitForDisplayed();
  465. await selectV4TaskById(firstSession);
  466. // 刷新后的缓存草稿可先于历史投影就绪;必须等旧 Snapshot 恢复后再断言不被覆盖。
  467. await waitForV4TimelineContaining("RECENT_MODE_STREAMING");
  468. // 正式会话重开恢复文字,权限取最新 Snapshot;未发送的菜单选择不替代运行事实。
  469. await expectMode("yolo");
  470. await waitForV4ComposerText("unsent session draft", "正式会话的文字草稿未恢复");
  471. await captureState("05-session-draft-isolation");
  472. });
  473. });