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

This commit is contained in:
Julius Marminge authored and GitHub committed 2026-09-05 01:19:47 -07:00
1 parent 37bf4e6ec4
commit f5d9d12026
2 files changed
-59

No files matched your search

@@ -13,7 +13,6 @@ import * as Stream from "effect/Stream";
import * as ServerConfig from "./config.ts";
import * as OrchestrationEngine from "./orchestration/Services/OrchestrationEngine.ts";
import * as ProjectionSnapshotQuery from "./orchestration/Services/ProjectionSnapshotQuery.ts";
import * as AnalyticsService from "./telemetry/AnalyticsService.ts";
import * as ServerRuntimeStartup from "./serverRuntimeStartup.ts";
import * as GitVcsDriver from "./vcs/GitVcsDriver.ts";
@@ -103,56 +102,6 @@ it.effect("enqueueCommand fails queued work when readiness fails", () =>
),
);
it.effect("launchStartupHeartbeat does not block the caller while counts are loading", () =>
Effect.scoped(
Effect.gen(function* () {
const releaseCounts = yield* Deferred.make<void, never>();
const countsStarted = yield* Deferred.make<void, never>();
yield* ServerRuntimeStartup.launchStartupHeartbeat.pipe(
Effect.provideService(ProjectionSnapshotQuery.ProjectionSnapshotQuery, {
getUserInputActivity: () => Effect.die("unused"),
getCommandReadModel: () => Effect.die("unused"),
getSnapshot: () => Effect.die("unused"),
getShellSnapshot: () => Effect.die("unused"),
getArchivedShellSnapshot: () => Effect.die("unused"),
getSnapshotSequence: () => Effect.die("unused"),
getEventReplayStats: () => Effect.die("unused"),
getCounts: () =>
Deferred.succeed(countsStarted, undefined).pipe(
Effect.andThen(Deferred.await(releaseCounts)),
Effect.as({
projectCount: 2,
threadCount: 3,
}),
),
getActiveProjectByWorkspaceRoot: () => Effect.succeed(Option.none()),
getProjectShellById: () => Effect.succeed(Option.none()),
getFirstActiveThreadIdByProjectId: () => Effect.succeed(Option.none()),
getThreadCheckpointContext: () => Effect.succeed(Option.none()),
getFullThreadDiffContext: () => Effect.succeed(Option.none()),
getThreadRuntimeContext: () => Effect.die("unused"),
getThreadShellById: () => Effect.succeed(Option.none()),
getThreadDetailById: () => Effect.succeed(Option.none()),
getThreadDetailSnapshot: () => Effect.succeed(Option.none()),
searchThreads: () => Effect.succeed({ matches: [] }),
}),
Effect.provideService(AnalyticsService.AnalyticsService, {
record: () => Effect.void,
flush: Effect.void,
}),
);
// The heartbeat is forked, so the caller is already back here while
// getCounts is still parked. Awaiting countsStarted proves the forked
// work really ran; releaseCounts staying incomplete proves the caller
// never waited for it.
yield* Deferred.await(countsStarted);
assert.equal(yield* Deferred.isDone(releaseCounts), false);
}),
),
);
it.effect("resolveWelcomeBase derives cwd and project name from server config", () =>
Effect.gen(function* () {
const welcome = yield* ServerRuntimeStartup.resolveWelcomeBase.pipe(
-8
View File
@@ -168,14 +168,6 @@ export const recordStartupHeartbeat = Effect.gen(function* () {
});
});
export const launchStartupHeartbeat = recordStartupHeartbeat.pipe(
Effect.annotateSpans({ "startup.phase": "heartbeat.record" }),
Effect.withSpan("server.startup.heartbeat.record"),
Effect.ignoreCause({ log: true }),
Effect.forkScoped,
Effect.asVoid,
);
const getAutoBootstrapThreadModelSelection = (): ModelSelection => ({
instanceId: ProviderInstanceId.make("codex"),
model: DEFAULT_MODEL,