GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||
GeezerVison is showing github.com — Reduce idle work and disk churn with native resource diagnostics by juliusmarminge · Pull Request #2679 · pingdotgg/t3code Conversation
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix prepared fixes for both issues found in the latest run.
Or push these changes by commenting:
@cursor push 6d184f0660
diff --git a/apps/web/src/components/settings/SettingsPanels.tsx b/apps/web/src/components/settings/SettingsPanels.tsx --- a/apps/web/src/components/settings/SettingsPanels.tsx +++ b/apps/web/src/components/settings/SettingsPanels.tsx @@ -1,7 +1,6 @@ import { ArchiveIcon, ArchiveX, - InfoIcon, LoaderIcon, PlusIcon, RefreshCwIcon, @@ -106,6 +105,12 @@ SettingsSection, useRelativeTimeTick, } from "./settingsLayout"; +import { + BackgroundPolicyTooltip as PolicyTooltip, + backgroundActivityOverrideSettings, + durationToSeconds, + normalizeIntervalSeconds, +} from "./backgroundActivityUtils"; import { ProjectFavicon } from "../ProjectFavicon"; import { useServerObservability, useServerProviders } from "../../rpc/serverState"; @@ -137,11 +142,6 @@ }; type BackgroundActivityProfileOption = BackgroundActivityProfile | "advanced"; -type BackgroundActivityOverridePatch = Partial<{ - [K in keyof BackgroundActivitySettings["overrides"]]: - | BackgroundActivitySettings["overrides"][K] - | undefined; -}>; const BACKGROUND_ACTIVITY_PROFILE_OPTION_LABELS: Record<BackgroundActivityProfileOption, string> = { ...BACKGROUND_ACTIVITY_PROFILE_LABELS, @@ -174,17 +174,6 @@ { key: "pauseWhenOnBattery", label: "Pause on battery" }, ]; -function durationToSeconds(duration: Duration.Duration): number { - return Math.round(Duration.toMillis(duration) / 1_000); -} - -function normalizeIntervalSeconds(value: number | null): number { - if (value === null || !Number.isFinite(value)) { - return 0; - } - return Math.max(0, Math.round(value)); -} - function resolveBackgroundActivityProfileOption(settings: { readonly backgroundActivity: BackgroundActivitySettings; }): BackgroundActivityProfileOption { @@ -209,50 +198,6 @@ }; } -function backgroundActivityOverrideSettings( - current: BackgroundActivitySettings, - overrides: BackgroundActivityOverridePatch, -) { - const nextOverrides: BackgroundActivityOverridePatch = { - ...current.overrides, - ...overrides, - }; - for (const [key, value] of Object.entries(nextOverrides)) { - if (value === undefined) { - delete nextOverrides[key as keyof typeof nextOverrides]; - } - } - return { - backgroundActivity: { - schemaVersion: 1 as const, - profile: "custom" as const, - baseProfile: getBackgroundActivityBaseProfile(current), - overrides: nextOverrides as BackgroundActivitySettings["overrides"], - }, - }; -} - -function PolicyTooltip({ children }: { readonly children: string }) { - return ( - <Tooltip> - <TooltipTrigger - render={ - <button - type="button" - className="inline-flex size-5 items-center justify-center rounded-sm text-muted-foreground hover:text-foreground" - aria-label="Background policy details" - > - <InfoIcon className="size-3.5" /> - </button> - } - /> - <TooltipPopup side="top" className="max-w-72"> - {children} - </TooltipPopup> - </Tooltip> - ); -} - function withoutProviderInstanceKey<V>( record: Readonly<Record<ProviderInstanceId, V>> | undefined, key: ProviderInstanceId, diff --git a/apps/web/src/components/settings/SourceControlSettings.tsx b/apps/web/src/components/settings/SourceControlSettings.tsx --- a/apps/web/src/components/settings/SourceControlSettings.tsx +++ b/apps/web/src/components/settings/SourceControlSettings.tsx @@ -1,9 +1,8 @@ -import { ChevronDownIcon, GitPullRequestIcon, InfoIcon, RefreshCwIcon } from "lucide-react"; +import { ChevronDownIcon, GitPullRequestIcon, RefreshCwIcon } from "lucide-react"; import * as Duration from "effect/Duration"; import * as Option from "effect/Option"; import { useState, type ReactNode } from "react"; import type { - BackgroundActivitySettings, SourceControlProviderKind, SourceControlDiscoveryResult, SourceControlProviderAuth, @@ -55,6 +54,12 @@ } from "../Icons"; import { RedactedSensitiveText } from "./RedactedSensitiveText"; import { SettingResetButton, SettingsPageContainer, SettingsSection } from "./settingsLayout"; +import { + BackgroundPolicyTooltip, + backgroundActivityOverrideSettings, + durationToSeconds, + normalizeIntervalSeconds as normalizeFetchIntervalSeconds, +} from "./backgroundActivityUtils"; const EMPTY_DISCOVERY_RESULT: SourceControlDiscoveryResult = { versionControlSystems: [], @@ -75,44 +80,7 @@ const SOURCE_CONTROL_SKELETON_ROWS = ["primary", "secondary"] as const; const GIT_FETCH_INTERVAL_STEP_SECONDS = 5; -type BackgroundActivityOverridePatch = Partial<{ - [K in keyof BackgroundActivitySettings["overrides"]]: - | BackgroundActivitySettings["overrides"][K] - | undefined; -}>; -function durationToSeconds(duration: Duration.Duration): number { - return Math.round(Duration.toMillis(duration) / 1_000); -} - -function normalizeFetchIntervalSeconds(value: number | null): number { - if (value === null || !Number.isFinite(value)) { - return 0; - } - return Math.max(0, Math.round(value)); -} - -function BackgroundPolicyTooltip({ children }: { readonly children: string }) { - return ( - <Tooltip> - <TooltipTrigger - render={ - <button - type="button" - className="inline-flex size-5 items-center justify-center rounded-sm text-muted-foreground hover:text-foreground" - aria-label="Background policy details" - > - <InfoIcon className="size-3.5" /> - </button> - } - /> - <TooltipPopup side="top" className="max-w-72"> - {children} - </TooltipPopup> - </Tooltip> - ); -} - function optionLabel(value: Option.Option<string>): string | null { return Option.getOrNull(value); } @@ -335,28 +303,6 @@ ); const canResetFetchInterval = automaticGitFetchIntervalSeconds !== defaultAutomaticGitFetchIntervalSeconds; - const backgroundActivityOverrideSettings = ( - current: BackgroundActivitySettings, - overrides: BackgroundActivityOverridePatch, - ) => { - const nextOverrides: BackgroundActivityOverridePatch = { - ...current.overrides, - ...overrides, - }; - for (const [key, value] of Object.entries(nextOverrides)) { - if (value === undefined) { - delete nextOverrides[key as keyof typeof nextOverrides]; - } - } - return { - backgroundActivity: { - schemaVersion: 1 as const, - profile: "custom" as const, - baseProfile: getBackgroundActivityBaseProfile(current), - overrides: nextOverrides as BackgroundActivitySettings["overrides"], - }, - }; - }; return ( <div className="grid gap-3"> diff --git a/apps/web/src/components/settings/backgroundActivityUtils.tsx b/apps/web/src/components/settings/backgroundActivityUtils.tsx new file mode 100644 --- /dev/null +++ b/apps/web/src/components/settings/backgroundActivityUtils.tsx @@ -1,0 +1,67 @@ +import { InfoIcon } from "lucide-react"; +import * as Duration from "effect/Duration"; +import type { BackgroundActivitySettings } from "@t3tools/contracts"; +import { getBackgroundActivityBaseProfile } from "@t3tools/shared/backgroundActivitySettings"; + +import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; + +export type BackgroundActivityOverridePatch = Partial<{ + [K in keyof BackgroundActivitySettings["overrides"]]: + | BackgroundActivitySettings["overrides"][K] + | undefined; +}>; + +export function durationToSeconds(duration: Duration.Duration): number { + return Math.round(Duration.toMillis(duration) / 1_000); +} + +export function normalizeIntervalSeconds(value: number | null): number { + if (value === null || !Number.isFinite(value)) { + return 0; + } + return Math.max(0, Math.round(value)); +} + +export function backgroundActivityOverrideSettings( + current: BackgroundActivitySettings, + overrides: BackgroundActivityOverridePatch, +) { + const nextOverrides: BackgroundActivityOverridePatch = { + ...current.overrides, + ...overrides, + }; + for (const [key, value] of Object.entries(nextOverrides)) { + if (value === undefined) { + delete nextOverrides[key as keyof typeof nextOverrides]; + } + } + return { + backgroundActivity: { + schemaVersion: 1 as const, + profile: "custom" as const, + baseProfile: getBackgroundActivityBaseProfile(current), + overrides: nextOverrides as BackgroundActivitySettings["overrides"], + }, + }; +} + +export function BackgroundPolicyTooltip({ children }: { readonly children: string }) { + return ( + <Tooltip> + <TooltipTrigger + render={ + <button + type="button" + className="inline-flex size-5 items-center justify-center rounded-sm text-muted-foreground hover:text-foreground" + aria-label="Background policy details" + > + <InfoIcon className="size-3.5" /> + </button> + } + /> + <TooltipPopup side="top" className="max-w-72"> + {children} + </TooltipPopup> + </Tooltip> + ); +} diff --git a/packages/shared/src/serverSettings.ts b/packages/shared/src/serverSettings.ts --- a/packages/shared/src/serverSettings.ts +++ b/packages/shared/src/serverSettings.ts @@ -89,26 +89,28 @@ ...patchForMerge } = patch; const backgroundActivityPatch = - backgroundActivityProfile !== undefined - ? { - schemaVersion: 1 as const, - profile: backgroundActivityProfile, - overrides: {}, - } - : automaticGitFetchInterval !== undefined || providerHealthRefreshInterval !== undefined + backgroundActivity !== undefined + ? undefined + : backgroundActivityProfile !== undefined ? { schemaVersion: 1 as const, - profile: "custom" as const, - baseProfile: getBackgroundActivityBaseProfile(current.backgroundActivity), - overrides: { - ...current.backgroundActivity.overrides, - ...(automaticGitFetchInterval !== undefined ? { automaticGitFetchInterval } : {}), - ...(providerHealthRefreshInterval !== undefined - ? { providerHealthRefreshInterval } - : {}), - }, + profile: backgroundActivityProfile, + overrides: {}, } - : undefined; + : automaticGitFetchInterval !== undefined || providerHealthRefreshInterval !== undefined + ? { + schemaVersion: 1 as const, + profile: "custom" as const, + baseProfile: getBackgroundActivityBaseProfile(current.backgroundActivity), + overrides: { + ...current.backgroundActivity.overrides, + ...(automaticGitFetchInterval !== undefined ? { automaticGitFetchInterval } : {}), + ...(providerHealthRefreshInterval !== undefined + ? { providerHealthRefreshInterval } + : {}), + }, + } + : undefined; const next = deepMerge(current, patchForMerge); const nextWithReplacementsBase = { ...next,
You can send follow-ups to the cloud agent here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
ApprovabilityVerdict: Needs human review Diff is too large for automated approval analysis. A human reviewer should evaluate this PR. You can customize Macroscope's approvability policy. Learn more. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
038e209 to
8da0859
Compare
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix prepared fixes for all 3 issues found in the latest run.
Or push these changes by commenting:
@cursor push 44ee7a6c3a
diff --git a/apps/server/src/background/BackgroundPolicy.ts b/apps/server/src/background/BackgroundPolicy.ts --- a/apps/server/src/background/BackgroundPolicy.ts +++ b/apps/server/src/background/BackgroundPolicy.ts @@ -30,6 +30,7 @@ input: ClientActivityReportInput, ) => Effect.Effect<void>; readonly removeRpcClient: (rpcClientId: RpcClientId) => Effect.Effect<void>; + readonly removeSession: (sessionId: AuthSessionId) => Effect.Effect<void>; readonly reportHostPowerState: (snapshot: HostPowerSnapshot) => Effect.Effect<void>; readonly snapshot: Effect.Effect<BackgroundPolicySnapshot>; readonly streamChanges: Stream.Stream<BackgroundPolicySnapshot>; @@ -218,6 +219,17 @@ return next; }).pipe(Effect.andThen(publishSnapshot), Effect.asVoid); + const removeSession: BackgroundPolicyShape["removeSession"] = (sessionId) => + Ref.update(leasesRef, (leases) => { + const next = new Map(leases); + for (const [key, lease] of next) { + if (lease.sessionId === sessionId) { + next.delete(key); + } + } + return next; + }).pipe(Effect.andThen(publishSnapshot), Effect.asVoid); + const hasDemand: BackgroundPolicyShape["hasDemand"] = (scope) => Effect.map(snapshot, (current) => current.activeScopeKeys.includes(scopeKey(scope))); @@ -264,6 +276,7 @@ return BackgroundPolicy.of({ reportClientActivity, removeRpcClient, + removeSession, reportHostPowerState: hostPowerMonitor.report, snapshot, streamChanges: Stream.fromPubSub(changes), diff --git a/apps/server/src/provider/Layers/ProviderInstanceRegistryLive.test.ts b/apps/server/src/provider/Layers/ProviderInstanceRegistryLive.test.ts --- a/apps/server/src/provider/Layers/ProviderInstanceRegistryLive.test.ts +++ b/apps/server/src/provider/Layers/ProviderInstanceRegistryLive.test.ts @@ -64,6 +64,7 @@ const BackgroundPolicyAlwaysRunLayer = Layer.mock(BackgroundPolicy.BackgroundPolicy)({ reportClientActivity: () => Effect.void, removeRpcClient: () => Effect.void, + removeSession: () => Effect.void, reportHostPowerState: () => Effect.void, snapshot: Effect.succeed({ hostPower: { diff --git a/apps/server/src/provider/Layers/ProviderRegistry.test.ts b/apps/server/src/provider/Layers/ProviderRegistry.test.ts --- a/apps/server/src/provider/Layers/ProviderRegistry.test.ts +++ b/apps/server/src/provider/Layers/ProviderRegistry.test.ts @@ -78,6 +78,7 @@ const BackgroundPolicyAlwaysRunLayer = Layer.mock(BackgroundPolicy.BackgroundPolicy)({ reportClientActivity: () => Effect.void, removeRpcClient: () => Effect.void, + removeSession: () => Effect.void, reportHostPowerState: () => Effect.void, snapshot: Effect.succeed({ hostPower: { diff --git a/apps/server/src/provider/makeManagedServerProvider.test.ts b/apps/server/src/provider/makeManagedServerProvider.test.ts --- a/apps/server/src/provider/makeManagedServerProvider.test.ts +++ b/apps/server/src/provider/makeManagedServerProvider.test.ts @@ -97,6 +97,7 @@ return Layer.mock(BackgroundPolicy.BackgroundPolicy)({ reportClientActivity: () => Effect.void, removeRpcClient: () => Effect.void, + removeSession: () => Effect.void, reportHostPowerState: () => Effect.void, snapshot: Effect.succeed({ hostPower: { diff --git a/apps/server/src/server.test.ts b/apps/server/src/server.test.ts --- a/apps/server/src/server.test.ts +++ b/apps/server/src/server.test.ts @@ -777,6 +777,7 @@ Layer.mock(BackgroundPolicy.BackgroundPolicy)({ reportClientActivity: () => Effect.void, removeRpcClient: () => Effect.void, + removeSession: () => Effect.void, reportHostPowerState: () => Effect.void, snapshot: Effect.succeed({ hostPower: { diff --git a/apps/server/src/vcs/VcsStatusBroadcaster.test.ts b/apps/server/src/vcs/VcsStatusBroadcaster.test.ts --- a/apps/server/src/vcs/VcsStatusBroadcaster.test.ts +++ b/apps/server/src/vcs/VcsStatusBroadcaster.test.ts @@ -92,6 +92,7 @@ return Layer.mock(BackgroundPolicy.BackgroundPolicy)({ reportClientActivity: () => Effect.void, removeRpcClient: () => Effect.void, + removeSession: () => Effect.void, reportHostPowerState: () => Effect.void, snapshot: Effect.succeed({ hostPower: { diff --git a/apps/server/src/vcs/VcsStatusBroadcaster.ts b/apps/server/src/vcs/VcsStatusBroadcaster.ts --- a/apps/server/src/vcs/VcsStatusBroadcaster.ts +++ b/apps/server/src/vcs/VcsStatusBroadcaster.ts @@ -258,6 +258,7 @@ const makeRemoteRefreshLoop = ( cwd: string, + scopeCwd: string, automaticRemoteRefreshInterval: Effect.Effect<Duration.Duration, never>, refreshImmediately: boolean, ) => { @@ -274,7 +275,7 @@ const shouldRun = yield* backgroundPolicy.shouldRunScopeWork({ type: "vcs-status", - cwd, + cwd: scopeCwd, }); if (!shouldRun) { return activeInterval; @@ -322,6 +323,7 @@ const retainRemotePoller = Effect.fn("VcsStatusBroadcaster.retainRemotePoller")(function* ( cwd: string, + scopeCwd: string, automaticRemoteRefreshInterval: Effect.Effect<Duration.Duration, never>, refreshImmediately: boolean, ) { @@ -336,7 +338,12 @@ return Effect.succeed([undefined, nextPollers] as const); } - return makeRemoteRefreshLoop(cwd, automaticRemoteRefreshInterval, refreshImmediately).pipe( + return makeRemoteRefreshLoop( + cwd, + scopeCwd, + automaticRemoteRefreshInterval, + refreshImmediately, + ).pipe( Effect.forkIn(broadcasterScope), Effect.map((fiber) => { const nextPollers = new Map(activePollers); @@ -388,6 +395,7 @@ const initialRemote = cachedStatus?.remote?.value ?? null; yield* retainRemotePoller( cwd, + input.cwd, options?.automaticRemoteRefreshInterval ?? Effect.succeed(DEFAULT_VCS_STATUS_REFRESH_INTERVAL), cachedStatus?.remote === null || cachedStatus?.remote === undefined, diff --git a/apps/server/src/ws.ts b/apps/server/src/ws.ts --- a/apps/server/src/ws.ts +++ b/apps/server/src/ws.ts @@ -1669,6 +1669,7 @@ const request = yield* HttpServerRequest.HttpServerRequest; const serverAuth = yield* EnvironmentAuth.EnvironmentAuth; const sessions = yield* SessionStore.SessionStore; + const backgroundPolicy = yield* BackgroundPolicy.BackgroundPolicy; const session = yield* serverAuth.authenticateWebSocketUpgrade(request).pipe( Effect.catchTags({ ServerAuthInvalidCredentialError: (error) => failEnvironmentAuthInvalid(error.reason), @@ -1710,7 +1711,11 @@ return yield* Effect.acquireUseRelease( sessions.markConnected(session.sessionId), () => rpcWebSocketHttpEffect, - () => sessions.markDisconnected(session.sessionId), + () => + Effect.all([ + sessions.markDisconnected(session.sessionId), + backgroundPolicy.removeSession(session.sessionId), + ]).pipe(Effect.asVoid), ); }).pipe( Effect.catchTags({ diff --git a/apps/web/src/components/settings/SettingsPanels.tsx b/apps/web/src/components/settings/SettingsPanels.tsx --- a/apps/web/src/components/settings/SettingsPanels.tsx +++ b/apps/web/src/components/settings/SettingsPanels.tsx @@ -680,7 +680,14 @@ value === "performance" || value === "battery-saver" ) { - updateSettings(backgroundActivityProfileSettings(value)); + updateSettings({ + backgroundActivity: { + schemaVersion: 1 as const, + profile: "custom" as const, + baseProfile: value, + overrides: settings.backgroundActivity.overrides, + }, + }); } }} >
You can send follow-ups to the cloud agent here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
🚀 Expo continuous deployment is ready!
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Bugbot Autofix prepared a fix for the issue found in the latest run.
Or push these changes by commenting:
@cursor push 3c6ed7cfa6
diff --git a/apps/desktop/src/backend/DesktopBackendManager.ts b/apps/desktop/src/backend/DesktopBackendManager.ts --- a/apps/desktop/src/backend/DesktopBackendManager.ts +++ b/apps/desktop/src/backend/DesktopBackendManager.ts @@ -330,6 +330,10 @@ concurrency: "unbounded", discard: true, }).pipe(Effect.timeout(DEFAULT_BACKEND_OUTPUT_DRAIN_TIMEOUT), Effect.ignore); + yield* Effect.forEach(outputFibers, Fiber.interrupt, { + concurrency: "unbounded", + discard: true, + }).pipe(Effect.ignore); return exit; });
You can send follow-ups to the cloud agent here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
2b59d67 to
4a875db
Compare
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
There are 3 total unresolved issues (including 1 from previous review).
Bugbot Autofix prepared fixes for both issues found in the latest run.
Or push these changes by commenting:
@cursor push 54bbd4877a
diff --git a/apps/desktop/src/backend/DesktopBackendManager.ts b/apps/desktop/src/backend/DesktopBackendManager.ts --- a/apps/desktop/src/backend/DesktopBackendManager.ts +++ b/apps/desktop/src/backend/DesktopBackendManager.ts @@ -541,9 +541,6 @@ yield* logBackendManagerWarning("backend readiness check failed during bootstrap", { error: error.message, }); - yield* backendOutputLog.persistFailure({ - details: error.message, - }); }, ), onOutput: (streamName, chunk) => backendOutputLog.writeOutputChunk(streamName, chunk), diff --git a/apps/server/src/background/BackgroundPolicy.ts b/apps/server/src/background/BackgroundPolicy.ts --- a/apps/server/src/background/BackgroundPolicy.ts +++ b/apps/server/src/background/BackgroundPolicy.ts @@ -82,6 +82,7 @@ settings: ResolvedBackgroundActivitySettings, ): boolean { if (hostPower.stale) return false; + if (hostPower.suspended) return true; if ( (settings.pauseWhenHostLocked && hostPower.locked === "true") || hasThermalPressure(hostPower)
You can send follow-ups to the cloud agent here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
There are 5 total unresolved issues (including 3 from previous reviews).
Bugbot Autofix prepared fixes for both issues found in the latest run.
Or push these changes by commenting:
@cursor push b5ebfe1577
diff --git a/apps/server/src/provider/Layers/EventNdjsonLogger.ts b/apps/server/src/provider/Layers/EventNdjsonLogger.ts --- a/apps/server/src/provider/Layers/EventNdjsonLogger.ts +++ b/apps/server/src/provider/Layers/EventNdjsonLogger.ts @@ -318,7 +318,7 @@ } const sinks = new Map(input.state.sinks); - const failedSegments = new Set(input.state.failedSegments); + const failedSegments = new Set<string>(); const failures: Array<FileOperationFailure> = []; const attributionByStream = new Map< EventNdjsonStream, @@ -399,7 +399,7 @@ pendingBytes: 0, sinks, failedSegments, - flushScheduled: input.timerFired ? false : input.state.flushScheduled, + flushScheduled: false, closed: input.close, lastRetentionAt: retentionDue ? input.now : input.state.lastRetentionAt, }, @@ -557,7 +557,14 @@ if (action.flush) { yield* flush(false, false); } else if (action.schedule) { - yield* scheduleFlush(); + yield* scheduleFlush().pipe( + Effect.catchCause(() => + SynchronizedRef.update(stateRef, (state) => ({ + ...state, + flushScheduled: false, + })), + ), + ); } });
You can send follow-ups to the cloud agent here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
2f8211f to
8e2d5d3
Compare
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
There are 3 total unresolved issues (including 2 from previous reviews).
Bugbot Autofix prepared a fix for the issue found in the latest run.
Or push these changes by commenting:
@cursor push 8e66c61cc5
diff --git a/apps/server/src/diagnostics/ProcessDiagnostics.test.ts b/apps/server/src/diagnostics/ProcessDiagnostics.test.ts --- a/apps/server/src/diagnostics/ProcessDiagnostics.test.ts +++ b/apps/server/src/diagnostics/ProcessDiagnostics.test.ts @@ -101,9 +101,7 @@ const layer = ProcessDiagnostics.layer.pipe(Layer.provideMerge(telemetryLayer)); const diagnostics = yield* Effect.gen(function* () { - const telemetry = yield* ResourceTelemetry.ResourceTelemetry; const processDiagnostics = yield* ProcessDiagnostics.ProcessDiagnostics; - yield* telemetry.refresh; return yield* processDiagnostics.read; }).pipe(Effect.provide(layer)); diff --git a/apps/server/src/diagnostics/ProcessDiagnostics.ts b/apps/server/src/diagnostics/ProcessDiagnostics.ts --- a/apps/server/src/diagnostics/ProcessDiagnostics.ts +++ b/apps/server/src/diagnostics/ProcessDiagnostics.ts @@ -72,7 +72,8 @@ export const make = Effect.fn("makeProcessDiagnostics")(function* () { const telemetry = yield* ResourceTelemetry.ResourceTelemetry; - const read: ProcessDiagnosticsShape["read"] = telemetry.latest.pipe( + const read: ProcessDiagnosticsShape["read"] = telemetry.refresh.pipe( + Effect.catch(() => telemetry.latest), Effect.map((snapshot) => { const processes = snapshot.processes .filter((entry) => entry.identity.pid !== process.pid)
You can send follow-ups to the cloud agent here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
- drop browser-only local backend stubs in favor of desktop bridge - route resource telemetry through the subscription path Co-authored-by: codex <[email protected]>
Co-authored-by: codex <[email protected]>
Co-authored-by: codex <[email protected]>
Co-authored-by: codex <[email protected]>
Co-authored-by: codex <[email protected]>
Co-authored-by: codex <[email protected]>
Co-authored-by: codex <[email protected]>
Co-authored-by: codex <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Reviewed the new Effect services in this PR against the service conventions. Service definition, make/layer shape, namespace imports, dependency acquisition, and the ProviderEventLoggers/ProcessDiagnostics/ProcessResourceMonitor restructuring all look consistent, and the previously flagged binary.resolve collapse, fabricated timeout cause, and unused ProcessIdentityChanged union are resolved. Two remaining error-modelling issues in NativeTelemetryClient.ts.
Posted via Macroscope — Effect Service Conventions
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: codex <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
One finding on the new resource-telemetry service code. Previously flagged items (binary.resolve error collapsing, fabricated timeout cause, Cause.pretty in caller-visible lastError, unused ProcessIdentityChanged) are resolved in this revision.
Posted via Macroscope — Effect Service Conventions
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: codex <[email protected]>
Co-authored-by: codex <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.