@devries-cameron20 / t3code-1 / commits / 51cb8481a9
Fork 0

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

fix(server): a zero Git fetch interval also stops the fetch on window focus (#13253)

Co-authored-by: Julius Marminge <julius0216@outlook.com>

Igor Makowski committed Oct 20, 2026 at 02:28 UTC 51cb8481a9e06065e3dd967e3e854aea4b183a7f
5 files changed +180 -94
apps/server/src/git/GitManager.test.ts
+7 -4
@@ -902,6 +902,12 @@ it.layer(layerGitManagerTest)("GitManager", (it) => {
902 );
903 const broadcasterContext = yield* Layer.build(
904 VcsStatusBroadcaster.layer.pipe(
905 + Layer.provide(
906 + Layer.succeed(
907 + VcsStatusBroadcaster.VcsAutomaticFetchInterval,
908 + Effect.succeed(Duration.seconds(1)),
909 + ),
910 + ),
911 Layer.provide(
912 Layer.succeed(
913 GitWorkflowService.GitWorkflowService,
@@ -927,10 +933,7 @@ it.layer(layerGitManagerTest)("GitManager", (it) => {
933 let snapshotCount = 0;
934 for (const cwd of [repoDir, worktreeDir]) {
935 yield* Stream.runForEach(
930 - broadcaster.streamStatus(
931 - { cwd, includeRemote: false },
932 - { automaticRemoteRefreshInterval: Effect.succeed(Duration.seconds(1)) },
933 - ),
936 + broadcaster.streamStatus({ cwd, includeRemote: false }),
937 (event) => {
938 if (
939 cwd === worktreeDir &&
apps/server/src/server.ts
+1
@@ -401,6 +401,7 @@ const layerVcs = Layer.empty.pipe(
401 Layer.provideMerge(
402 VcsStatusBroadcaster.layer.pipe(
403 Layer.provide(layerGitWorkflow),
404 + Layer.provide(VcsStatusBroadcaster.layerAutomaticFetchInterval),
405 // The orchestration runtime also consumes the broadcaster (run
406 // finalization), so the policy cannot read the store from the runtime's
407 // output.
apps/server/src/vcs/VcsStatusBroadcaster.test.ts
+133 -50
@@ -79,11 +79,18 @@ function layerTestFor(state: {
79 remoteInvalidationCalls: number;
80 remoteStatusRefreshUpstreamValues?: Array<boolean | undefined>;
81 backgroundWorkEnabled?: boolean;
82 + automaticFetchInterval?: Effect.Effect<Duration.Duration>;
83 beforeRemoteStatus?: Effect.Effect<void>;
84 }) {
85 return VcsStatusBroadcaster.layer.pipe(
86 Layer.provideMerge(NodeServices.layer),
87 Layer.provide(layerBackgroundPolicy(() => state.backgroundWorkEnabled !== false)),
88 + Layer.provide(
89 + Layer.succeed(
90 + VcsStatusBroadcaster.VcsAutomaticFetchInterval,
91 + state.automaticFetchInterval ?? Effect.succeed(Duration.seconds(30)),
92 + ),
93 + ),
94 Layer.provide(
95 Layer.mock(GitWorkflowService.GitWorkflowService)({
96 localStatus: () =>
@@ -212,6 +219,93 @@ describe("VcsStatusBroadcaster", () => {
219 },
220 );
221
222 + it.effect.each(["status refresh", "initial stream"] as const)(
223 + "%s updates local and PR status without fetching or pulling when the interval is zero",
224 + (entryPoint) => {
225 + let interval = Duration.zero;
226 + let pullCalls = 0;
227 + let invalidations = 0;
228 + const refreshUpstreamValues: Array<boolean | undefined> = [];
229 + const local: VcsStatusLocalResult = {
230 + ...baseLocalStatus,
231 + isDefaultRef: true,
232 + refName: "main",
233 + };
234 + const remote = { ...remoteStatusWithPr, behindCount: 2 };
235 + const testLayer = VcsStatusBroadcaster.layer.pipe(
236 + Layer.provideMerge(NodeServices.layer),
237 + Layer.provide(
238 + Layer.succeed(
239 + VcsStatusBroadcaster.VcsAutomaticFetchInterval,
240 + Effect.sync(() => interval),
241 + ),
242 + ),
243 + Layer.provide(layerBackgroundPolicy(() => true)),
244 + Layer.provide(
245 + Layer.succeed(VcsStatusBroadcaster.VcsAutoPullPolicy, {
246 + isEnabled: () => Effect.succeed(true),
247 + }),
248 + ),
249 + Layer.provide(
250 + Layer.mock(GitWorkflowService.GitWorkflowService)({
251 + localStatus: () => Effect.succeed(local),
252 + remoteStatus: (_input, options) =>
253 + Effect.sync(() => {
254 + refreshUpstreamValues.push(options?.refreshUpstream);
255 + return remote;
256 + }),
257 + invalidateLocalStatus: () => Effect.void,
258 + invalidateRemoteStatus: () => Effect.void,
259 + invalidateStatus: () =>
260 + Effect.sync(() => {
261 + invalidations += 1;
262 + }),
263 + pullCurrentBranch: () =>
264 + Effect.sync(() => {
265 + pullCalls += 1;
266 + return { status: "pulled" as const, refName: "main", upstreamRef: "origin/main" };
267 + }),
268 + }),
269 + ),
270 + );
271 +
272 + return Effect.gen(function* () {
273 + const broadcaster = yield* VcsStatusBroadcaster.VcsStatusBroadcaster;
274 + if (entryPoint === "status refresh") {
275 + const status = yield* broadcaster.refreshStatus("/repo");
276 + assert.deepStrictEqual(status, { ...local, ...remote });
277 + assert.equal(invalidations, 1);
278 + } else {
279 + const update = yield* broadcaster.streamStatus({ cwd: "/repo" }).pipe(
280 + Stream.filter(
281 + (event) =>
282 + event._tag === "remoteUpdated" ||
283 + (event._tag === "snapshot" && event.remote !== null),
284 + ),
285 + Stream.runHead,
286 + );
287 + assert.deepStrictEqual(Option.getOrThrow(update), {
288 + _tag: "remoteUpdated",
289 + remote,
290 + });
291 + assert.deepStrictEqual(yield* broadcaster.getStatus({ cwd: "/repo" }), {
292 + ...local,
293 + ...remote,
294 + });
295 + }
296 + assert.deepStrictEqual(refreshUpstreamValues, [false]);
297 + assert.equal(pullCalls, 0);
298 +
299 + if (entryPoint === "status refresh") {
300 + interval = Duration.minutes(1);
301 + yield* broadcaster.refreshStatus("/repo");
302 + assert.deepStrictEqual(refreshUpstreamValues, [false, true, false]);
303 + assert.equal(pullCalls, 1);
304 + }
305 + }).pipe(Effect.provide(testLayer));
306 + },
307 + );
308 +
309 it.effect.each([
310 { refresh: "explicit", failure: "pull" },
311 { refresh: "explicit", failure: "post-pull remote read" },
@@ -778,6 +872,7 @@ describe("VcsStatusBroadcaster", () => {
872 currentRemoteStatus: remoteStatusWithPr,
873 localStatusCalls: 0,
874 remoteStatusCalls: 0,
875 + automaticFetchInterval: Effect.succeed(Duration.zero),
876 localInvalidationCalls: 0,
877 remoteInvalidationCalls: 0,
878 remoteStatusRefreshUpstreamValues: [] as Array<boolean | undefined>,
@@ -788,21 +883,15 @@ describe("VcsStatusBroadcaster", () => {
883 const scope = yield* Scope.make();
884 const snapshotDeferred = yield* Deferred.make<VcsStatusStreamEvent>();
885 const remoteUpdatedDeferred = yield* Deferred.make<VcsStatusStreamEvent>();
791 - yield* Stream.runForEach(
792 - broadcaster.streamStatus(
793 - { cwd: "/repo" },
794 - { automaticRemoteRefreshInterval: Effect.succeed(Duration.zero) },
795 - ),
796 - (event) => {
797 - if (event._tag === "snapshot") {
798 - return Deferred.succeed(snapshotDeferred, event).pipe(Effect.ignore);
799 - }
800 - if (event._tag === "remoteUpdated") {
801 - return Deferred.succeed(remoteUpdatedDeferred, event).pipe(Effect.ignore);
802 - }
803 - return Effect.void;
804 - },
805 - ).pipe(Effect.forkIn(scope));
886 + yield* Stream.runForEach(broadcaster.streamStatus({ cwd: "/repo" }), (event) => {
887 + if (event._tag === "snapshot") {
888 + return Deferred.succeed(snapshotDeferred, event).pipe(Effect.ignore);
889 + }
890 + if (event._tag === "remoteUpdated") {
891 + return Deferred.succeed(remoteUpdatedDeferred, event).pipe(Effect.ignore);
892 + }
893 + return Effect.void;
894 + }).pipe(Effect.forkIn(scope));
895
896 const snapshot = yield* Deferred.await(snapshotDeferred);
897 const remoteUpdated = yield* Deferred.await(remoteUpdatedDeferred);
@@ -846,6 +935,12 @@ describe("VcsStatusBroadcaster", () => {
935 let firstRemoteAttemptDeferred: Deferred.Deferred<void> | null = null;
936 const layerTest = VcsStatusBroadcaster.layer.pipe(
937 Layer.provideMerge(NodeServices.layer),
938 + Layer.provide(
939 + Layer.succeed(
940 + VcsStatusBroadcaster.VcsAutomaticFetchInterval,
941 + Effect.succeed(Duration.zero),
942 + ),
943 + ),
944 Layer.provide(layerBackgroundPolicy(() => true)),
945 Layer.provide(
946 Layer.mock(GitWorkflowService.GitWorkflowService)({
@@ -893,15 +988,10 @@ describe("VcsStatusBroadcaster", () => {
988 const scope = yield* Scope.make();
989 firstRemoteAttemptDeferred = yield* Deferred.make<void>();
990 const remoteUpdatedDeferred = yield* Deferred.make<VcsStatusStreamEvent>();
896 - yield* Stream.runForEach(
897 - broadcaster.streamStatus(
898 - { cwd: privateCwd },
899 - { automaticRemoteRefreshInterval: Effect.succeed(Duration.zero) },
900 - ),
901 - (event) =>
902 - event._tag === "remoteUpdated"
903 - ? Deferred.succeed(remoteUpdatedDeferred, event).pipe(Effect.ignore)
904 - : Effect.void,
991 + yield* Stream.runForEach(broadcaster.streamStatus({ cwd: privateCwd }), (event) =>
992 + event._tag === "remoteUpdated"
993 + ? Deferred.succeed(remoteUpdatedDeferred, event).pipe(Effect.ignore)
994 + : Effect.void,
995 ).pipe(Effect.forkIn(scope));
996
997 yield* Deferred.await(firstRemoteAttemptDeferred);
@@ -955,6 +1045,7 @@ describe("VcsStatusBroadcaster", () => {
1045 currentRemoteStatus: baseRemoteStatus,
1046 localStatusCalls: 0,
1047 remoteStatusCalls: 0,
1048 + automaticFetchInterval: Effect.succeed(Duration.minutes(1)),
1049 localInvalidationCalls: 0,
1050 remoteInvalidationCalls: 0,
1051 };
@@ -964,15 +1055,10 @@ describe("VcsStatusBroadcaster", () => {
1055 yield* broadcaster.getStatus({ cwd: "/repo" });
1056 const scope = yield* Scope.make();
1057 const snapshotDeferred = yield* Deferred.make<VcsStatusStreamEvent>();
967 - yield* Stream.runForEach(
968 - broadcaster.streamStatus(
969 - { cwd: "/repo" },
970 - { automaticRemoteRefreshInterval: Effect.succeed(Duration.minutes(1)) },
971 - ),
972 - (event) =>
973 - event._tag === "snapshot"
974 - ? Deferred.succeed(snapshotDeferred, event).pipe(Effect.ignore)
975 - : Effect.void,
1058 + yield* Stream.runForEach(broadcaster.streamStatus({ cwd: "/repo" }), (event) =>
1059 + event._tag === "snapshot"
1060 + ? Deferred.succeed(snapshotDeferred, event).pipe(Effect.ignore)
1061 + : Effect.void,
1062 ).pipe(Effect.forkIn(scope));
1063
1064 yield* Deferred.await(snapshotDeferred);
@@ -1000,6 +1086,7 @@ describe("VcsStatusBroadcaster", () => {
1086 currentRemoteStatus: initialRemote as VcsStatusRemoteResult | null,
1087 localStatusCalls: 0,
1088 remoteStatusCalls: 0,
1089 + automaticFetchInterval: Effect.succeed(Duration.minutes(1)),
1090 localInvalidationCalls: 0,
1091 remoteInvalidationCalls: 0,
1092 };
@@ -1010,17 +1097,12 @@ describe("VcsStatusBroadcaster", () => {
1097 const scope = yield* Scope.make();
1098 const snapshotDeferred = yield* Deferred.make<VcsStatusStreamEvent>();
1099 const localUpdatedDeferred = yield* Deferred.make<VcsStatusStreamEvent>();
1013 - yield* Stream.runForEach(
1014 - broadcaster.streamStatus(
1015 - { cwd: "/repo" },
1016 - { automaticRemoteRefreshInterval: Effect.succeed(Duration.minutes(1)) },
1017 - ),
1018 - (event) =>
1019 - event._tag === "snapshot"
1020 - ? Deferred.succeed(snapshotDeferred, event).pipe(Effect.ignore)
1021 - : event._tag === "localUpdated"
1022 - ? Deferred.succeed(localUpdatedDeferred, event).pipe(Effect.ignore)
1023 - : Effect.void,
1100 + yield* Stream.runForEach(broadcaster.streamStatus({ cwd: "/repo" }), (event) =>
1101 + event._tag === "snapshot"
1102 + ? Deferred.succeed(snapshotDeferred, event).pipe(Effect.ignore)
1103 + : event._tag === "localUpdated"
1104 + ? Deferred.succeed(localUpdatedDeferred, event).pipe(Effect.ignore)
1105 + : Effect.void,
1106 ).pipe(Effect.forkIn(scope));
1107 yield* Deferred.await(snapshotDeferred);
1108
@@ -1127,6 +1209,12 @@ describe("VcsStatusBroadcaster", () => {
1209 };
1210 const layerTest = VcsStatusBroadcaster.layer.pipe(
1211 Layer.provideMerge(NodeServices.layer),
1212 + Layer.provide(
1213 + Layer.succeed(
1214 + VcsStatusBroadcaster.VcsAutomaticFetchInterval,
1215 + Effect.succeed(Duration.seconds(1)),
1216 + ),
1217 + ),
1218 Layer.provide(layerBackgroundPolicy(() => false)),
1219 Layer.provide(
1220 Layer.mock(GitWorkflowService.GitWorkflowService)({
@@ -1154,12 +1242,7 @@ describe("VcsStatusBroadcaster", () => {
1242
1243 return Effect.gen(function* () {
1244 const broadcaster = yield* VcsStatusBroadcaster.VcsStatusBroadcaster;
1157 - const snapshot = yield* Stream.runHead(
1158 - broadcaster.streamStatus(
1159 - { cwd: "/repo" },
1160 - { automaticRemoteRefreshInterval: Effect.succeed(Duration.seconds(1)) },
1161 - ),
1162 - );
1245 + const snapshot = yield* Stream.runHead(broadcaster.streamStatus({ cwd: "/repo" }));
1246
1247 assert.isTrue(Option.isSome(snapshot));
1248 assert.equal(state.remoteStatusCalls, 0);
apps/server/src/vcs/VcsStatusBroadcaster.ts
+38 -24
@@ -21,6 +21,8 @@ import type {
21 VcsStatusStreamEvent,
22 VcsStatusSubscriptionInput,
23 } from "@t3tools/contracts";
24 +import { DEFAULT_AUTOMATIC_GIT_FETCH_INTERVAL } from "@t3tools/contracts";
25 +import { resolveServerBackgroundActivitySettings } from "@t3tools/shared/backgroundActivitySettings";
26 import { mergeGitStatusParts } from "@t3tools/shared/git";
27 import * as KeyedLock from "@t3tools/shared/KeyedLock";
28 import { resolveProjectSettings } from "@t3tools/shared/projectSettings";
@@ -30,7 +32,6 @@ import * as GitWorkflowService from "../git/GitWorkflowService.ts";
32 import * as ProjectStore from "../orchestration-v2/ProjectStore.ts";
33 import * as ServerSettings from "../serverSettings.ts";
34
33 -const DEFAULT_VCS_STATUS_REFRESH_INTERVAL = Duration.seconds(30);
35 const VCS_STATUS_REFRESH_FAILURE_BASE_DELAY = Duration.seconds(30);
36 const VCS_STATUS_REFRESH_FAILURE_MAX_DELAY = Duration.minutes(15);
37 const MAX_FAILURE_DIAGNOSTIC_VALUES = 8;
@@ -140,9 +141,23 @@ interface ActiveRemotePoller {
141 readonly demandCwds: Ref.Ref<ReadonlyMap<string, number>>;
142 }
143
143 -interface StreamStatusOptions {
144 - readonly automaticRemoteRefreshInterval?: Effect.Effect<Duration.Duration, never>;
145 -}
144 +export class VcsAutomaticFetchInterval extends Context.Reference<Effect.Effect<Duration.Duration>>(
145 + "t3/vcs/VcsAutomaticFetchInterval",
146 + { defaultValue: () => Effect.succeed(DEFAULT_AUTOMATIC_GIT_FETCH_INTERVAL) },
147 +) {}
148 +
149 +export const layerAutomaticFetchInterval = Layer.effect(
150 + VcsAutomaticFetchInterval,
151 + Effect.gen(function* () {
152 + const serverSettings = yield* ServerSettings.ServerSettingsService;
153 + return serverSettings.getSettings.pipe(
154 + Effect.map(
155 + (settings) => resolveServerBackgroundActivitySettings(settings).automaticGitFetchInterval,
156 + ),
157 + Effect.orElseSucceed(() => DEFAULT_AUTOMATIC_GIT_FETCH_INTERVAL),
158 + );
159 + }),
160 +);
161
162 export class VcsAutoPullPolicy extends Context.Reference<{
163 readonly isEnabled: (cwd: string) => Effect.Effect<boolean, never>;
@@ -198,7 +213,6 @@ export class VcsStatusBroadcaster extends Context.Service<
213 ) => Effect.Effect<VcsStatusRemoteResult | null, GitManagerServiceError>;
214 readonly streamStatus: (
215 input: VcsStatusSubscriptionInput,
201 - options?: StreamStatusOptions,
216 ) => Stream.Stream<VcsStatusStreamEvent, GitManagerServiceError>;
217 }
218 >()("t3/vcs/VcsStatusBroadcaster") {}
@@ -215,6 +229,7 @@ const normalizeCwd = (cwd: string) =>
229
230 /** @public Service construction is part of the canonical Effect module API. */
231 export const make = Effect.gen(function* () {
232 + const automaticFetchInterval = yield* VcsAutomaticFetchInterval;
233 const autoPullPolicy = yield* VcsAutoPullPolicy;
234 const workflow = yield* GitWorkflowService.GitWorkflowService;
235 const backgroundPolicy = yield* BackgroundPolicy.BackgroundPolicy;
@@ -374,10 +389,13 @@ export const make = Effect.gen(function* () {
389 cwd,
390 Effect.gen(function* () {
391 const latest = yield* getCachedStatus(cwd);
392 + const refreshUpstream = !Duration.isZero(yield* automaticFetchInterval);
393 const [local, remote] = yield* Effect.all(
394 [
395 latest?.local ? Effect.succeed(latest.local.value) : workflow.localStatus({ cwd }),
380 - latest?.remote ? Effect.succeed(latest.remote.value) : workflow.remoteStatus({ cwd }),
396 + latest?.remote
397 + ? Effect.succeed(latest.remote.value)
398 + : workflow.remoteStatus({ cwd }, { refreshUpstream }),
399 ],
400 { concurrency: "unbounded" },
401 );
@@ -468,7 +486,10 @@ export const make = Effect.gen(function* () {
486 }
487 const previousRemote = (yield* getCachedStatus(cwd))?.remote?.value;
488 const remote = yield* workflow.remoteStatus({ cwd }, options);
471 - const pulled = yield* maybeAutoPull(cwd, remote, options?.policyCwds ?? [cwd]);
489 + const pulled =
490 + options?.refreshUpstream === false
491 + ? null
492 + : yield* maybeAutoPull(cwd, remote, options?.policyCwds ?? [cwd]);
493 if (pulled !== null) return pulled.remote;
494 if (
495 remote &&
@@ -493,11 +514,13 @@ export const make = Effect.gen(function* () {
514 return yield* withRemoteWriteLock(
515 cwd,
516 Effect.gen(function* () {
517 + const refreshUpstream = !Duration.isZero(yield* automaticFetchInterval);
518 yield* workflow.invalidateStatus(cwd);
519 // Local after remote: the fetch can move the base that the Changes totals compare with.
498 - const remote = yield* workflow.remoteStatus({ cwd });
520 + const remote = yield* workflow.remoteStatus({ cwd }, { refreshUpstream });
521 const local = yield* workflow.localStatus({ cwd });
500 - const pulled = yield* maybeAutoPull(cwd, remote, [rawCwd]);
522 + // Without a fetch, the cached behind count cannot justify an automatic pull.
523 + const pulled = refreshUpstream ? yield* maybeAutoPull(cwd, remote, [rawCwd]) : null;
524 if (pulled !== null) return mergeGitStatusParts(pulled.local, pulled.remote);
525 return yield* updateCachedStatus(cwd, local, remote, { publish: true });
526 }),
@@ -535,16 +558,15 @@ export const make = Effect.gen(function* () {
558 const makeRemoteRefreshLoop = (
559 cwd: string,
560 demandCwdsRef: Ref.Ref<ReadonlyMap<string, number>>,
538 - automaticRemoteRefreshInterval: Effect.Effect<Duration.Duration, never>,
561 refreshImmediately: boolean,
562 ) => {
563 return Effect.gen(function* () {
564 const consecutiveFailuresRef = yield* Ref.make(0);
565 const needsInitialRefreshRef = yield* Ref.make(refreshImmediately);
566 const refreshRemoteStatusIfEnabled = Effect.gen(function* () {
545 - const configuredInterval = yield* automaticRemoteRefreshInterval;
567 + const configuredInterval = yield* automaticFetchInterval;
568 const activeInterval = Duration.isZero(configuredInterval)
547 - ? DEFAULT_VCS_STATUS_REFRESH_INTERVAL
569 + ? DEFAULT_AUTOMATIC_GIT_FETCH_INTERVAL
570 : configuredInterval;
571 const needsInitialRefresh = yield* Ref.get(needsInitialRefreshRef);
572 if (Duration.isZero(configuredInterval) && !needsInitialRefresh) {
@@ -597,10 +619,10 @@ export const make = Effect.gen(function* () {
619 });
620
621 if (!refreshImmediately) {
600 - const configuredInterval = yield* automaticRemoteRefreshInterval;
622 + const configuredInterval = yield* automaticFetchInterval;
623 yield* Effect.sleep(
624 Duration.isZero(configuredInterval)
603 - ? DEFAULT_VCS_STATUS_REFRESH_INTERVAL
625 + ? DEFAULT_AUTOMATIC_GIT_FETCH_INTERVAL
626 : configuredInterval,
627 );
628 }
@@ -619,7 +641,6 @@ export const make = Effect.gen(function* () {
641 const retainRemotePoller = Effect.fn("VcsStatusBroadcaster.retainRemotePoller")(function* (
642 cwd: string,
643 demandCwd: string,
622 - automaticRemoteRefreshInterval: Effect.Effect<Duration.Duration, never>,
644 refreshImmediately: boolean,
645 ) {
646 yield* SynchronizedRef.modifyEffect(pollersRef, (activePollers) => {
@@ -643,12 +664,7 @@ export const make = Effect.gen(function* () {
664
665 return Ref.make<ReadonlyMap<string, number>>(new Map([[demandCwd, 1]])).pipe(
666 Effect.flatMap((demandCwds) =>
646 - makeRemoteRefreshLoop(
647 - cwd,
648 - demandCwds,
649 - automaticRemoteRefreshInterval,
650 - refreshImmediately,
651 - ).pipe(
667 + makeRemoteRefreshLoop(cwd, demandCwds, refreshImmediately).pipe(
668 Effect.forkIn(broadcasterScope),
669 Effect.map((fiber) => {
670 const nextPollers = new Map(activePollers);
@@ -707,7 +723,7 @@ export const make = Effect.gen(function* () {
723 }
724 });
725
710 - const streamStatus: VcsStatusBroadcaster["Service"]["streamStatus"] = (input, options) =>
726 + const streamStatus: VcsStatusBroadcaster["Service"]["streamStatus"] = (input) =>
727 Stream.unwrap(
728 Effect.gen(function* () {
729 const cwd = yield* withFileSystem(normalizeCwd(input.cwd));
@@ -719,8 +735,6 @@ export const make = Effect.gen(function* () {
735 yield* retainRemotePoller(
736 cwd,
737 input.cwd,
722 - options?.automaticRemoteRefreshInterval ??
723 - Effect.succeed(DEFAULT_VCS_STATUS_REFRESH_INTERVAL),
738 cachedStatus?.remote === null || cachedStatus?.remote === undefined,
739 );
740 }
apps/server/src/ws.ts
+1 -16
@@ -21,7 +21,6 @@ import { rpcInitialItems } from "./rpcInitialItems.ts";
21 import { subscribeChatGptHandoff } from "./provider/CodexChatGptHandoff.ts";
22 import { subscribeCodexAuthCallback } from "./provider/CodexAuthCallback.ts";
23 import {
24 - DEFAULT_AUTOMATIC_GIT_FETCH_INTERVAL,
24 AcpRegistryOperationError,
25 CommandId,
26 authScopeResponse,
@@ -100,7 +99,6 @@ import {
99 WS_METHODS,
100 WsRpcGroup,
101 } from "@t3tools/contracts";
103 -import { resolveServerBackgroundActivitySettings } from "@t3tools/shared/backgroundActivitySettings";
102 import {
103 HttpRouter,
104 HttpServerRequest,
@@ -1284,16 +1282,6 @@ const layerWsRpc = (
1282 const serverAuth = yield* EnvironmentAuth.EnvironmentAuth;
1283 const sourceControlDiscovery = yield* SourceControlDiscovery.SourceControlDiscovery;
1284 const otlpEndpointCheck = yield* OtlpEndpointCheck.OtlpEndpointCheck;
1287 - const automaticGitFetchInterval = serverSettings.getSettings.pipe(
1288 - Effect.map(
1289 - (settings) => resolveServerBackgroundActivitySettings(settings).automaticGitFetchInterval,
1290 - ),
1291 - Effect.catch((cause) =>
1292 - Effect.logWarning("Failed to read automatic Git fetch interval setting", {
1293 - detail: cause.message,
1294 - }).pipe(Effect.as(DEFAULT_AUTOMATIC_GIT_FETCH_INTERVAL)),
1295 - ),
1296 - );
1285 const sourceControlRepositories =
1286 yield* SourceControlRepositoryService.SourceControlRepositoryService;
1287 const withPullRequestViewer = pullRequests.withRoutingCredential;
@@ -2752,10 +2740,7 @@ const layerWsRpc = (
2740 }),
2741 [WS_METHODS.assetsPersistChatAttachments]: (input) =>
2742 persistChatAttachments(input).pipe(Effect.map((attachments) => ({ attachments }))),
2755 - [WS_METHODS.subscribeVcsStatus]: (input) =>
2756 - vcsStatusBroadcaster.streamStatus(input, {
2757 - automaticRemoteRefreshInterval: automaticGitFetchInterval,
2758 - }),
2743 + [WS_METHODS.subscribeVcsStatus]: (input) => vcsStatusBroadcaster.streamStatus(input),
2744 [WS_METHODS.subscribeWorktreeSetup]: (input) => worktreeSetupTracker.stream(input.threadId),
2745 [WS_METHODS.worktreeSetupCancel]: (input) =>
2746 worktreeSetupTracker