The best way to control Claude Code, Codex and more from any computer or phone
ci: startup and sidebar changes open the seeded thread before merge (#33146)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Theo Browne committed
Nov 8, 2026 at 19:49 UTC
357fb754fa9dae4111f0945fb8a13d30b012a62a
6 files changed
+80
-5
.github/actions/ci-changes/action.yml
+2
@@ -5,6 +5,8 @@ outputs:
5
value: ${{ steps.detect.outputs.typecheck }}
6
build:
7
value: ${{ steps.detect.outputs.build }}
8
+ desktop_launch:
9
+ value: ${{ steps.detect.outputs.desktop_launch }}
10
test:
11
value: ${{ steps.detect.outputs.test }}
12
test_packages:
.github/scripts/ci-changes.cjs
+22
-1
@@ -51,6 +51,21 @@ const BUILD_ONLY_DEPS = { t3: ["@t3tools/web"] };
51
const MOBILE_NATIVE =
52
/^apps\/mobile\/.*\.(swift|kt|kts)$|^apps\/mobile\/(\.swiftlint\.yml|detekt\.yml|\.editorconfig|Brewfile)$|^scripts\/mobile-native-static-check\.ts$|^package\.json$|^\.github\/workflows\/ci\.yml$|^\.github\/scripts\/ci-changes\.cjs$|^\.github\/actions\/ci-changes\//;
53
54
+// Startup, migration, settlement, and sidebar paths that decide whether an upgraded user's
55
+// threads show after launch. Build runs scripts/smoke-desktop-app.ts for them, so they do not
56
+// first fail in the release launch check.
57
+const DESKTOP_LAUNCH = [
58
+ /^apps\/desktop\/src\/((main|boot|compileCache|serverCompileCache)\.ts$|(app|backend|window)\/)/,
59
+ /^apps\/desktop\/src\/electron\/(ElectronApp|ElectronProtocol|ElectronWindow)\.ts$/,
60
+ /^apps\/web\/src\/((main|AppRoot|appInit)\.tsx|(bootstrap|router)\.ts)$/,
61
+ /^apps\/web\/src\/.*sidebar/i,
62
+ /^apps\/server\/src\/(bin|binMain|server|serverRuntimeStartup)\.ts$/,
63
+ /^apps\/server\/src\/persistence\/Migrations/,
64
+ /^apps\/server\/src\/orchestration-v2\/((ThreadSettlementService|ProjectionStore)\.ts$|legacy\/)/,
65
+ /^packages\/contracts\/src\/settings\.ts$/,
66
+ /^scripts\/(smoke-desktop-app\.ts|fixtures\/desktop-launch\/)/,
67
+];
68
+
69
const OWN_TEST_JOB = new Set(["t3", "@t3tools/web", "@t3tools/monorepo"]);
70
71
function readWorkspace() {
@@ -151,12 +166,18 @@ function decide(files, packages, full) {
166
(pkg) => pkg.hasTest && !OWN_TEST_JOB.has(pkg.name) && affected.has(pkg.name),
167
);
168
const has = (name) => affected.has(name);
169
+ const desktopLaunch =
170
+ everything ||
171
+ files.some(
172
+ (file) => !/\.test\.tsx?$/.test(file) && DESKTOP_LAUNCH.some((pattern) => pattern.test(file)),
173
+ );
174
175
return {
176
affected: [...affected].sort(),
177
outputs: {
178
typecheck: affected.size > 0,
159
- build: has("@t3tools/desktop") || has("t3") || has("@t3tools/web"),
179
+ build: has("@t3tools/desktop") || has("t3") || has("@t3tools/web") || desktopLaunch,
180
+ desktop_launch: desktopLaunch,
181
test: tested.length > 0,
182
// Empty means every package the Test job covers.
183
test_packages: everything ? "" : tested.map((pkg) => pkg.name).join(" "),
.github/scripts/ci-changes.d.cts
+1
@@ -16,6 +16,7 @@ export function decide(
16
outputs: {
17
typecheck: boolean;
18
build: boolean;
19
+ desktop_launch: boolean;
20
test: boolean;
21
test_packages: string;
22
test_web: boolean;
.github/workflows/ci.yml
+23
-2
@@ -27,6 +27,7 @@ jobs:
27
outputs:
28
typecheck: ${{ steps.detect.outputs.typecheck }}
29
build: ${{ steps.detect.outputs.build }}
30
+ desktop_launch: ${{ steps.detect.outputs.desktop_launch }}
31
test: ${{ steps.detect.outputs.test }}
32
test_packages: ${{ steps.detect.outputs.test_packages }}
33
test_web: ${{ steps.detect.outputs.test_web }}
@@ -135,13 +136,14 @@ jobs:
136
if: needs.changes.outputs.build != 'false'
137
138
# Runs in the background while Vite+ installs; the step before the build waits for it.
139
+ # Xvfb is for the desktop launch check below.
140
- name: Start installing browser secret helper build libraries
141
if: needs.changes.outputs.build != 'false'
142
run: |
143
sudo sed -i 's|http://|https://|g' /etc/apt/blacksmith-ubuntu-mirrors.txt /etc/apt/sources.list.d/ubuntu.sources
144
(
145
set +e
144
- sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config
146
+ sudo apt-get update && sudo apt-get install -y libsecret-1-dev pkg-config xvfb
147
echo "$?" > "$RUNNER_TEMP/apt-status"
148
) > "$RUNNER_TEMP/apt.log" 2>&1 < /dev/null &
149
@@ -192,6 +194,25 @@ jobs:
194
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
195
run: node apps/desktop/scripts/verify-preload-bundle.mjs
196
197
+ # The release launch check, run unpackaged against the same old-state fixture, for
198
+ # startup and sidebar changes. Packaging and signing stay release-only.
199
+ - name: Open the seeded thread in the built desktop app
200
+ id: desktop_launch
201
+ if: ${{ !cancelled() && steps.build.outcome == 'success' && needs.changes.outputs.desktop_launch != 'false' }}
202
+ timeout-minutes: 4
203
+ run: |
204
+ electron=$(node -p "require('./apps/desktop/node_modules/electron')")
205
+ xvfb-run -a node scripts/smoke-desktop-app.ts --executable "$electron" --app apps/desktop \
206
+ --artifacts-dir "$RUNNER_TEMP/desktop-launch-check"
207
+
208
+ - name: Upload desktop launch check
209
+ if: ${{ failure() && steps.desktop_launch.outcome == 'failure' }}
210
+ uses: actions/upload-artifact@v7
211
+ with:
212
+ name: desktop-launch-check
213
+ path: ${{ runner.temp }}/desktop-launch-check
214
+ if-no-files-found: ignore
215
+
216
# Browser tests run source modules; this boots the production chunk graph. The
217
# desktop build above already produced apps/web/dist, and the client waits about
218
# 15s for a session that never comes, so this runs here instead of in Test Web,
@@ -622,7 +643,7 @@ jobs:
643
# not needed. Gates are keyed by job name, except merged Build and the
644
# macOS lint.
645
echo "$RESULTS" | jq -e '.changes.outputs as $gates
625
- | {build: ["build", "typecheck"], mobile_native_static_analysis: ["mobile_native"]} as $renamed
646
+ | {build: ["build", "typecheck", "desktop_launch"], mobile_native_static_analysis: ["mobile_native"]} as $renamed
647
| all(to_entries[];
648
.value.result == "success"
649
or (.value.result == "skipped"
scripts/check-changed.test.ts
+26
@@ -198,6 +198,32 @@ describe("check:changed", () => {
198
});
199
});
200
201
+ it("opens the built desktop app only for startup, settlement, and sidebar changes", () => {
202
+ const packages = readWorkspace();
203
+ const launches = (file: string) => decide([file], packages, false).outputs.desktop_launch;
204
+ for (const file of [
205
+ "apps/server/src/orchestration-v2/ThreadSettlementService.ts",
206
+ "apps/server/src/persistence/Migrations/054_ProjectionThreadsAutoSettleDisabledAt.ts",
207
+ "apps/web/src/components/sidebar/SidebarThreadRow.tsx",
208
+ "apps/desktop/src/backend/DesktopBackendManager.ts",
209
+ "apps/desktop/src/electron/ElectronProtocol.ts",
210
+ "packages/contracts/src/settings.ts",
211
+ "scripts/fixtures/desktop-launch/statev2.sqlite",
212
+ ]) {
213
+ assert.isTrue(launches(file), file);
214
+ }
215
+ for (const file of [
216
+ "apps/server/src/orchestration-v2/ThreadSettlementService.test.ts",
217
+ "apps/web/src/components/chat/ChatView.tsx",
218
+ "apps/desktop/src/updates/DesktopRemoteUpdates.ts",
219
+ "packages/contracts/src/orchestration.ts",
220
+ ]) {
221
+ assert.isFalse(launches(file), file);
222
+ }
223
+ // A script-only change still builds the app it opens.
224
+ assert.isTrue(decide(["scripts/smoke-desktop-app.ts"], packages, false).outputs.build);
225
+ });
226
+
227
it.each([
228
"packages/shared/src/testing/longTempDir.ts",
229
"packages/shared/src/testing/providerEnv.ts",
scripts/smoke-desktop-app.ts
+6
-2
@@ -19,12 +19,16 @@ const STEP_TIMEOUT_MS = 60_000;
19
const { values } = NodeUtil.parseArgs({
20
options: {
21
executable: { type: "string" },
22
+ // An unpackaged app directory for a plain Electron executable, as PR CI runs it.
23
+ app: { type: "string" },
24
"artifacts-dir": { type: "string" },
25
},
26
});
27
const executable = values.executable;
28
if (!executable)
27
- throw new Error("Usage: smoke-desktop-app.ts --executable <app> [--artifacts-dir <dir>]");
29
+ throw new Error(
30
+ "Usage: smoke-desktop-app.ts --executable <app> [--app <dir>] [--artifacts-dir <dir>]",
31
+ );
32
const artifactsDir = NodePath.resolve(values["artifacts-dir"] ?? "desktop-launch-check");
33
34
const home = NodeFS.mkdtempSync(NodePath.join(NodeOS.tmpdir(), "t3-desktop-launch-"));
@@ -38,7 +42,7 @@ try {
42
app = await _electron.launch({
43
executablePath: executable,
44
// Linux CI runners do not allow the Chromium sandbox's user namespaces.
41
- args: ["--no-sandbox"],
45
+ args: [...(values.app ? [NodePath.resolve(values.app)] : []), "--no-sandbox"],
46
// HOME stays real: on macOS a fake HOME has no login keychain, and safeStorage blocks the
47
// main process on a keychain dialog. macOS keeps its Electron profile in the runner's HOME.
48
env: {