byok.test.mjs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. import test from "node:test";
  2. import assert from "node:assert/strict";
  3. import { createServer } from "node:http";
  4. import { spawn } from "node:child_process";
  5. import {
  6. mkdtempSync,
  7. mkdirSync,
  8. rmSync,
  9. existsSync,
  10. readFileSync,
  11. writeFileSync,
  12. } from "node:fs";
  13. import { tmpdir } from "node:os";
  14. import path from "node:path";
  15. import { fileURLToPath } from "node:url";
  16. import Database from "better-sqlite3";
  17. import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
  18. import { withoutProxyEnvironment } from "./offline-environment.mjs";
  19. const cli = process.env.MCODE_TEST_CLI ?? fileURLToPath(new URL("../dist/cli.js", import.meta.url));
  20. // This fixture validates BYOK transport and real Runtime persistence, not model quality.
  21. test(
  22. "BYOK runs without managed login and resumes its saved conversation",
  23. { timeout: 90000 },
  24. async (t) => {
  25. const fixtureDir = mkdtempSync(path.join(tmpdir(), "minimax-code-byok-"));
  26. const dataDir = path.join(fixtureDir, "data");
  27. const workspaceDir = path.join(fixtureDir, "workspace");
  28. mkdirSync(workspaceDir);
  29. const dbPath = path.join(dataDir, "v2", "sqlite", "runtime-state.sqlite");
  30. mkdirSync(path.dirname(dbPath), { recursive: true });
  31. const legacyDb = new Database(dbPath);
  32. try {
  33. // An upgrade must ignore a previously enabled cloud-indexing preference.
  34. legacyDb.exec(`
  35. CREATE TABLE local_runtime_preferences (key TEXT PRIMARY KEY, value_json TEXT NOT NULL);
  36. INSERT INTO local_runtime_preferences VALUES ('workspace-indexing-enabled', 'true');
  37. `);
  38. } finally {
  39. legacyDb.close();
  40. }
  41. const requests = [];
  42. const readMarker = `ACTUAL_FILE_CONTENT_${Date.now()}`;
  43. writeFileSync(path.join(workspaceDir, "read-fixture.txt"), readMarker);
  44. let toolRequested = false;
  45. let rejectConnection = false;
  46. const networkAudit = path.join(dataDir, "network-audit.log");
  47. const server = createServer(async (req, res) => {
  48. let raw = "";
  49. for await (const chunk of req) raw += chunk;
  50. const body = JSON.parse(raw);
  51. requests.push({ url: req.url, auth: req.headers.authorization, body });
  52. if (!req.url?.endsWith("/chat/completions")) {
  53. res.writeHead(404).end();
  54. return;
  55. }
  56. if (rejectConnection) {
  57. res.writeHead(401, { "content-type": "application/json" }).end(
  58. JSON.stringify({ error: { message: "Synthetic invalid credential" } }),
  59. );
  60. return;
  61. }
  62. if (!body.stream) {
  63. res.writeHead(200, { "content-type": "application/json" }).end(
  64. JSON.stringify({
  65. id: "fixture",
  66. object: "chat.completion",
  67. model: "fixture-model",
  68. choices: [
  69. {
  70. index: 0,
  71. message: { role: "assistant", content: "LOCAL_BYOK_OK" },
  72. finish_reason: "stop",
  73. },
  74. ],
  75. usage: { prompt_tokens: 1, completion_tokens: 1, total_tokens: 2 },
  76. }),
  77. );
  78. return;
  79. }
  80. res.writeHead(200, { "content-type": "text/event-stream" });
  81. if (
  82. JSON.stringify(body.messages).includes("TOOL_READ_TEST") &&
  83. !toolRequested
  84. ) {
  85. toolRequested = true;
  86. assert.ok(body.tools?.some((tool) => tool.function?.name === "read"));
  87. for (const delta of [
  88. {
  89. choices: [
  90. {
  91. index: 0,
  92. delta: {
  93. role: "assistant",
  94. tool_calls: [
  95. {
  96. index: 0,
  97. id: "read-fixture-call",
  98. type: "function",
  99. function: {
  100. name: "read",
  101. arguments: JSON.stringify({
  102. path: path.join(workspaceDir, "read-fixture.txt"),
  103. }),
  104. },
  105. },
  106. ],
  107. },
  108. finish_reason: null,
  109. },
  110. ],
  111. },
  112. { choices: [{ index: 0, delta: {}, finish_reason: "tool_calls" }] },
  113. ])
  114. res.write(
  115. `data: ${JSON.stringify({ id: "fixture", object: "chat.completion.chunk", created: 1, model: "fixture-model", ...delta })}\n\n`,
  116. );
  117. res.end("data: [DONE]\n\n");
  118. return;
  119. }
  120. for (const chunk of [
  121. {
  122. choices: [
  123. {
  124. index: 0,
  125. delta: { role: "assistant", content: "LOCAL_BYOK_OK" },
  126. finish_reason: null,
  127. },
  128. ],
  129. },
  130. {
  131. choices: [{ index: 0, delta: {}, finish_reason: "stop" }],
  132. usage: { prompt_tokens: 1, completion_tokens: 1, total_tokens: 2 },
  133. },
  134. ])
  135. res.write(
  136. `data: ${JSON.stringify({ id: "fixture", object: "chat.completion.chunk", created: 1, model: "fixture-model", ...chunk })}\n\n`,
  137. );
  138. res.end("data: [DONE]\n\n");
  139. });
  140. await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));
  141. t.after(async () => {
  142. server.closeAllConnections();
  143. await new Promise((resolve) => server.close(resolve));
  144. try {
  145. assert.equal(
  146. existsSync(networkAudit),
  147. false,
  148. existsSync(networkAudit)
  149. ? readFileSync(networkAudit, "utf8")
  150. : "Unexpected external request",
  151. );
  152. } finally {
  153. rmSync(fixtureDir, { recursive: true, force: true });
  154. }
  155. });
  156. const baseUrl = `http://127.0.0.1:${server.address().port}/v1`;
  157. const env = {
  158. MINIMAX_DATA_DIR: dataDir,
  159. MAVIS_DATA_DIR: dataDir,
  160. MCODE_PROVIDER_API_KEY: "fixture-only-key",
  161. MCODE_TEST_ALLOWED_ORIGIN: new URL(baseUrl).origin,
  162. MCODE_TEST_NETWORK_AUDIT: networkAudit,
  163. MCODE_TEST_MANAGED_OFFLINE: "1",
  164. MCODE_TEST_PROCESS_PROBE: "1",
  165. NODE_OPTIONS: `--import=${new URL("./network-deny.mjs", import.meta.url).href}`,
  166. };
  167. let commandSequence = 0;
  168. async function run(args, environment = process.env) {
  169. const startedAt = Date.now();
  170. const label = args.slice(0, 2).join(" ");
  171. const requestCountAtStart = requests.length;
  172. const diagnosticsDir = path.join(dataDir, `cli-diagnostics-${++commandSequence}`);
  173. const commandArgs = args[0] === "exec"
  174. ? [...args, "--diagnostics-dir", diagnosticsDir]
  175. : args;
  176. return new Promise((resolve, reject) => {
  177. const child = spawn(process.execPath, [cli, ...commandArgs], {
  178. cwd: workspaceDir,
  179. env: { ...withoutProxyEnvironment(environment), ...env },
  180. stdio: ["ignore", "pipe", "pipe"],
  181. });
  182. let stdout = "",
  183. stderr = "";
  184. let timeoutError;
  185. const timer = setTimeout(() => {
  186. const progressPath = path.join(diagnosticsDir, "progress.jsonl");
  187. let progress = "No execution progress recorded";
  188. try {
  189. if (existsSync(progressPath))
  190. progress = readFileSync(progressPath, "utf8").slice(-12000);
  191. } catch (error) {
  192. progress = `Unable to read execution progress: ${error.message}`;
  193. }
  194. timeoutError = new Error(
  195. `Timed out after ${Date.now() - startedAt}ms: ${label}\n` +
  196. `Fixture requests during command: ${requests.length - requestCountAtStart}\n` +
  197. `stdout (tail): ${stdout.slice(-12000)}\nstderr (tail): ${stderr.slice(-12000)}\n` +
  198. `execution progress (tail): ${progress}`,
  199. );
  200. child.kill("SIGKILL");
  201. child.stdout.destroy();
  202. child.stderr.destroy();
  203. }, 35000);
  204. child.stdout.on("data", (chunk) => {
  205. stdout += chunk;
  206. });
  207. child.stderr.on("data", (chunk) => {
  208. stderr += chunk;
  209. });
  210. child.once("error", (error) => {
  211. clearTimeout(timer);
  212. reject(error);
  213. });
  214. child.once("close", (code) => {
  215. clearTimeout(timer);
  216. t.diagnostic(`${label}: exit ${code} after ${Date.now() - startedAt}ms`);
  217. if (timeoutError) {
  218. reject(timeoutError);
  219. return;
  220. }
  221. code === 0
  222. ? resolve(stdout)
  223. : reject(new Error(`CLI exited ${code}: ${stderr}\n${stdout}`));
  224. });
  225. });
  226. }
  227. await run([
  228. "provider",
  229. "add",
  230. "--name",
  231. "Fixture",
  232. "--base-url",
  233. baseUrl,
  234. "--api-format",
  235. "openai-completions",
  236. "--model",
  237. "fixture-model",
  238. ]);
  239. assert.equal(requests.length, 0, "Adding without --use must not test or activate");
  240. const snapshot = JSON.parse(await run(["provider", "list", "--json"]));
  241. assert.equal(
  242. snapshot.providers.some((p) => p.kind === "minimax-oauth"),
  243. true,
  244. );
  245. const selected = snapshot.providers.find(
  246. (p) => p.kind === "custom" && p.name === "Fixture",
  247. );
  248. assert.ok(selected?.hasApiKey);
  249. const proxyNames = [
  250. "HTTP_PROXY", "HTTPS_PROXY", "ALL_PROXY", "NO_PROXY",
  251. "http_proxy", "https_proxy", "all_proxy", "no_proxy",
  252. ];
  253. const cleanEnvironment = Object.fromEntries(
  254. Object.entries(process.env).filter(([name]) => !proxyNames.includes(name)),
  255. );
  256. const proxyValue = (name) => name.toLowerCase() === "no_proxy"
  257. ? "*"
  258. : "http://127.0.0.1:9";
  259. for (const [label, proxies] of [
  260. ["no proxy", {}],
  261. ...proxyNames.map((name) => [name, { [name]: proxyValue(name) }]),
  262. ["uppercase and lowercase together", Object.fromEntries(
  263. proxyNames.map((name) => [name, proxyValue(name)]),
  264. )],
  265. ]) {
  266. // Node 24.0–24.2 returns undefined from t.test(), so awaiting it does
  267. // not wait for the proxy checks. Keep this shared-fixture phase directly
  268. // sequential before changing rejectConnection or checking request counts.
  269. // https://github.com/nodejs/node/issues/58227
  270. t.diagnostic(`offline BYOK ignores ambient proxies: ${label}`);
  271. const environment = Object.freeze({ ...cleanEnvironment, ...proxies });
  272. // NO_PROXY alone does not enable proxy mode, so check its isolation explicitly.
  273. const isolated = withoutProxyEnvironment(environment);
  274. for (const name of proxyNames) assert.equal(isolated[name], "");
  275. assert.equal(isolated.PATH, environment.PATH);
  276. const beforeRequests = requests.length;
  277. const managedAudit = `${networkAudit}.managed`;
  278. const beforeManaged = readFileSync(managedAudit, "utf8").length;
  279. await run([
  280. "provider", "test", selected.providerId, "--model", "fixture-model",
  281. ], environment);
  282. assert.ok(requests.length > beforeRequests, "The local provider must receive the request");
  283. assert.equal(requests[beforeRequests].body.model, "fixture-model");
  284. assert.match(
  285. readFileSync(managedAudit, "utf8").slice(beforeManaged),
  286. /https:\/\/models\.dev\/api\.json|\/mavis\/api\/v1\/models-dev\/catalog/,
  287. );
  288. assert.equal(existsSync(networkAudit), false, "No outbound network attempt is allowed");
  289. for (const [name, value] of Object.entries(proxies)) assert.equal(environment[name], value);
  290. }
  291. const configPath = path.join(dataDir, "config.yaml");
  292. const savedConfig = () => parseYaml(readFileSync(configPath, "utf8"));
  293. assert.equal(savedConfig().defaultModel, "minimax/MiniMax-M3");
  294. assert.equal(savedConfig().custom_provider.fixture.models["fixture-model"].limit, undefined);
  295. assert.equal(selected.active, false);
  296. assert.equal(selected.models[0].contextLimit, undefined);
  297. assert.equal(selected.models[0].maxOutputTokens, undefined);
  298. // The selected plan path must survive YAML persistence and actual inference.
  299. const codingUrl = `${new URL(baseUrl).origin}/api/coding/paas/v4`;
  300. const beforeCoding = requests.length;
  301. await run([
  302. "provider", "add", "--name", "Coding", "--base-url", codingUrl,
  303. "--api-format", "openai-completions", "--model", "glm-5.3", "--use",
  304. ]);
  305. assert.equal(savedConfig().custom_provider.coding.options.baseURL, codingUrl);
  306. assert.equal(savedConfig().defaultModel, "custom_provider:coding/glm-5.3");
  307. assert.match(await run([
  308. "exec", "CODING_ENDPOINT_TEST", "--timeout", "20s", "--max-steps", "1",
  309. ]), /LOCAL_BYOK_OK/);
  310. const codingRequests = requests.slice(beforeCoding);
  311. assert.ok(codingRequests.some(({ body }) => body.stream === true && body.model === "glm-5.3"));
  312. // Loopback hosts may also receive a separate Responses token-count probe.
  313. const chatRequests = codingRequests.filter(({ body }) => Array.isArray(body.messages));
  314. assert.ok(chatRequests.length >= 2, "Both the connection test and inference must use Chat");
  315. assert.ok(chatRequests.every(({ url }) => url === "/api/coding/paas/v4/chat/completions"));
  316. const addArgs = [
  317. "provider", "add", "--name", "Limited", "--base-url", baseUrl,
  318. "--api-format", "openai-completions", "--model", "fixture-model",
  319. "--model", "second-model", "--context-limit", "32768", "--output-limit", "4096", "--use",
  320. "--support-image",
  321. ];
  322. const beforeFailure = readFileSync(configPath, "utf8");
  323. rejectConnection = true;
  324. await assert.rejects(run(addArgs), /Provider connection test failed.*Nothing was saved/s);
  325. assert.equal(readFileSync(configPath, "utf8"), beforeFailure);
  326. rejectConnection = false;
  327. const beforeAdd = requests.length;
  328. assert.match(await run(addArgs), /Provider added and selected: Limited/);
  329. assert.ok(requests.length > beforeAdd, "Activation must test the candidate before saving");
  330. assert.equal(requests[beforeAdd].body.model, "fixture-model");
  331. const config = savedConfig();
  332. assert.equal(config.defaultModel, "custom_provider:limited/fixture-model");
  333. for (const model of ["fixture-model", "second-model"]) {
  334. assert.deepEqual(config.custom_provider.limited.models[model].limit, { context: 32768, output: 4096 });
  335. assert.deepEqual(config.custom_provider.limited.models[model].capabilities, { support_image: true });
  336. }
  337. const configured = JSON.parse(await run(["provider", "list", "--json"])).providers.find(
  338. (provider) => provider.name === "Limited",
  339. );
  340. assert.equal(configured.active, true);
  341. assert.equal(configured.models[0].selected, true);
  342. for (const model of configured.models) {
  343. assert.equal(model.contextLimit, 32768);
  344. assert.equal(model.maxOutputTokens, 4096);
  345. }
  346. const beforeSaveOnly = requests.length;
  347. for (const [name, flag, limit] of [
  348. ["context-only", "--context-limit", { context: 32768 }],
  349. ["output-only", "--output-limit", { output: 32768 }],
  350. ]) {
  351. await run([
  352. "provider", "add", "--name", name, "--base-url", baseUrl,
  353. "--api-format", "openai-completions", "--model", "fixture-model", flag, "32768",
  354. "--support-image",
  355. ]);
  356. assert.deepEqual(savedConfig().custom_provider[name].models["fixture-model"].limit, limit);
  357. assert.deepEqual(savedConfig().custom_provider[name].models["fixture-model"].capabilities, { support_image: true });
  358. assert.equal(savedConfig().defaultModel, config.defaultModel);
  359. }
  360. assert.equal(requests.length, beforeSaveOnly, "Limits alone must not test or select a model");
  361. // Exercise the metadata persisted by provider preset import through real
  362. // config reload, headless validation and the OpenAI-compatible request body.
  363. const effortConfig = savedConfig();
  364. effortConfig.custom_provider.fixture.models["kimi-k3"] = {
  365. reasoning: true,
  366. thinking: { effortOptions: ["low", "high", "max"] },
  367. };
  368. effortConfig.custom_provider.fixture.models["vision-modalities"] = {
  369. modalities: { input: ["text", "image"], output: ["text"] },
  370. };
  371. effortConfig.custom_provider.fixture.models["attachment-only"] = { attachment: true };
  372. writeFileSync(configPath, stringifyYaml(effortConfig));
  373. // The packaged command must carry the declaration through saving, a fresh
  374. // process/config reload, attachment preparation and SDK serialization.
  375. const imageBase64 = "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGUlEQVR4nGP4n8LwnxLMMGrAqAGjBgwXAwCOqWIfmQV0zAAAAABJRU5ErkJggg==";
  376. const imagePath = path.join(workspaceDir, "fixture.png");
  377. writeFileSync(imagePath, Buffer.from(imageBase64, "base64"));
  378. for (const [model, supportsImage] of [
  379. ["custom_provider:limited/fixture-model", true],
  380. ["custom_provider:context-only/fixture-model", true],
  381. ["custom_provider:fixture/vision-modalities", true],
  382. ["custom_provider:fixture/fixture-model", false],
  383. ["custom_provider:fixture/attachment-only", false],
  384. ]) {
  385. const beforeImage = requests.length;
  386. await run(["exec", "IMAGE_INPUT_TEST", "--model", model, "--file", imagePath,
  387. "--timeout", "20s", "--max-steps", "1"]);
  388. const turns = requests.slice(beforeImage).filter((r) => r.body.stream === true);
  389. assert.ok(turns.length > 0, `Expected a runtime request for ${model}`);
  390. for (const { body } of turns) {
  391. const images = body.messages.flatMap((message) =>
  392. Array.isArray(message.content)
  393. ? message.content.filter((part) => part.type === "image_url")
  394. : []);
  395. if (supportsImage) {
  396. assert.equal(images.length, 1, `Expected an inline image for ${model}`);
  397. // PNG inputs are transcoded to JPEG by the real attachment pipeline.
  398. const url = images[0].image_url.url;
  399. assert.match(url, /^data:image\/jpeg;base64,/);
  400. const bytes = Buffer.from(url.split(",")[1], "base64");
  401. assert.deepEqual([...bytes.subarray(0, 3)], [0xff, 0xd8, 0xff]);
  402. assert.deepEqual([...bytes.subarray(-2)], [0xff, 0xd9]);
  403. assert.doesNotMatch(JSON.stringify(body.messages), /current model cannot read this image inline/);
  404. } else {
  405. assert.deepEqual(images, [], `${model} must remain text-only`);
  406. assert.match(JSON.stringify(body.messages), /current model cannot read this image inline/);
  407. }
  408. }
  409. }
  410. const effortModel = `${selected.providerId}/kimi-k3`;
  411. for (const effort of ["low", "high", "max"]) {
  412. const beforeEffort = requests.length;
  413. await run(["exec", "EFFORT_TEST", "--model", effortModel, "--effort", effort,
  414. "--timeout", "20s", "--max-steps", "1"]);
  415. // Background title generation is a separate non-streaming request and
  416. // does not use the turn's effort selection.
  417. const modelRequests = requests.slice(beforeEffort).filter(
  418. (r) => r.body.model === "kimi-k3" && r.body.stream === true,
  419. );
  420. assert.ok(modelRequests.length > 0);
  421. for (const request of modelRequests) assert.equal(request.body.reasoning_effort, effort);
  422. }
  423. const beforeInvalidEffort = requests.length;
  424. await assert.rejects(run(["exec", "EFFORT_TEST", "--model", effortModel,
  425. "--effort", "medium", "--timeout", "20s", "--max-steps", "1"]),
  426. /Available levels: low, high, max/);
  427. assert.equal(requests.length, beforeInvalidEffort, "Invalid effort must fail before transport");
  428. const modelArgs = ["--model", `${selected.providerId}/fixture-model`];
  429. // The first run must work through the saved default, without --model or managed login.
  430. const first = await run([
  431. "exec",
  432. "Remember this marker: SOURCE_REPOSITORY_TEST",
  433. "--timeout",
  434. "20s",
  435. "--max-steps",
  436. "1",
  437. ]);
  438. assert.match(first, /LOCAL_BYOK_OK/);
  439. await assert.rejects(run([
  440. 'exec', 'Managed model still requires its own login',
  441. '--model', 'minimax/MiniMax-M3', '--timeout', '20s', '--max-steps', '1',
  442. ]), /Sign in to MiniMax/);
  443. const beforeResume = requests.length;
  444. const second = await run([
  445. "exec",
  446. "Repeat the marker",
  447. ...modelArgs,
  448. "--continue",
  449. "--timeout",
  450. "20s",
  451. "--max-steps",
  452. "1",
  453. ]);
  454. assert.match(second, /LOCAL_BYOK_OK/);
  455. assert.ok(
  456. requests
  457. .slice(beforeResume)
  458. .some((r) =>
  459. JSON.stringify(r.body.messages ?? []).includes(
  460. "SOURCE_REPOSITORY_TEST",
  461. ),
  462. ),
  463. JSON.stringify(
  464. requests.map((r) => ({ url: r.url, keys: Object.keys(r.body) })),
  465. ),
  466. );
  467. const toolStart = requests.length;
  468. await run([
  469. "exec",
  470. "TOOL_READ_TEST: read read-fixture.txt",
  471. ...modelArgs,
  472. "--timeout",
  473. "20s",
  474. "--max-steps",
  475. "3",
  476. ]);
  477. assert.equal(toolRequested, true);
  478. assert.ok(
  479. requests
  480. .slice(toolStart)
  481. .some((r) =>
  482. r.body.messages?.some(
  483. (m) =>
  484. m.role === "tool" &&
  485. JSON.stringify(m.content).includes(readMarker),
  486. ),
  487. ),
  488. "The real read tool must return file contents to the provider",
  489. );
  490. assert.ok(requests.length >= 2);
  491. assert.ok(requests.every((r) => r.auth === "Bearer fixture-only-key"));
  492. assert.equal(
  493. requests.some((r) => r.body.tools?.some(
  494. (tool) => tool.function?.name === "workspace_semantic_search",
  495. )),
  496. false,
  497. "The retired workspace search tool must not be exposed to the model",
  498. );
  499. assert.equal(
  500. existsSync(path.join(dataDir, "v2", "workspaces")),
  501. false,
  502. "Startup, completed turns and resume must not create indexing artifacts",
  503. );
  504. const managedAudit = `${networkAudit}.managed`;
  505. assert.doesNotMatch(
  506. existsSync(managedAudit) ? readFileSync(managedAudit, "utf8") : "",
  507. /workspace-indexing/,
  508. "No workspace indexing request may be attempted",
  509. );
  510. const verificationDb = new Database(dbPath, { readonly: true });
  511. try {
  512. assert.deepEqual(
  513. verificationDb.prepare(
  514. "SELECT name FROM sqlite_master WHERE type = 'table' AND name LIKE 'local_runtime_workspace_indexing_%'",
  515. ).all(),
  516. [],
  517. "New runtime databases must not create the retired upload queue",
  518. );
  519. } finally {
  520. verificationDb.close();
  521. }
  522. },
  523. );