From f2c03373ac2e474ad368dd55687e85c4775f76ca Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 22 Oct 2026 19:14:56 +0000 Subject: [PATCH 1/8] test(desktop): bearer bootstrap survives a 30s unresponsive backend Regression for #23378: a backend that answers nothing for ~30s after launch makes getBearerToken give up at the 15s retry timeout instead of waiting for the backend to recover. Co-Authored-By: Claude Opus 5.5 --- .../DesktopLocalEnvironmentAuth.test.ts | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/apps/desktop/src/backend/DesktopLocalEnvironmentAuth.test.ts b/apps/desktop/src/backend/DesktopLocalEnvironmentAuth.test.ts index 348d3a7050f70..7c26a16768e93 100644 --- a/apps/desktop/src/backend/DesktopLocalEnvironmentAuth.test.ts +++ b/apps/desktop/src/backend/DesktopLocalEnvironmentAuth.test.ts @@ -1,4 +1,5 @@ import { assert, describe, it } from "@effect/vitest"; +import * as Deferred from "effect/Deferred"; import * as Duration from "effect/Duration"; import * as Effect from "effect/Effect"; import * as Fiber from "effect/Fiber"; @@ -217,4 +218,30 @@ describe("DesktopLocalEnvironmentAuth", () => { assert.strictEqual(yield* Ref.get(requestCount), 1); }).pipe(Effect.provide(TestClock.layer())), ); + it.effect("waits out a backend that stays unresponsive for 30 seconds after launch", () => + Effect.gen(function* () { + // A stopped backend accepts connections but answers nothing until resumed. + const resumed = yield* Deferred.make(); + const layerHttpClient = Layer.succeed( + HttpClient.HttpClient, + HttpClient.make((request) => + Deferred.await(resumed).pipe(Effect.as(tokenResponse(request))), + ), + ); + const auth = yield* DesktopLocalEnvironmentAuth.DesktopLocalEnvironmentAuth.pipe( + Effect.provide( + DesktopLocalEnvironmentAuth.layer.pipe( + Layer.provide(Layer.mergeAll(layerPool, layerHttpClient)), + ), + ), + ); + + const fiber = yield* auth.getBearerToken.pipe(Effect.forkChild); + yield* TestClock.adjust(Duration.seconds(30)); + yield* Deferred.succeed(resumed, undefined); + yield* TestClock.adjust(Duration.seconds(11)); + + assert.strictEqual(yield* Fiber.join(fiber), "desktop-bearer-token"); + }).pipe(Effect.provide(TestClock.layer())), + ); }); From c3dd6959fbe2a3392c685871f9ca2c2113845d0c Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 22 Oct 2026 19:17:52 +0000 Subject: [PATCH 2/8] fix(desktop): bearer bootstrap waits out a backend stalled ~30s after launch The transient retry budget was 15s, so a backend that accepted connections but answered nothing for ~30s after readiness made the bearer exchange fail with a fatal HTTP 500. Raise the overall budget to 60s; the 500ms retry interval, per-request timeout, and immediate failure on permanent errors are unchanged. Fixes #23378 Co-Authored-By: Claude Opus 5.5 --- apps/desktop/src/backend/DesktopLocalEnvironmentAuth.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/backend/DesktopLocalEnvironmentAuth.ts b/apps/desktop/src/backend/DesktopLocalEnvironmentAuth.ts index 4d95dd075cf3e..afedd21d73541 100644 --- a/apps/desktop/src/backend/DesktopLocalEnvironmentAuth.ts +++ b/apps/desktop/src/backend/DesktopLocalEnvironmentAuth.ts @@ -16,7 +16,8 @@ import * as HttpClient from "effect/http/HttpClient"; import * as DesktopBackendPool from "./DesktopBackendPool.ts"; -const BOOTSTRAP_TRANSIENT_RETRY_TIMEOUT = Duration.seconds(15); +// A backend can stay unresponsive for ~30s after reporting ready (#23378). +const BOOTSTRAP_TRANSIENT_RETRY_TIMEOUT = Duration.seconds(60); const BOOTSTRAP_TRANSIENT_RETRY_INTERVAL = Duration.millis(500); const TRANSIENT_BOOTSTRAP_STATUS_CODES = new Set([502, 503, 504]); From e38f845adbb6399e28436ce1c62cc1568f81c9f6 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 22 Oct 2026 19:28:56 +0000 Subject: [PATCH 3/8] test(desktop): add isolated startup recovery evidence fixture --- scripts/issue-23378/seed-evidence.py | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 scripts/issue-23378/seed-evidence.py diff --git a/scripts/issue-23378/seed-evidence.py b/scripts/issue-23378/seed-evidence.py new file mode 100644 index 0000000000000..d72cb14f2d91f --- /dev/null +++ b/scripts/issue-23378/seed-evidence.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python3 +"""Reset an OFFLINE, isolated dev database to public issue-23378 proof data. + +Run dev:desktop --no-seed once to initialize migrations, stop it, then run: + python3 scripts/issue-23378/seed-evidence.py /absolute/evidence-home +Never pass the live T3 home. This fixture uses real local authentication. +""" +import json +import pathlib +import sqlite3 +import sys + +home = pathlib.Path(sys.argv[1]).resolve() +if home == pathlib.Path.home() / '.t3' or 'evidence' not in str(home): + raise SystemExit('Expected an isolated evidence home, never the live install') +db = home / 'userdata/statev2.sqlite' +if not db.is_file(): + raise SystemExit('Initialize the isolated dev database first') +connection = sqlite3.connect(db) +connection.execute('PRAGMA foreign_keys=OFF') +for (table,) in connection.execute("SELECT name FROM sqlite_master WHERE type='table'").fetchall(): + if table not in ('effect_sql_migrations', 'sqlite_sequence'): + connection.execute('DELETE FROM "' + table.replace('"', '""') + '"') +now = '2026-10-22T12:00:00.000Z' +workspace = pathlib.Path('/tmp/issue-23378-evidence/demo-project') +workspace.mkdir(parents=True, exist_ok=True) +(workspace / 'README.md').write_text('# Launch recovery demo\n\nSynthetic public fixture. No provider is started.\n') +connection.execute('INSERT INTO projection_projects (project_id,title,workspace_root,scripts_json,created_at,updated_at) VALUES (?,?,?,?,?,?)', ('proof-project', 'Launch recovery demo', str(workspace), '[]', now, now)) +thread = dict(createdBy='user', creationSource='web', id='proof-thread', projectId='proof-project', title='Verify desktop startup recovery', providerInstanceId='codex', modelSelection=dict(instanceId='codex', model='gpt-5.4'), runtimeMode='full-access', interactionMode='default', branch=None, worktreePath=None, pullRequests=[], activeProviderThreadId=None, lineage=dict(parentThreadId=None, relationshipToParent=None, rootThreadId='proof-thread'), forkedFrom=None, createdAt=now, updatedAt=now, archivedAt=None, settledOverride=None, settledAt=None, snoozedUntil=None, snoozedAt=None, lastVisitedAt=now, deletedAt=None) +connection.execute('INSERT INTO orchestration_v2_projection_threads (thread_id,project_id,title,default_provider,runtime_mode,interaction_mode,created_at,updated_at,payload_json,provider_instance_id) VALUES (?,?,?,?,?,?,?,?,?,?)', ('proof-thread','proof-project',thread['title'],'codex','full-access','default',now,now,json.dumps(thread),'codex')) +connection.commit() +connection.execute('VACUUM') +connection.close() +(home / 'userdata/client-settings.json').write_text(json.dumps({'onboardingCompletedAt': now, 'notificationMode': 'off', 'inAppNotificationsEnabled': False, 'panelAnimationDurationMs': 0})) +(home / 'userdata/desktop-settings.json').write_text(json.dumps({'mainWindowBounds': {'x': 0, 'y': 0, 'width': 1920, 'height': 1080}})) +(home / 'userdata/environment-id').write_text('23378000-0000-4000-8000-000000000001') +(home / 'userdata/anonymous-id').write_text('23378000-0000-4000-8000-000000000002') +print('Seeded one synthetic project and one stopped thread:', db) From 0f12ba695a2ac4e497a381b60b5d092edf19a0c6 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 22 Oct 2026 20:05:09 +0000 Subject: [PATCH 4/8] test(desktop): evidence seed refuses unmarked homes and symlink escapes The seed script now requires an ISSUE_23378_DISPOSABLE_FIXTURE marker in a user-owned evidence home before opening its database, refuses symlinked or world-writable userdata, database, sidecar, and settings paths, and creates its demo workspace with mkdtemp inside the evidence home instead of a fixed /tmp path. Co-Authored-By: Claude Opus 5.5 --- scripts/issue-23378/seed-evidence.py | 62 ++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 12 deletions(-) diff --git a/scripts/issue-23378/seed-evidence.py b/scripts/issue-23378/seed-evidence.py index d72cb14f2d91f..ea40e9a5c1020 100644 --- a/scripts/issue-23378/seed-evidence.py +++ b/scripts/issue-23378/seed-evidence.py @@ -1,29 +1,67 @@ #!/usr/bin/env python3 """Reset an OFFLINE, isolated dev database to public issue-23378 proof data. -Run dev:desktop --no-seed once to initialize migrations, stop it, then run: +The evidence home must be a private directory you own that holds a marker file +declaring it disposable. Every table in its database is deleted. + mkdir -m 700 /absolute/evidence-home + touch /absolute/evidence-home/ISSUE_23378_DISPOSABLE_FIXTURE +Run dev:desktop --home-dir /absolute/evidence-home --no-seed once to initialize +migrations, stop it, then run: python3 scripts/issue-23378/seed-evidence.py /absolute/evidence-home Never pass the live T3 home. This fixture uses real local authentication. """ import json +import os import pathlib import sqlite3 +import stat import sys +import tempfile -home = pathlib.Path(sys.argv[1]).resolve() -if home == pathlib.Path.home() / '.t3' or 'evidence' not in str(home): +MARKER = 'ISSUE_23378_DISPOSABLE_FIXTURE' + + +def private_entry(path, kind): + # lstat so a planted symlink is refused instead of followed. + info = os.lstat(path) + if not kind(info.st_mode) or info.st_uid != os.getuid() or info.st_mode & 0o002: + raise SystemExit(f'Refusing {path}: expected your own non-symlink entry, not world writable') + + +if len(sys.argv) != 2: + raise SystemExit(__doc__) +home = pathlib.Path(sys.argv[1]).resolve(strict=True) +live = (pathlib.Path.home() / '.t3').resolve() +if home == live or live.is_relative_to(home) or home.is_relative_to(live): raise SystemExit('Expected an isolated evidence home, never the live install') -db = home / 'userdata/statev2.sqlite' -if not db.is_file(): +private_entry(home, stat.S_ISDIR) +if not (home / MARKER).exists(): + raise SystemExit(f'Refusing {home}: create {home / MARKER} to mark it as a disposable fixture') +private_entry(home / MARKER, stat.S_ISREG) +userdata = home / 'userdata' +db = userdata / 'statev2.sqlite' +if not db.exists(): raise SystemExit('Initialize the isolated dev database first') -connection = sqlite3.connect(db) +private_entry(userdata, stat.S_ISDIR) +private_entry(db, stat.S_ISREG) +for sidecar in ('-wal', '-shm', '-journal'): + if os.path.lexists(f'{db}{sidecar}'): + private_entry(f'{db}{sidecar}', stat.S_ISREG) + + +def write_private(name, text): + fd = os.open(userdata / name, os.O_WRONLY | os.O_CREAT | os.O_TRUNC | os.O_NOFOLLOW, 0o600) + with os.fdopen(fd, 'w') as file: + file.write(text) + + +connection = sqlite3.connect(db.as_uri() + '?mode=rw', uri=True) connection.execute('PRAGMA foreign_keys=OFF') for (table,) in connection.execute("SELECT name FROM sqlite_master WHERE type='table'").fetchall(): if table not in ('effect_sql_migrations', 'sqlite_sequence'): connection.execute('DELETE FROM "' + table.replace('"', '""') + '"') now = '2026-10-22T12:00:00.000Z' -workspace = pathlib.Path('/tmp/issue-23378-evidence/demo-project') -workspace.mkdir(parents=True, exist_ok=True) +workspace = pathlib.Path(tempfile.mkdtemp(prefix='demo-project-', dir=home)) (workspace / 'README.md').write_text('# Launch recovery demo\n\nSynthetic public fixture. No provider is started.\n') connection.execute('INSERT INTO projection_projects (project_id,title,workspace_root,scripts_json,created_at,updated_at) VALUES (?,?,?,?,?,?)', ('proof-project', 'Launch recovery demo', str(workspace), '[]', now, now)) thread = dict(createdBy='user', creationSource='web', id='proof-thread', projectId='proof-project', title='Verify desktop startup recovery', providerInstanceId='codex', modelSelection=dict(instanceId='codex', model='gpt-5.4'), runtimeMode='full-access', interactionMode='default', branch=None, worktreePath=None, pullRequests=[], activeProviderThreadId=None, lineage=dict(parentThreadId=None, relationshipToParent=None, rootThreadId='proof-thread'), forkedFrom=None, createdAt=now, updatedAt=now, archivedAt=None, settledOverride=None, settledAt=None, snoozedUntil=None, snoozedAt=None, lastVisitedAt=now, deletedAt=None) @@ -31,8 +69,8 @@ connection.commit() connection.execute('VACUUM') connection.close() -(home / 'userdata/client-settings.json').write_text(json.dumps({'onboardingCompletedAt': now, 'notificationMode': 'off', 'inAppNotificationsEnabled': False, 'panelAnimationDurationMs': 0})) -(home / 'userdata/desktop-settings.json').write_text(json.dumps({'mainWindowBounds': {'x': 0, 'y': 0, 'width': 1920, 'height': 1080}})) -(home / 'userdata/environment-id').write_text('23378000-0000-4000-8000-000000000001') -(home / 'userdata/anonymous-id').write_text('23378000-0000-4000-8000-000000000002') +write_private('client-settings.json', json.dumps({'onboardingCompletedAt': now, 'notificationMode': 'off', 'inAppNotificationsEnabled': False, 'panelAnimationDurationMs': 0})) +write_private('desktop-settings.json', json.dumps({'mainWindowBounds': {'x': 0, 'y': 0, 'width': 1920, 'height': 1080}})) +write_private('environment-id', '23378000-0000-4000-8000-000000000001') +write_private('anonymous-id', '23378000-0000-4000-8000-000000000002') print('Seeded one synthetic project and one stopped thread:', db) From 6fd3a70a42499579d663919b66c025f4e9848b58 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 22 Oct 2026 20:20:10 +0000 Subject: [PATCH 5/8] test(desktop): evidence seed refuses group-writable fixture entries A group member could replace a checked userdata entry between lstat and the sqlite open, so the seed guard refuses group as well as world write (0o022). The usage now creates the evidence home, marker, and dev database under umask 077 instead of weakening the guard for umask 002 hosts. Co-Authored-By: Claude Opus 5.5 --- scripts/issue-23378/seed-evidence.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/issue-23378/seed-evidence.py b/scripts/issue-23378/seed-evidence.py index ea40e9a5c1020..628e5f2e07f90 100644 --- a/scripts/issue-23378/seed-evidence.py +++ b/scripts/issue-23378/seed-evidence.py @@ -3,10 +3,10 @@ The evidence home must be a private directory you own that holds a marker file declaring it disposable. Every table in its database is deleted. - mkdir -m 700 /absolute/evidence-home - touch /absolute/evidence-home/ISSUE_23378_DISPOSABLE_FIXTURE -Run dev:desktop --home-dir /absolute/evidence-home --no-seed once to initialize -migrations, stop it, then run: + (umask 077; mkdir /absolute/evidence-home + touch /absolute/evidence-home/ISSUE_23378_DISPOSABLE_FIXTURE) +Run (umask 077; vp run dev:desktop --home-dir /absolute/evidence-home --no-seed) +once to initialize migrations, stop it, then run: python3 scripts/issue-23378/seed-evidence.py /absolute/evidence-home Never pass the live T3 home. This fixture uses real local authentication. """ @@ -22,10 +22,11 @@ def private_entry(path, kind): - # lstat so a planted symlink is refused instead of followed. + # lstat so a planted symlink is refused instead of followed. Group write is + # refused too: a group member could swap a checked entry before it is opened. info = os.lstat(path) - if not kind(info.st_mode) or info.st_uid != os.getuid() or info.st_mode & 0o002: - raise SystemExit(f'Refusing {path}: expected your own non-symlink entry, not world writable') + if not kind(info.st_mode) or info.st_uid != os.getuid() or info.st_mode & 0o022: + raise SystemExit(f'Refusing {path}: expected your own non-symlink entry, not group or world writable') if len(sys.argv) != 2: From 240583ed9fc7fbcded6fa5fcddee1fe96b40cff6 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Wed, 11 Nov 2026 01:20:21 +0000 Subject: [PATCH 6/8] test(desktop): drop the evidence seeder and provide Mac to the stall test AI-assisted; verified with the tests and tools listed above. --- .../DesktopLocalEnvironmentAuth.test.ts | 3 +- scripts/issue-23378/seed-evidence.py | 77 ------------------- 2 files changed, 2 insertions(+), 78 deletions(-) delete mode 100644 scripts/issue-23378/seed-evidence.py diff --git a/apps/desktop/src/backend/DesktopLocalEnvironmentAuth.test.ts b/apps/desktop/src/backend/DesktopLocalEnvironmentAuth.test.ts index 5d852aba90a41..76f113ec703f0 100644 --- a/apps/desktop/src/backend/DesktopLocalEnvironmentAuth.test.ts +++ b/apps/desktop/src/backend/DesktopLocalEnvironmentAuth.test.ts @@ -238,6 +238,7 @@ describe("DesktopLocalEnvironmentAuth", () => { assert.strictEqual(yield* Ref.get(requestCount), 1); }).pipe(Effect.provide(TestClock.layer())), ); + it.effect("waits out a backend that stays unresponsive for 30 seconds after launch", () => Effect.gen(function* () { // A stopped backend accepts connections but answers nothing until resumed. @@ -251,7 +252,7 @@ describe("DesktopLocalEnvironmentAuth", () => { const auth = yield* DesktopLocalEnvironmentAuth.DesktopLocalEnvironmentAuth.pipe( Effect.provide( DesktopLocalEnvironmentAuth.layer.pipe( - Layer.provide(Layer.mergeAll(layerPool, layerHttpClient)), + Layer.provide(Layer.mergeAll(layerPool, layerHttpClient, NodeCrypto.layerMac)), ), ), ); diff --git a/scripts/issue-23378/seed-evidence.py b/scripts/issue-23378/seed-evidence.py deleted file mode 100644 index 628e5f2e07f90..0000000000000 --- a/scripts/issue-23378/seed-evidence.py +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env python3 -"""Reset an OFFLINE, isolated dev database to public issue-23378 proof data. - -The evidence home must be a private directory you own that holds a marker file -declaring it disposable. Every table in its database is deleted. - (umask 077; mkdir /absolute/evidence-home - touch /absolute/evidence-home/ISSUE_23378_DISPOSABLE_FIXTURE) -Run (umask 077; vp run dev:desktop --home-dir /absolute/evidence-home --no-seed) -once to initialize migrations, stop it, then run: - python3 scripts/issue-23378/seed-evidence.py /absolute/evidence-home -Never pass the live T3 home. This fixture uses real local authentication. -""" -import json -import os -import pathlib -import sqlite3 -import stat -import sys -import tempfile - -MARKER = 'ISSUE_23378_DISPOSABLE_FIXTURE' - - -def private_entry(path, kind): - # lstat so a planted symlink is refused instead of followed. Group write is - # refused too: a group member could swap a checked entry before it is opened. - info = os.lstat(path) - if not kind(info.st_mode) or info.st_uid != os.getuid() or info.st_mode & 0o022: - raise SystemExit(f'Refusing {path}: expected your own non-symlink entry, not group or world writable') - - -if len(sys.argv) != 2: - raise SystemExit(__doc__) -home = pathlib.Path(sys.argv[1]).resolve(strict=True) -live = (pathlib.Path.home() / '.t3').resolve() -if home == live or live.is_relative_to(home) or home.is_relative_to(live): - raise SystemExit('Expected an isolated evidence home, never the live install') -private_entry(home, stat.S_ISDIR) -if not (home / MARKER).exists(): - raise SystemExit(f'Refusing {home}: create {home / MARKER} to mark it as a disposable fixture') -private_entry(home / MARKER, stat.S_ISREG) -userdata = home / 'userdata' -db = userdata / 'statev2.sqlite' -if not db.exists(): - raise SystemExit('Initialize the isolated dev database first') -private_entry(userdata, stat.S_ISDIR) -private_entry(db, stat.S_ISREG) -for sidecar in ('-wal', '-shm', '-journal'): - if os.path.lexists(f'{db}{sidecar}'): - private_entry(f'{db}{sidecar}', stat.S_ISREG) - - -def write_private(name, text): - fd = os.open(userdata / name, os.O_WRONLY | os.O_CREAT | os.O_TRUNC | os.O_NOFOLLOW, 0o600) - with os.fdopen(fd, 'w') as file: - file.write(text) - - -connection = sqlite3.connect(db.as_uri() + '?mode=rw', uri=True) -connection.execute('PRAGMA foreign_keys=OFF') -for (table,) in connection.execute("SELECT name FROM sqlite_master WHERE type='table'").fetchall(): - if table not in ('effect_sql_migrations', 'sqlite_sequence'): - connection.execute('DELETE FROM "' + table.replace('"', '""') + '"') -now = '2026-10-22T12:00:00.000Z' -workspace = pathlib.Path(tempfile.mkdtemp(prefix='demo-project-', dir=home)) -(workspace / 'README.md').write_text('# Launch recovery demo\n\nSynthetic public fixture. No provider is started.\n') -connection.execute('INSERT INTO projection_projects (project_id,title,workspace_root,scripts_json,created_at,updated_at) VALUES (?,?,?,?,?,?)', ('proof-project', 'Launch recovery demo', str(workspace), '[]', now, now)) -thread = dict(createdBy='user', creationSource='web', id='proof-thread', projectId='proof-project', title='Verify desktop startup recovery', providerInstanceId='codex', modelSelection=dict(instanceId='codex', model='gpt-5.4'), runtimeMode='full-access', interactionMode='default', branch=None, worktreePath=None, pullRequests=[], activeProviderThreadId=None, lineage=dict(parentThreadId=None, relationshipToParent=None, rootThreadId='proof-thread'), forkedFrom=None, createdAt=now, updatedAt=now, archivedAt=None, settledOverride=None, settledAt=None, snoozedUntil=None, snoozedAt=None, lastVisitedAt=now, deletedAt=None) -connection.execute('INSERT INTO orchestration_v2_projection_threads (thread_id,project_id,title,default_provider,runtime_mode,interaction_mode,created_at,updated_at,payload_json,provider_instance_id) VALUES (?,?,?,?,?,?,?,?,?,?)', ('proof-thread','proof-project',thread['title'],'codex','full-access','default',now,now,json.dumps(thread),'codex')) -connection.commit() -connection.execute('VACUUM') -connection.close() -write_private('client-settings.json', json.dumps({'onboardingCompletedAt': now, 'notificationMode': 'off', 'inAppNotificationsEnabled': False, 'panelAnimationDurationMs': 0})) -write_private('desktop-settings.json', json.dumps({'mainWindowBounds': {'x': 0, 'y': 0, 'width': 1920, 'height': 1080}})) -write_private('environment-id', '23378000-0000-4000-8000-000000000001') -write_private('anonymous-id', '23378000-0000-4000-8000-000000000002') -print('Seeded one synthetic project and one stopped thread:', db) From 2d65904ba16e331139405f2027b8f774170b8edb Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Wed, 11 Nov 2026 01:21:05 +0000 Subject: [PATCH 7/8] fix(desktop): drop the issue number from the retry timeout comment AI-assisted; verified with the tests and tools listed above. --- apps/desktop/src/backend/DesktopLocalEnvironmentAuth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/desktop/src/backend/DesktopLocalEnvironmentAuth.ts b/apps/desktop/src/backend/DesktopLocalEnvironmentAuth.ts index 6c07fae13338e..3b5013275f8a9 100644 --- a/apps/desktop/src/backend/DesktopLocalEnvironmentAuth.ts +++ b/apps/desktop/src/backend/DesktopLocalEnvironmentAuth.ts @@ -17,7 +17,7 @@ import * as HttpClient from "effect/http/HttpClient"; import * as DesktopBackendPool from "./DesktopBackendPool.ts"; -// A backend can stay unresponsive for ~30s after reporting ready (#23378). +// A backend can stay unresponsive for ~30s after reporting ready. const BOOTSTRAP_TRANSIENT_RETRY_TIMEOUT = Duration.seconds(60); const BOOTSTRAP_TRANSIENT_RETRY_INTERVAL = Duration.millis(500); const TRANSIENT_BOOTSTRAP_STATUS_CODES = new Set([502, 503, 504]); From 0ee75e83f486017aa184c12aa813d5cb93d8412e Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Wed, 11 Nov 2026 01:48:38 +0000 Subject: [PATCH 8/8] test(desktop): stall regression no longer advances the clock after the backend resumes AI-assisted; verified with the tests and tools listed above. --- apps/desktop/src/backend/DesktopLocalEnvironmentAuth.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/desktop/src/backend/DesktopLocalEnvironmentAuth.test.ts b/apps/desktop/src/backend/DesktopLocalEnvironmentAuth.test.ts index 76f113ec703f0..dc268090a2214 100644 --- a/apps/desktop/src/backend/DesktopLocalEnvironmentAuth.test.ts +++ b/apps/desktop/src/backend/DesktopLocalEnvironmentAuth.test.ts @@ -260,7 +260,6 @@ describe("DesktopLocalEnvironmentAuth", () => { const fiber = yield* auth.getBearerToken.pipe(Effect.forkChild); yield* TestClock.adjust(Duration.seconds(30)); yield* Deferred.succeed(resumed, undefined); - yield* TestClock.adjust(Duration.seconds(11)); assert.strictEqual(yield* Fiber.join(fiber), "desktop-bearer-token"); }).pipe(Effect.provide(TestClock.layer())),