authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-05 01:19:47-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-05 01:19:47-07:00
logf5d9d12026d98b2b4b975f1944e7503d6c2c9eb3
tree534ed6752868b22b9238ac35712ed8e84e193715
parent37bf4e6ec4f18fb94e7ec04436a947d14642a5b6
signature Signed by PGP key B5690EEEBB952194

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


2 files changed, 0 insertions(+), 59 deletions(-)

apps/server/src/serverRuntimeStartup.test.ts-51
......@@ -13,7 +13,6 @@ import * as Stream from "effect/Stream";
1313import * as ServerConfig from "./config.ts";
1414import * as OrchestrationEngine from "./orchestration/Services/OrchestrationEngine.ts";
1515import * as ProjectionSnapshotQuery from "./orchestration/Services/ProjectionSnapshotQuery.ts";
16import * as AnalyticsService from "./telemetry/AnalyticsService.ts";
1716import * as ServerRuntimeStartup from "./serverRuntimeStartup.ts";
1817import * as GitVcsDriver from "./vcs/GitVcsDriver.ts";
1918
......@@ -103,56 +102,6 @@ it.effect("enqueueCommand fails queued work when readiness fails", () =>
103102 ),
104103);
105104
106it.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
156105it.effect("resolveWelcomeBase derives cwd and project name from server config", () =>
157106 Effect.gen(function* () {
158107 const welcome = yield* ServerRuntimeStartup.resolveWelcomeBase.pipe(
apps/server/src/serverRuntimeStartup.ts-8
......@@ -168,14 +168,6 @@ export const recordStartupHeartbeat = Effect.gen(function* () {
168168 });
169169});
170170
171export 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
179171const getAutoBootstrapThreadModelSelection = (): ModelSelection => ({
180172 instanceId: ProviderInstanceId.make("codex"),
181173 model: DEFAULT_MODEL,