@devries-cameron20 / t3code-1 / commits / f5d9d12026
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

refactor(server): remove unused startup heartbeat launcher (#10030)

Julius Marminge committed Sep 5, 2026 at 01:19 UTC f5d9d12026d98b2b4b975f1944e7503d6c2c9eb3
2 files changed -59
apps/server/src/serverRuntimeStartup.test.ts
-51
@@ -13,7 +13,6 @@ import * as Stream from "effect/Stream";
13 import * as ServerConfig from "./config.ts";
14 import * as OrchestrationEngine from "./orchestration/Services/OrchestrationEngine.ts";
15 import * as ProjectionSnapshotQuery from "./orchestration/Services/ProjectionSnapshotQuery.ts";
16 -import * as AnalyticsService from "./telemetry/AnalyticsService.ts";
16 import * as ServerRuntimeStartup from "./serverRuntimeStartup.ts";
17 import * as GitVcsDriver from "./vcs/GitVcsDriver.ts";
18
@@ -103,56 +102,6 @@ it.effect("enqueueCommand fails queued work when readiness fails", () =>
102 ),
103 );
104
106 -it.effect("launchStartupHeartbeat does not block the caller while counts are loading", () =>
107 - Effect.scoped(
108 - Effect.gen(function* () {
109 - const releaseCounts = yield* Deferred.make<void, never>();
110 - const countsStarted = yield* Deferred.make<void, never>();
111 -
112 - yield* ServerRuntimeStartup.launchStartupHeartbeat.pipe(
113 - Effect.provideService(ProjectionSnapshotQuery.ProjectionSnapshotQuery, {
114 - getUserInputActivity: () => Effect.die("unused"),
115 - getCommandReadModel: () => Effect.die("unused"),
116 - getSnapshot: () => Effect.die("unused"),
117 - getShellSnapshot: () => Effect.die("unused"),
118 - getArchivedShellSnapshot: () => Effect.die("unused"),
119 - getSnapshotSequence: () => Effect.die("unused"),
120 - getEventReplayStats: () => Effect.die("unused"),
121 - getCounts: () =>
122 - Deferred.succeed(countsStarted, undefined).pipe(
123 - Effect.andThen(Deferred.await(releaseCounts)),
124 - Effect.as({
125 - projectCount: 2,
126 - threadCount: 3,
127 - }),
128 - ),
129 - getActiveProjectByWorkspaceRoot: () => Effect.succeed(Option.none()),
130 - getProjectShellById: () => Effect.succeed(Option.none()),
131 - getFirstActiveThreadIdByProjectId: () => Effect.succeed(Option.none()),
132 - getThreadCheckpointContext: () => Effect.succeed(Option.none()),
133 - getFullThreadDiffContext: () => Effect.succeed(Option.none()),
134 - getThreadRuntimeContext: () => Effect.die("unused"),
135 - getThreadShellById: () => Effect.succeed(Option.none()),
136 - getThreadDetailById: () => Effect.succeed(Option.none()),
137 - getThreadDetailSnapshot: () => Effect.succeed(Option.none()),
138 - searchThreads: () => Effect.succeed({ matches: [] }),
139 - }),
140 - Effect.provideService(AnalyticsService.AnalyticsService, {
141 - record: () => Effect.void,
142 - flush: Effect.void,
143 - }),
144 - );
145 -
146 - // The heartbeat is forked, so the caller is already back here while
147 - // getCounts is still parked. Awaiting countsStarted proves the forked
148 - // work really ran; releaseCounts staying incomplete proves the caller
149 - // never waited for it.
150 - yield* Deferred.await(countsStarted);
151 - assert.equal(yield* Deferred.isDone(releaseCounts), false);
152 - }),
153 - ),
154 -);
155 -
105 it.effect("resolveWelcomeBase derives cwd and project name from server config", () =>
106 Effect.gen(function* () {
107 const welcome = yield* ServerRuntimeStartup.resolveWelcomeBase.pipe(
apps/server/src/serverRuntimeStartup.ts
-8
@@ -168,14 +168,6 @@ export const recordStartupHeartbeat = Effect.gen(function* () {
168 });
169 });
170
171 -export const launchStartupHeartbeat = recordStartupHeartbeat.pipe(
172 - Effect.annotateSpans({ "startup.phase": "heartbeat.record" }),
173 - Effect.withSpan("server.startup.heartbeat.record"),
174 - Effect.ignoreCause({ log: true }),
175 - Effect.forkScoped,
176 - Effect.asVoid,
177 -);
178 -
171 const getAutoBootstrapThreadModelSelection = (): ModelSelection => ({
172 instanceId: ProviderInstanceId.make("codex"),
173 model: DEFAULT_MODEL,