From 4463f5ffea9706109fced167a99b879038168faa Mon Sep 17 00:00:00 2001 From: Yabuku-xD <78594762+Yabuku-xD@users.noreply.github.com> Date: Tue, 1 Dec 2026 03:23:10 -0800 Subject: [PATCH 1/7] desktop start: the Cloud account is restored while this computer's server starts, not after it The first screen waits on the account's restore (the account gate asks for it), and the restore started only once the local server was up, so the account service's round trip (about 600 ms in a 0.2.38 log) came after the server's boot instead of beside it. The restore now starts before the server is awaited. What an account state changes here (enrollment, included services, the home window, the page) asks that server, so the states are held and applied in order once it is up, as before. --- electron/held-until-released.mjs | 15 +++++++++ electron/held-until-released.node-test.mjs | 32 ++++++++++++++++++ electron/main.mjs | 38 +++++++++++----------- 3 files changed, 66 insertions(+), 19 deletions(-) create mode 100644 electron/held-until-released.mjs create mode 100644 electron/held-until-released.node-test.mjs diff --git a/electron/held-until-released.mjs b/electron/held-until-released.mjs new file mode 100644 index 0000000000..ec00b2533c --- /dev/null +++ b/electron/held-until-released.mjs @@ -0,0 +1,15 @@ +/** Calls `apply` with each value, but values delivered before `release()` wait and then apply in their order. */ +export function heldUntilReleased(apply) { + let held = []; + return { + deliver(value) { + if (held) held.push(value); + else apply(value); + }, + release() { + const waiting = held ?? []; + held = null; + for (const value of waiting) apply(value); + }, + }; +} diff --git a/electron/held-until-released.node-test.mjs b/electron/held-until-released.node-test.mjs new file mode 100644 index 0000000000..ffd7931c61 --- /dev/null +++ b/electron/held-until-released.node-test.mjs @@ -0,0 +1,32 @@ +import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; +import test from "node:test"; + +import { heldUntilReleased } from "./held-until-released.mjs"; + +test("values delivered before the release wait and then apply in order; later ones apply at once", () => { + const applied = []; + const states = heldUntilReleased((value) => applied.push(value)); + states.deliver("restoring"); + states.deliver("connected"); + assert.deepEqual(applied, []); + states.release(); + assert.deepEqual(applied, ["restoring", "connected"]); + states.deliver("signed-out"); + assert.deepEqual(applied, ["restoring", "connected", "signed-out"]); + states.release(); + assert.deepEqual(applied, ["restoring", "connected", "signed-out"]); +}); + +test("a launch restores the Cloud account while the local server starts, and applies its states only once the server is up", () => { + const main = readFileSync(new URL("./main.mjs", import.meta.url), "utf8"); + const launch = main.indexOf("app.whenReady().then"); + const restore = main.indexOf("cloudAccountStarted = ensureCloudAccount().start()", launch); + const serverWait = main.indexOf("const startup = startPackagedAlongsideVps", launch); + const serverMark = main.indexOf('startupTrace.mark(serverReady ? "server" : "server-failed")', launch); + const release = main.indexOf("accountStates.release()", launch); + assert.ok(launch > 0 && restore > launch && serverWait > restore, "the restore starts before the server is awaited"); + assert.ok(release > serverMark, "account states apply after the server is up"); + assert.equal(main.indexOf("cloudAccountStarted = ensureCloudAccount().start()", restore + 1), -1, "the restore starts once"); + assert.match(main, /onState: state => accountStates\.deliver\(state\)/); +}); diff --git a/electron/main.mjs b/electron/main.mjs index 01f2a7a0dc..0b1823d85b 100644 --- a/electron/main.mjs +++ b/electron/main.mjs @@ -43,7 +43,7 @@ import { createOrganizationEntry, isOrganizationDeepLink, takeOrganizationDeepLi import { FRAME_BY_DEFAULT, widenedBounds, windowBackground, windowChromeOptions } from "./window-chrome.mjs"; import { createAllWindowsClosedQuit } from "./window-all-closed.mjs"; import { createStartupScreen, expectedLoadMs, rememberLoad, startupDark } from "./startup-screen.mjs"; -import { createStartupTrace } from "./startup-trace.mjs"; +import { createStartupTrace } from "./startup-trace.mjs"; import { heldUntilReleased } from "./held-until-released.mjs"; import { devUserDataDir } from "./dev-defaults.mjs"; import { createDevServerChild, devOwnServerWanted, devServerConflictMessage, watchServerSource } from "./dev-server-child.mjs"; import { desktopLogDir } from "./dev-log-dir.mjs"; import { createSystemTray } from "./system-tray.mjs"; @@ -954,22 +954,24 @@ function ensureCloudAccount() { // every browser sign-in (Google, Apple, a magic link) goes through the website with this app's sign-in code, so a new // account gets the website's first steps there, and this app signs itself in when the website approves it openBrowser: url => shell.openExternal(url), awaitingWake: () => cloudPower.awaiting(), appLinks: false, - onState: state => { - if (state?.account && state.status === "connected") desktopPrefs?.markSignedIn(); cloudSync.accountChanged(state.account?.id ?? null); rememberCloudHome(state); - rememberedHome = rememberedCloudHome(rememberedHome, state); - cloudPower.changed(); try { void oneHome.kick(); void homeWindow.changed(); announceAddedCloud(state); railChanged(); accountEnroll.onState(state); accountGate.changed(state); void botsElsewhere.remember(); void vpsCloudMove?.kick(); void vpsCloudMove?.signedInNow?.(); serverEnroll?.onState(state); } catch {} - // a server's install line that waited on the account: made at once now (vpsLink may not exist yet at launch) - try { if (state?.account && state.status === "connected") void vpsLink?.accountReady?.(); } catch {} - void includedX.onState(state); void includedPages.onState(state); void includedXIndex.onState(state); void includedArtifacts.onState(state); accounts.tell(); - refreshCloudMenus(); - announceCloudReady(state); - if (mainWindow && !mainWindow.isDestroyed() && mainWindow.webContents.mainFrame.url.startsWith(`${rendererOrigin()}/`) && - !activeRemote(environmentsState) && !desktopRemoteAccess) mainWindow.webContents.send("cloud-account:state-changed", state); - }, + onState: state => accountStates.deliver(state), }); return cloudAccount; } +const accountStates = heldUntilReleased(function applyAccountState(state) { + if (state?.account && state.status === "connected") desktopPrefs?.markSignedIn(); cloudSync.accountChanged(state.account?.id ?? null); rememberCloudHome(state); + rememberedHome = rememberedCloudHome(rememberedHome, state); + cloudPower.changed(); try { void oneHome.kick(); void homeWindow.changed(); announceAddedCloud(state); railChanged(); accountEnroll.onState(state); accountGate.changed(state); void botsElsewhere.remember(); void vpsCloudMove?.kick(); void vpsCloudMove?.signedInNow?.(); serverEnroll?.onState(state); } catch {} + // a server's install line that waited on the account: made at once now (vpsLink may not exist yet at launch) + try { if (state?.account && state.status === "connected") void vpsLink?.accountReady?.(); } catch {} + void includedX.onState(state); void includedPages.onState(state); void includedXIndex.onState(state); void includedArtifacts.onState(state); accounts.tell(); + refreshCloudMenus(); + announceCloudReady(state); + if (mainWindow && !mainWindow.isDestroyed() && mainWindow.webContents.mainFrame.url.startsWith(`${rendererOrigin()}/`) && + !activeRemote(environmentsState) && !desktopRemoteAccess) mainWindow.webContents.send("cloud-account:state-changed", state); +}); + /** The free trial's popup, at most once a day per notice across this computer's page and the Cloud's. */ let trialNotices = null; function cloudTrialNotices() { @@ -3522,6 +3524,9 @@ app.whenReady().then(async () => { ? cuaWanted.promise.then((wanted) => wanted ? startCua() : { mode: "unavailable", reason: "startup-failed" }).catch((e) => { console.error("[cua] start failed:", e); return { mode: "unavailable", reason: String(e) }; }) : Promise.resolve({ mode: "unavailable", reason: "unsupported-platform" }); if (app.isPackaged && !desktopRemoteAccess) prepareMainWindow(); + // Fresh local use never makes a Cloud request; start only restores a grant, beside the server start: the first screen waits on it, and `accountStates` holds its states until that server is up. + if (accountApp() || accountGateNeeded()) { cloudAccountRestoring = true; + cloudAccountStarted = ensureCloudAccount().start().catch(() => {}).then(() => accountRing()?.start()).finally(() => { cloudAccountRestoring = false; }); } if (desktopRemoteAccess) { try { desktopCompanionRelay = await startDesktopCompanionRelay({ @@ -3610,13 +3615,8 @@ app.whenReady().then(async () => { } finally { localRuntimeStarting = null; } } startupTrace.mark(serverReady ? "server" : "server-failed"); if (!serverReady) skipCua(); - if (desktopShutdownStarted) return; + if (desktopShutdownStarted) return; accountStates.release(); if (app.isPackaged && !desktopRemoteAccess) void ensureManagedDesktop().start().then(() => companyBackupSchedule.start()).catch(() => {}); - // Fresh local use never makes a Cloud request; start only restores an existing grant. - if (accountApp() || accountGateNeeded()) { - cloudAccountRestoring = true; - cloudAccountStarted = ensureCloudAccount().start().catch(() => {}).then(() => accountRing()?.start()).finally(() => { cloudAccountRestoring = false; }); - } void cloudAccountStarted.then(() => { void oneHome.kick(); void homeWindow.refresh(); void vpsCloudMove?.kick(); if (cloudAccount) serverEnroll?.onState(cloudAccount.state()); void viaMacFollow(); }); void ownHome?.kick(); if (!desktopRemoteAccess && serverReady && companionEnabledAtRest() && !oneHome.away() && !ownHome?.away() && !cleanWorkspace.marker().frozen) { // Retries stop once the person turns the phone off, starts it by hand or quits. From b3429b88b77a9559aab178907e8170d54ff36cd1 Mon Sep 17 00:00:00 2001 From: Yabuku-xD <78594762+Yabuku-xD@users.noreply.github.com> Date: Tue, 1 Dec 2026 03:32:37 -0800 Subject: [PATCH 2/7] tests: find_tool ranks skill_manage first again for a reusable skill, and the guest skill card test stages four kinds of work bacb5320b left two tests red on dev. Its new skill_manage description dropped the word reusable, so find_tool ranked skills_list first for "save this procedure as a reusable skill"; the description says reusable SKILL.md again (a skill is recurring work, which that change keeps). Its duplicate check turns away a create that covers an existing skill, and the guest skill card test staged four skills with one description, the same as an earlier test's: each now has its own kind of work. (cherry picked from commit 78889fccca4dacac387ef69c68b5c41c3ebc3f1d) --- server/cloud-personal.e2e.test.ts | 9 ++++- .../full.tools-list.json | 2 +- .../agents-catalog-goldens/profiles.json | 40 +++++++++---------- server/drivers/agents-catalog.ts | 2 +- 4 files changed, 30 insertions(+), 23 deletions(-) diff --git a/server/cloud-personal.e2e.test.ts b/server/cloud-personal.e2e.test.ts index 73081ca1f2..781e7d3415 100644 --- a/server/cloud-personal.e2e.test.ts +++ b/server/cloud-personal.e2e.test.ts @@ -678,7 +678,14 @@ it("a guest's skill card enables only the exact text the owner reviewed, holds a const owner = await adminPairing(); await settleAll(owner); const botId = before.roomBot.id; - const skillMd = (name: string, body: string) => `---\nname: ${name}\ndescription: Checks the site for broken links.\n---\n\n# ${name}\n\n${body}\n`; + // kinds of work none of this file's other skills covers: a create that covers a skill already there is turned away + const work: Record = { + "reviewed-links": "Reviews pull requests for missing tests.", + "denied-links": "Drafts the weekly status email for the team.", + "lost-links": "Files expense receipts in the company portal.", + "deleted-links": "Renames vacation photos by the date taken.", + }; + const skillMd = (name: string, body: string) => `---\nname: ${name}\ndescription: ${work[name]}\n---\n\n# ${name}\n\n${body}\n`; const cards = async () => ((await api("GET", `/api/threads/${before.theirs}/messages`, { token: owner })).body.messages as any[]) .map((message) => message.card).filter((card) => card?.skillRequest); const respond = (route: "bot" | "thread", body: Record) => route === "bot" diff --git a/server/drivers/agents-catalog-goldens/full.tools-list.json b/server/drivers/agents-catalog-goldens/full.tools-list.json index 338d8ca056..6ebfb58711 100644 --- a/server/drivers/agents-catalog-goldens/full.tools-list.json +++ b/server/drivers/agents-catalog-goldens/full.tools-list.json @@ -2611,7 +2611,7 @@ }, { "name": "skill_manage", - "description": "Submit a new or updated SKILL.md for one kind of work. Update a learned skill when the person corrected how that work is done, asked you to revise it, or it misled you; never one the person wrote or imported unless they asked for that named skill. Create one only for recurring work with rules you'd get wrong without it, never for an automation, a one-off or a preference; omit what any model knows. If the result is pending, a create stays inactive and an update leaves the current version unchanged. Read the result: it applies immediately at every access level, and the person sees it with an Undo where possible. If applied, continue the work without another confirmation. Only a pending result (a Cloud conversation its owner did not drive) means ending the turn to wait for the owner. Never claim success without an applied result; report failures honestly. This does not elevate another bot's execution permissions.", + "description": "Submit a new or updated reusable SKILL.md for one kind of work. Update a learned skill when the person corrected how that work is done, asked you to revise it, or it misled you; never one the person wrote or imported unless they asked for that named skill. Create one only for recurring work with rules you'd get wrong without it, never for an automation, a one-off or a preference; omit what any model knows. If the result is pending, a create stays inactive and an update leaves the current version unchanged. Read the result: it applies immediately at every access level, and the person sees it with an Undo where possible. If applied, continue the work without another confirmation. Only a pending result (a Cloud conversation its owner did not drive) means ending the turn to wait for the owner. Never claim success without an applied result; report failures honestly. This does not elevate another bot's execution permissions.", "inputSchema": { "type": "object", "additionalProperties": false, diff --git a/server/drivers/agents-catalog-goldens/profiles.json b/server/drivers/agents-catalog-goldens/profiles.json index 232389816e..8da9b6b072 100644 --- a/server/drivers/agents-catalog-goldens/profiles.json +++ b/server/drivers/agents-catalog-goldens/profiles.json @@ -125,8 +125,8 @@ ] }, "skills": { - "bytes": 79704, - "sha256": "ab31ffbd342b3eff3b99849f6722cdc5002514b372e398e499d8bffcd9d5e3da", + "bytes": 79713, + "sha256": "a3ea87f686b9fc624c9aa68eaca93d2fa3d239d377854a7e788870336e8e944a", "tools": [ "set_status", "send_message", @@ -189,8 +189,8 @@ ] }, "skills+voice": { - "bytes": 80482, - "sha256": "72656e98d9324abd4a0a6fe99a0b5fd2d1cb6648b8a8789e50e7ee175bcff5c5", + "bytes": 80491, + "sha256": "5845b1830e6d0546c3f2c9ecbf0329faadd9e82c36769afad6148aa61b374b9a", "tools": [ "set_status", "send_message", @@ -369,8 +369,8 @@ ] }, "skills+non-chief": { - "bytes": 71686, - "sha256": "e033162122142bb14c5991c22b21fb182a049e75efe36f4452890496631c3e55", + "bytes": 71695, + "sha256": "0a31ffd3ed3a5803db43c317b810595a014d9f4d993e119a8b168ac620b6cceb", "tools": [ "set_status", "send_message", @@ -428,8 +428,8 @@ ] }, "skills+voice+non-chief": { - "bytes": 72464, - "sha256": "630045d61d6bdc00fd94bec0327599b38772069a9c2d6b7f982ce176d4bdbaba", + "bytes": 72473, + "sha256": "feacf12ae6edd3eb48ca5b9bc74241682851c3708e8f9a42954575c99523ed4f", "tools": [ "set_status", "send_message", @@ -488,8 +488,8 @@ ] }, "skills+voice+cloud-home": { - "bytes": 79458, - "sha256": "87046e3f1680cb3688a81e68c736e25fe4cc822a7c5c43848d57f732613d509f", + "bytes": 79467, + "sha256": "f19672a959c94ce7073ae118ce9d62172c4af6b88593191de7996a4fccb83165", "tools": [ "set_status", "send_message", @@ -552,8 +552,8 @@ ] }, "skills+voice+non-chief+cloud-home": { - "bytes": 71440, - "sha256": "158fe4d01fbb73b6f4c4a468868e7fe7dd4cd30bb92c6500fe448b0c8a8b542f", + "bytes": 71449, + "sha256": "c3be064722efa48c326150acf7529cf16993760a56bc6c3726915758b63b2e3e", "tools": [ "set_status", "send_message", @@ -611,8 +611,8 @@ ] }, "skills+voice+x": { - "bytes": 87140, - "sha256": "a57e0b4afbfa031a592ced1ab097100ec2a12f6c59535a7b2f2127e0fd3e3303", + "bytes": 87149, + "sha256": "62498a24d47f510cca1314d99605d4be581dab3c2763825ef2ecd5d0d09d79fa", "tools": [ "set_status", "send_message", @@ -684,8 +684,8 @@ ] }, "skills+voice+x+team": { - "bytes": 87556, - "sha256": "efd173cb43a931be63700ee55cf3798c55578d6603495d5353fa0391140ddf21", + "bytes": 87565, + "sha256": "e253321813dbe8fa0ea457f40401f68e92853fa5dacc5fd3f90f3323d2542563", "tools": [ "set_status", "send_message", @@ -758,8 +758,8 @@ ] }, "skills+skill-reader": { - "bytes": 80120, - "sha256": "e562baae663c0b9d238fc65d9a557019eae0e3a10c7cd986d42bec9227b9fcc9", + "bytes": 80129, + "sha256": "db617a90d6dec8a458a5678034198026d7bf2e69afd665d3bf122b4d4322cf99", "tools": [ "set_status", "send_message", @@ -949,8 +949,8 @@ ] }, "skills+voice+dusk": { - "bytes": 81133, - "sha256": "aecee531cd5dd67546525416ac925ec36db52b978777bbbb997718b51da4af69", + "bytes": 81142, + "sha256": "e48dad639cff9c24f7b605f54f443aa54c09d1081519d403df93be26de903f87", "tools": [ "set_status", "send_message", diff --git a/server/drivers/agents-catalog.ts b/server/drivers/agents-catalog.ts index 324a261bec..4f0077619e 100644 --- a/server/drivers/agents-catalog.ts +++ b/server/drivers/agents-catalog.ts @@ -808,7 +808,7 @@ const TOOL_DEFINITIONS = [ { name: "skill_manage", description: - "Submit a new or updated SKILL.md for one kind of work. Update a learned skill when the person corrected how that work is done, asked you to revise it, or it misled you; never one the person wrote or imported unless they asked for that named skill. Create one only for recurring work with rules you'd get wrong without it, never for an automation, a one-off or a preference; omit what any model knows. If the result is pending, a create stays inactive and an update leaves the current version unchanged." + APPLIES_OUTCOME, + "Submit a new or updated reusable SKILL.md for one kind of work. Update a learned skill when the person corrected how that work is done, asked you to revise it, or it misled you; never one the person wrote or imported unless they asked for that named skill. Create one only for recurring work with rules you'd get wrong without it, never for an automation, a one-off or a preference; omit what any model knows. If the result is pending, a create stays inactive and an update leaves the current version unchanged." + APPLIES_OUTCOME, inputSchema: { type: "object", additionalProperties: false, From 9dc652b778b3d1c10ba8b22b052086b5e843cdac Mon Sep 17 00:00:00 2001 From: Yabuku-xD <78594762+Yabuku-xD@users.noreply.github.com> Date: Tue, 1 Dec 2026 12:37:50 -0800 Subject: [PATCH 3/7] ci: the tests that failed at random in Dec 1's CI runs get the flaky list's two retries Fifteen tests failed in CI on Dec 1 in runs of main, a release and PRs #477-#483 whose changes do not reach them, a different set each run, and pass locally. Each entry names the runs it failed in. vps-routing's 'reuses the existing VPS with $settings' failed too (PR #477, run 46623618361) but is left out: its name is made per case, and the list matches names written in the file. (cherry picked from commit 54f5c514dc9dc2315d41cb8c7d82f00b8472fd44) --- scripts/testing/ci-retry-list.json | 105 +++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) diff --git a/scripts/testing/ci-retry-list.json b/scripts/testing/ci-retry-list.json index 070a6c47a0..3498b1c38a 100644 --- a/scripts/testing/ci-retry-list.json +++ b/scripts/testing/ci-retry-list.json @@ -70,6 +70,111 @@ "owner": "siddharth", "reason": "Failed once in the 0.2.33 release CI (run 45993068105, ubuntu shard 5 or parallel-threads, a different test each attempt); passes locally on a quiet machine.", "since": "2026-11-27" + }, + { + "file": "server/settings-sync.e2e.test.ts", + "test": "a setting changed in any one place reaches the others, and the last change wins", + "owner": "Yabuku-xD", + "reason": "Failed on Dec 1 in CI of PRs #479 (run 46726301408, all five), #481 (run 46636209589) and #483 (run 46637592516): a loopback request with no forwarding header was answered 403 'this request came through a proxy'. Passed in the other PR runs that day; passes locally (macOS, Node 26) alone, as four copies at once and in its full ubuntu shard 7/8 with 4 workers.", + "since": "2026-12-01" + }, + { + "file": "server/settings-sync.e2e.test.ts", + "test": "what belongs to one computer stays there", + "owner": "Yabuku-xD", + "reason": "Failed on Dec 1 in CI of PRs #479 (run 46726301408, all five), #481 (run 46636209589) and #483 (run 46637592516): a loopback request with no forwarding header was answered 403 'this request came through a proxy'. Passed in the other PR runs that day; passes locally (macOS, Node 26) alone, as four copies at once and in its full ubuntu shard 7/8 with 4 workers.", + "since": "2026-12-01" + }, + { + "file": "server/settings-sync.e2e.test.ts", + "test": "keys travel only over the person's own links, and a Team Cloud keeps no person's settings", + "owner": "Yabuku-xD", + "reason": "Failed on Dec 1 in CI of PRs #479 (run 46726301408, all five), #481 (run 46636209589) and #483 (run 46637592516): a loopback request with no forwarding header was answered 403 'this request came through a proxy'. Passed in the other PR runs that day; passes locally (macOS, Node 26) alone, as four copies at once and in its full ubuntu shard 7/8 with 4 workers.", + "since": "2026-12-01" + }, + { + "file": "server/settings-sync.e2e.test.ts", + "test": "the move to My Cloud and the way home keep settings level", + "owner": "Yabuku-xD", + "reason": "Failed on Dec 1 in CI of PRs #479 (run 46726301408, all five), #481 (run 46636209589) and #483 (run 46637592516): a loopback request with no forwarding header was answered 403 'this request came through a proxy'. Passed in the other PR runs that day; passes locally (macOS, Node 26) alone, as four copies at once and in its full ubuntu shard 7/8 with 4 workers.", + "since": "2026-12-01" + }, + { + "file": "server/settings-sync.e2e.test.ts", + "test": "a computer whose bots moved to My Cloud is left as it was, with nothing failing, until they come back", + "owner": "Yabuku-xD", + "reason": "Failed on Dec 1 in CI of PRs #479 (run 46726301408, all five), #481 (run 46636209589) and #483 (run 46637592516): a loopback request with no forwarding header was answered 403 'this request came through a proxy'. Passed in the other PR runs that day; passes locally (macOS, Node 26) alone, as four copies at once and in its full ubuntu shard 7/8 with 4 workers.", + "since": "2026-12-01" + }, + { + "file": "server/steer-e2e.test.ts", + "test": "mid-turn steering e2e > a steer the CLI runs as its next native turn keeps the turn, its busy state and its internal tool pass until that reply lands", + "owner": "Yabuku-xD", + "reason": "Failed in CI of PR #477 (run 46623618361, ubuntu shard 8/8) and of the diag/connector-issues branch on Dec 1; passes locally on dev and on #477.", + "since": "2026-12-01" + }, + { + "file": "server/drivers/antigravity.test.ts", + "test": "starting Google sign-in again > hands back the same link while it is live, so a code from the first page still completes", + "owner": "Yabuku-xD", + "reason": "Failed in CI of main (run 46580994542), a release (run 46616055192) and PR #478 (run 46623629685) on Dec 1; failed 1 of 3 local runs on one commit.", + "since": "2026-12-01" + }, + { + "file": "server/connected-app-tools.e2e.test.ts", + "test": "a bot given Gmail by its app switch reaches gmail.search_emails by name on Claude and on an ACP engine alike", + "owner": "Yabuku-xD", + "reason": "Failed in CI of main (run 46615872847) and PR #478 (run 46623629685) on Dec 1; passes locally on dev.", + "since": "2026-12-01" + }, + { + "file": "server/direct-coordination.e2e.test.ts", + "test": "runs the owed direct follow-up while the same bot works in another thread", + "owner": "Yabuku-xD", + "reason": "Failed in CI of PR #478 (run 46623629685) and of fix-app-trigger-restore-enabled (run 46370208019); passed 3 of 3 local runs.", + "since": "2026-12-01" + }, + { + "file": "server/index.test.ts", + "test": "harness HTTP API > reports a failed routine once, not twice", + "owner": "Yabuku-xD", + "reason": "Failed in CI of PRs #480 (run 46636190164) and #481 (run 46636209589) on Dec 1, at about 10.7 s; passes locally on dev.", + "since": "2026-12-01" + }, + { + "file": "server/setup-connect-card.e2e.test.ts", + "test": "/setup connects an app through a Connect card, against the real server > names the switch, and mounts nothing to call, when the bot's connected apps are off", + "owner": "Yabuku-xD", + "reason": "Failed in CI of PR #479 (run 46636167463) on Dec 1; passes locally on dev, twice.", + "since": "2026-12-01" + }, + { + "file": "server/host-lazy-claim.e2e.test.ts", + "test": "lazy host claim and pin on use (issue #1650) > a No is an answer, not a failure: the screen stays untouched and the bot is told to finish another way", + "owner": "Yabuku-xD", + "reason": "Failed in CI of PR #482 (run 46636235332, windows shard 5/8, 'Fixture wait expired') on Dec 1; that PR changes only electron/main.mjs.", + "since": "2026-12-01" + }, + { + "file": "server/copilot-engine.e2e.test.ts", + "test": "creates and updates a routine through Copilot's launcher-owned tools", + "owner": "Yabuku-xD", + "reason": "Failed in CI of main (run 46615872847) on Dec 1.", + "since": "2026-12-01" + }, + { + "file": "server/usage-trace/recorder.test.ts", + "test": "trace recorder > records 2,000 tool calls in one turn without holding up the event loop", + "owner": "Yabuku-xD", + "reason": "Failed in CI of PR #479 (run 46726301408, ubuntu shard 7/8) on Dec 1 at 53 ms against its 50 ms bound; that PR changes only src/lib/live-events.ts.", + "since": "2026-12-01" + }, + { + "file": "server/teammate-follow-ups.e2e.test.ts", + "test": "F4 keeps a second assignment Clive hands Mira in the same turn its own job, though the first is already running", + "owner": "Yabuku-xD", + "reason": "Failed in CI of PR #479 (run 46726301408, ubuntu shard 7/8) on Dec 1 ('the first was running when the second was sent'); that PR changes only src/lib/live-events.ts.", + "since": "2026-12-01" } ] } From 6997440a0e1a9d056079a3f72a9b934ea712734c Mon Sep 17 00:00:00 2001 From: Yabuku-xD <78594762+Yabuku-xD@users.noreply.github.com> Date: Tue, 1 Dec 2026 13:50:37 -0800 Subject: [PATCH 4/7] link chaos: the run ends once its results are written, and the storm's 60 servers link from their own addresses Every link chaos run since the per-address limit on new links (adc99d770, Nov 14) was cancelled at CI's 60-minute limit, on main pushes, the weekly run and every PR that touches the link service: the scenarios finished in about five minutes and printed their table, but a socket or timer a scenario left open held the process. The run now exits once its results are written. The storm's 60 servers set up their links over one connection, so the node's front gave them one address, which the limit refused after 30 (Too many new links from here); each now uses its own connection, as 60 machines would. Locally, --quick passes all 12 scenarios and exits in 5.6 minutes. (cherry picked from commit 83ab615c36ac0c5452b417071d977ad702fdf35b) --- apps/link-service/chaos/run.mjs | 3 ++- apps/link-service/chaos/scenarios.mjs | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/apps/link-service/chaos/run.mjs b/apps/link-service/chaos/run.mjs index 08e9a00082..f4e235fc99 100644 --- a/apps/link-service/chaos/run.mjs +++ b/apps/link-service/chaos/run.mjs @@ -336,5 +336,6 @@ if (!process.env.DUSK_CHAOS_DIR) { } else { process.env.DUSK_CHAOS_PARENT = String(process.pid); for (const signal of ["SIGINT", "SIGTERM"]) process.on(signal, () => process.exit(130)); - main().catch((error) => { console.error(error); process.exit(2); }); + // the results are written by then; a socket or timer some scenario left open would otherwise hold the run until CI's job limit + main().then(() => process.exit(process.exitCode ?? 0), (error) => { console.error(error); process.exit(2); }); } diff --git a/apps/link-service/chaos/scenarios.mjs b/apps/link-service/chaos/scenarios.mjs index bf64921b90..db2f680e87 100644 --- a/apps/link-service/chaos/scenarios.mjs +++ b/apps/link-service/chaos/scenarios.mjs @@ -3,6 +3,7 @@ import { createHash } from "node:crypto"; import { chmodSync } from "node:fs"; import { join } from "node:path"; +import { Agent, fetch as undiciFetch } from "undici"; import { createTunnelAgent } from "../agent.mjs"; import { createRelayClient, createTunnelProxy, newLinkKeys, seal, sha256hex, vpsTokenOf } from "../../../electron/vps-link-protocol.mjs"; @@ -27,17 +28,22 @@ async function failover(world, { kill = true } = {}) { return { pass: moved !== home && moved !== null, note: `moved ${home} -> ${moved} in ${Math.round((workedAt - started) / 1000)} s`, clearedAt: started }; } -/** `count` more servers and apps on the default node, in this process: the agent's and the app's relay code each */ +/** `count` more servers and apps on the default node, in this process: the agent's and the app's relay code each. Each + * sets up its link over its own connection, so the node's front gives it its own address, as `count` machines would have: + * on one connection they would be one address, over the node's limit on new links an address may make in a minute. */ async function crowd(world, count) { - const base = world.url("contabo"), relay = createRelayClient({ base }), out = []; + const base = world.url("contabo"), out = []; for (let i = 0; i < count; i += 1) { + const own = new Agent(); + const ownFetch = (url, init) => undiciFetch(url, { ...init, dispatcher: own }); const keys = newLinkKeys(); - const made = await relay.create({ verifier: keys.verifier, appPub: keys.pub }); + const made = await createRelayClient({ base, fetch: ownFetch }).create({ verifier: keys.verifier, appPub: keys.pub }); const vps = vpsTokenOf(keys.secret); - const post = (path, body) => fetch(`${base}/v1/sessions/${made.id}/${path}`, { method: "POST", headers: { authorization: `Bearer ${vps}`, "content-type": "application/json" }, body: JSON.stringify(body) }); + const post = (path, body) => ownFetch(`${base}/v1/sessions/${made.id}/${path}`, { method: "POST", headers: { authorization: `Bearer ${vps}`, "content-type": "application/json" }, body: JSON.stringify(body) }); await post("claim", {}); const tunnel = { key: randomBytes(32).toString("base64url"), vps: randomBytes(32).toString("base64url"), app: randomBytes(32).toString("base64url") }; const done = await post("result", { sealed: seal(Buffer.alloc(32), made.id, Buffer.from("{}")), vpsPub: keys.pub, tunnel: { vps: sha256hex(tunnel.vps), app: sha256hex(tunnel.app) } }); + await own.close(); if (!done.ok) throw new Error(`crowd link ${i} answered ${done.status}`); const agent = createTunnelAgent({ base, id: made.id, key: tunnel.key, token: tunnel.vps, server: { host: "127.0.0.1", port: world.bot.port }, log: () => {} }); const running = agent.run(); From d6d2203967c6530fd66025c00f3c3607df3bbdb5 Mon Sep 17 00:00:00 2001 From: Yabuku-xD <78594762+Yabuku-xD@users.noreply.github.com> Date: Tue, 1 Dec 2026 13:50:37 -0800 Subject: [PATCH 5/7] ci: three more tests that failed at random in Dec 1's CI get the flaky list's retries chat-mcp-tools' shutdown verdict, memory-order and the encrypted workspace restore failed in PR #479's run 46740020170, whose change does not reach them, and pass locally. (cherry picked from commit c47197f8d57186c25b8e8b9682681bdd48248486) --- scripts/testing/ci-retry-list.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/scripts/testing/ci-retry-list.json b/scripts/testing/ci-retry-list.json index 3498b1c38a..90b819f616 100644 --- a/scripts/testing/ci-retry-list.json +++ b/scripts/testing/ci-retry-list.json @@ -175,6 +175,27 @@ "owner": "Yabuku-xD", "reason": "Failed in CI of PR #479 (run 46726301408, ubuntu shard 7/8) on Dec 1 ('the first was running when the second was sent'); that PR changes only src/lib/live-events.ts.", "since": "2026-12-01" + }, + { + "file": "server/drivers/chat-mcp-tools.test.ts", + "test": "Chat MCP shutdown verdict > an unconfirmed shutdown still fails close when a call was in flight", + "owner": "Yabuku-xD", + "reason": "Failed in CI of PR #479 (run 46740020170, ubuntu shard 3/8) on Dec 1 ('Unexpected end of JSON input'); that PR changes only src/lib/live-events.ts. Passes locally.", + "since": "2026-12-01" + }, + { + "file": "server/memory-order.e2e.test.ts", + "test": "starts the person's own line ahead of a hand-off that was already waiting for memory, and the hand-off right after", + "owner": "Yabuku-xD", + "reason": "Failed in CI of PR #479 (run 46740020170, ubuntu shard 5/8) on Dec 1; that PR changes only src/lib/live-events.ts. Passes locally.", + "since": "2026-12-01" + }, + { + "file": "server/workspace-backup-workflow.test.ts", + "test": "restores an encrypted workspace through the real server and continues its original chat", + "owner": "Yabuku-xD", + "reason": "Failed in CI of PR #479 (run 46740020170, windows shard 5/8) on Dec 1; that PR changes only src/lib/live-events.ts. Passes locally.", + "since": "2026-12-01" } ] } From 6bcb0855bd9e9ed384525c0d92781cebe5957137 Mon Sep 17 00:00:00 2001 From: Yabuku-xD <78594762+Yabuku-xD@users.noreply.github.com> Date: Tue, 1 Dec 2026 18:08:10 -0800 Subject: [PATCH 6/7] link chaos: the crowd's own connections use node:https, since the chaos job installs no packages The job runs `node apps/link-service/chaos/run.mjs` straight after checkout, so the undici import failed with ERR_MODULE_NOT_FOUND before any scenario ran. --- apps/link-service/chaos/scenarios.mjs | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/apps/link-service/chaos/scenarios.mjs b/apps/link-service/chaos/scenarios.mjs index db2f680e87..4d70cf6fa9 100644 --- a/apps/link-service/chaos/scenarios.mjs +++ b/apps/link-service/chaos/scenarios.mjs @@ -2,8 +2,8 @@ // things route around it) and answers { clearedAt, pass, note, sees }. run.mjs measures the rest. import { createHash } from "node:crypto"; import { chmodSync } from "node:fs"; +import { Agent as HttpsAgent, request as httpsRequest } from "node:https"; import { join } from "node:path"; -import { Agent, fetch as undiciFetch } from "undici"; import { createTunnelAgent } from "../agent.mjs"; import { createRelayClient, createTunnelProxy, newLinkKeys, seal, sha256hex, vpsTokenOf } from "../../../electron/vps-link-protocol.mjs"; @@ -28,14 +28,35 @@ async function failover(world, { kill = true } = {}) { return { pass: moved !== home && moved !== null, note: `moved ${home} -> ${moved} in ${Math.round((workedAt - started) / 1000)} s`, clearedAt: started }; } +/** a fetch that keeps to one connection of its own. Node's built-in fetch shares one pool for the whole process, and the + * chaos workflow runs without installing packages, so this uses node:https. `close()` ends the connection. */ +function fetchOverOwnConnection() { + const agent = new HttpsAgent({ keepAlive: true, maxSockets: 1 }); + const ownFetch = (url, { method = "GET", headers = {}, body, signal } = {}) => new Promise((resolve, reject) => { + const request = httpsRequest(url, { method, headers, agent, signal }, (answer) => { + const chunks = []; + answer.on("data", (chunk) => chunks.push(chunk)); + answer.on("error", reject); + answer.on("end", () => { + const noBody = [204, 205, 304].includes(answer.statusCode); + const answerHeaders = Object.entries(answer.headers).flatMap(([name, value]) => (Array.isArray(value) ? value.map((one) => [name, one]) : [[name, value]])); + resolve(new Response(noBody ? null : Buffer.concat(chunks), { status: answer.statusCode, headers: answerHeaders })); + }); + }); + request.on("error", reject); + request.end(body); + }); + return { fetch: ownFetch, close: () => agent.destroy() }; +} + /** `count` more servers and apps on the default node, in this process: the agent's and the app's relay code each. Each * sets up its link over its own connection, so the node's front gives it its own address, as `count` machines would have: * on one connection they would be one address, over the node's limit on new links an address may make in a minute. */ async function crowd(world, count) { const base = world.url("contabo"), out = []; for (let i = 0; i < count; i += 1) { - const own = new Agent(); - const ownFetch = (url, init) => undiciFetch(url, { ...init, dispatcher: own }); + const own = fetchOverOwnConnection(); + const ownFetch = own.fetch; const keys = newLinkKeys(); const made = await createRelayClient({ base, fetch: ownFetch }).create({ verifier: keys.verifier, appPub: keys.pub }); const vps = vpsTokenOf(keys.secret); From b4a020f32d9e6bc7db59b7af2e922160e673bd76 Mon Sep 17 00:00:00 2001 From: Yabuku-xD <78594762+Yabuku-xD@users.noreply.github.com> Date: Tue, 1 Dec 2026 22:26:57 -0800 Subject: [PATCH 7/7] link chaos: the probe dials its live stream again when a new dial sends nothing for 8 s, as the app does src/lib/live-events.ts gives up on a dial that sends nothing in LIVE_EVENTS_OPEN_MS (8 s) and dials again. The probe dropped a quiet stream only after it had sent something, so one silent dial after node-5xx's 502s held it down until the relay closed it, about 90 s, and failed the scenario in CI on five of seven runs. --- apps/link-service/chaos/run.mjs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/link-service/chaos/run.mjs b/apps/link-service/chaos/run.mjs index f4e235fc99..b9c6e09c15 100644 --- a/apps/link-service/chaos/run.mjs +++ b/apps/link-service/chaos/run.mjs @@ -136,7 +136,7 @@ async function bringUp() { */ function createProbe(world) { const pings = [], gaps = []; - let live = null, lastEventAt = 0, stopped = false, timer = null, inFlight = 0, liveReq = null; + let live = null, lastEventAt = 0, openedAt = 0, stopped = false, timer = null, inFlight = 0, liveReq = null; const port = () => Number(new URL(world.app.origin()).port); const host = () => world.app.host(); function call(path, { method = "GET", body = null, timeoutMs = 8000, port: at = port(), host: name = host() } = {}) { @@ -180,6 +180,7 @@ function createProbe(world) { res.on("close", () => closed("closed")); }); liveReq = req; + openedAt = Date.now(); let done = false; function closed() { if (done) return; @@ -198,7 +199,10 @@ function createProbe(world) { const up = now - lastEventAt < 5000; if (!up && downSince === null) downSince = Math.max(lastEventAt, now - 5000); if (up && downSince !== null) { gaps.push({ from: downSince, to: now }); downSince = null; } - if (liveReq && now - lastEventAt > 20_000 && live) { liveReq.destroy(); } + // as the app does (src/lib/live-events.ts): a dial that sends nothing in LIVE_EVENTS_OPEN_MS (8 s) is dialled again, + // and a stream that went quiet after it sent something is dialled again after 20 s + const quietFor = now - Math.max(lastEventAt, openedAt); + if (liveReq && quietFor > (live ? 20_000 : 8_000)) { liveReq.destroy(); } }, 250); return { start() { timer = setInterval(tick, 500); openLive(); },