GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Reduce idle work and disk churn with native resource diagnostics by juliusmarminge · Pull Request #2679 · pingdotgg/t3code

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented May 13, 2026 •
edited by macroscopeapp Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Intent

Reduce T3 Code's steady-state resource usage, bound local observability disk churn, and make CPU, memory, power-state, and I/O regressions observable enough to debug.

Before this PR:

  • provider status refreshes, VCS remote refreshes, and other background work followed fixed schedules even when nobody needed the result;
  • process diagnostics repeatedly spawned ps or PowerShell, adding process churn while still missing short-lived work between samples;
  • macOS power state came from recurring shell probes;
  • the diagnostics page could show sampled CPU and memory, but had no process I/O counters, collector health, Electron overhead, or application-level write attribution;
  • native and canonical provider events used independent rotators against the same thread files, retained duplicate streaming deltas, and had no aggregate age or byte budget;
  • high-frequency provider-log and preview debugger operations generated their own Effect trace records.

This PR replaces those paths with a demand-aware background policy plus a persistent, cross-platform telemetry pipeline.

Runtime architecture

Electron main
  ├─ powerMonitor events and state
  ├─ app.getAppMetrics()
  └─ NDJSON over inherited fd 4
                         ┐
                         ▼
Node server ── NDJSON stdio ── persistent Rust resource monitor
     │
     ├─ ResourceTelemetry Effect service
     ├─ bounded in-memory history and I/O attribution
     ├─ HostPowerMonitor → BackgroundPolicy
     └─ typed RPC/subscription → diagnostics UI

The native monitor is intentionally a standalone executable, not an N-API or FFI module. One persistent child process gives the server a supervised crash boundary, avoids Node/Electron ABI coupling, and eliminates recurring process-table subprocesses. The same protocol and binary layout work for desktop and the published CLI.

What changed

Demand-aware background work

  • Adds an Effect BackgroundPolicy service that combines:
    • active client leases and requested scopes;
    • visibility, focus, recent interaction, app state, battery, and low-power hints;
    • host lock, suspend, battery, low-power, and thermal constraints;
    • balanced, performance, and battery-saver profiles with interval overrides.
  • Clients retain scopes for the data they currently need, such as a repository's VCS status or a provider instance's status.
  • Provider refreshes and VCS remote polling consult the policy instead of blindly running on fixed cadences.
  • Settings and reporting flows expose the policy without coupling individual background services to renderer state.

Native and Electron telemetry

  • Adds native/resource-monitor, a Rust sidecar backed by OS APIs through sysinfo.
  • Samples the server, all descendants, provider-spawned grandchildren such as node, tsgo, language servers and shells, Electron roots, Electron descendants, and the monitor itself.
  • Reports process identity (pid, startTimeMs), parent/child relationships, command line, CPU, cumulative CPU time, resident/virtual memory, cumulative I/O counters, and collection cost.
  • Disables Linux task/thread enumeration and avoids repeatedly reloading command lines.
  • Uses Electron powerMonitor and app.getAppMetrics() for battery/AC state, lock/idle, suspend/resume, thermal state, CPU speed limits, Electron CPU/memory, and idle wakeups.
  • Sends Electron-main data directly to the server over fd 4. It does not route telemetry through the renderer WebSocket.

Diagnostics, history, and safety

  • Adds a schema-backed ResourceTelemetry service that merges native and Electron samples, computes rates from cumulative counters, classifies process groups, and publishes live snapshots.
  • Adds bounded, in-memory history for CPU, memory, I/O, process lifecycle, and collector health. Telemetry is not persisted to disk.
  • Expands diagnostics with:
    • backend, Electron, monitor, and total resource groups;
    • live process tree and process lifecycle counters;
    • CPU, memory, and I/O history;
    • power and thermal state;
    • collector status, restart count, scan duration, and explicit retry;
    • logical write attribution for provider event logs and local trace output.
  • Reuses this service for the legacy process diagnostics RPCs, removing the old ps/PowerShell implementations entirely.
  • Validates process signals against both PID and start time and only permits signalable backend descendants; Electron and monitor processes remain visible but protected.

Bounded local observability

  • Replaces the competing native and canonical provider rotators with one shared, thread-aware log store.
  • Keeps full provider-native diagnostics while dropping duplicate transient canonical events such as content, item, task, hook, tool, proposal, and realtime audio deltas before serialization. Final states, warnings, and errors remain available.
  • Flushes provider records in demand-driven 1-second batches with byte and record thresholds; there is no permanent polling timer.
  • Enforces a 512 MiB aggregate provider-log budget and 14-day age limit, pruning oldest files at startup and during sustained writes.
  • Removes trace spans from provider-log writes and per-message Electron preview debugger handlers, which were dominant trace hot paths.
  • Closes adapter-owned log stores consistently, including the Claude adapter path.

Reliability and packaging

  • Models monitor resolution, protocol, transport, and refresh failures as schema-backed tagged error unions with descriptive messages.
  • Supervises the sidecar with version negotiation, bounded restart backoff, a failure circuit, health transitions, and manual retry.
  • Handles sidecar sequence resets across restarts and preserves native rates during Electron-only updates.
  • Builds and packages platform executables in desktop resources and CLI releases for supported macOS, Linux, and Windows targets.
  • Adds CI coverage for Rust formatting/tests and release wiring for per-platform artifacts.

Metric semantics and limits

  • Sampling is once per second, not syscall or process-lifecycle tracing. A process that starts and exits entirely between samples can still be missed.
  • Unix-like and Windows process I/O counters have different OS semantics, and filesystem caches mean they are not guaranteed to equal physical SSD traffic. The UI therefore labels them as I/O reads/writes, not disk reads/writes.
  • Application attribution reports known logical writes from instrumented T3 Code components; it complements rather than replaces process-level OS counters.
  • Headless/web servers still receive native process telemetry. Electron-specific power fields degrade to unknown instead of falling back to shell probes.
  • Collector failures degrade telemetry without taking down the server.

Validation

  • vp check
  • vp run typecheck
  • full server suite: 1,243 passed, 7 skipped
  • focused provider-log regression suite: 9 passed
  • 11 VCS/background-policy merge-integration tests
  • cargo fmt --manifest-path native/resource-monitor/Cargo.toml -- --check
  • cargo test --locked --manifest-path native/resource-monitor/Cargo.toml (6 tests)
  • cargo clippy --manifest-path native/resource-monitor/Cargo.toml -- -D warnings
  • vp run build:desktop
  • Live sidecar smoke test against the local process table, including full command-line and I/O output

Note

High Risk
Large cross-cutting change to desktop backend spawn/teardown, release packaging, and new native binaries; incorrect fd/protocol handling or restart races could break backend startup or diagnostics, though coverage is extensive in tests.

Overview
Adds a Rust t3-resource-monitor sidecar with CI formatting/tests and release artifacts per platform (mac/linux/win), bundled into the CLI and resolved from packaged resources or dev target/release for the desktop primary backend. WSL backends intentionally omit the monitor path.

Electron main now publishes NDJSON host telemetry (DesktopTelemetryPublisher + ElectronPowerMonitor) over inherited fds 4/5 alongside the fd 3 bootstrap; the backend manager wires control messages, demand-gated app.getAppMetrics(), and cleans up telemetry sources on stop/restart.

Backend child logging no longer writes stdout/stderr continuously: output is buffered (1 MiB / chunk limits) and flushed to server-child.log only on failure or readiness-timeout snapshots; normal shutdown discards the session. Trace batching widens to 1 s and per-chunk output tracing is removed.

Desktop backend process management gains structured tagged errors, post-exit output draining, readiness-timeout context, and safer stop/start/restart behavior (including restart during teardown and timed-out stop).

Mobile reports client activity leases and retains background scopes (e.g. VCS, diagnostics) while subscriptions are active.

Server adds a compile-time RPC_REQUIRED_SCOPES map so every WebSocket RPC (including background policy and resource telemetry) has an explicit auth scope.

Preview forwards debugger screencast frames to recording listeners only while recording is active.

Reviewed by Cursor Bugbot for commit 6b8a516. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add native resource monitor sidecar and background activity policy to reduce idle work and disk churn

  • Introduces a Rust native sidecar (main.rs) that samples system/process metrics via a JSON protocol; the server spawns and communicates with it through NativeTelemetryClient and ResourceMonitorBinary.
  • Adds a BackgroundPolicy service that tracks client activity leases, host power state, and per-scope demand to gate whether periodic background work (provider health refreshes, VCS remote polling) actually runs.
  • Adds ResourceTelemetry pipeline (NativeTelemetryClient → DesktopTelemetryReceiver → ResourceAttribution → ResourceTelemetry) and exposes history, retry, and live-subscription RPCs to clients.
  • Desktop backend now wires ElectronPowerMonitor and DesktopTelemetryPublisher to stream Electron process metrics and power state to the server over dedicated FDs (4/5).
  • Web and mobile clients gain background activity reporters that retain scope leases while subscriptions are active and periodically report visibility/focus/app-state to the server.
  • Provider health refresh loop and VCS remote refresh loop skip work when BackgroundPolicy reports no foreground demand, and the refresh interval is now driven by ServerSettingsService with a new structured backgroundActivity settings model.
  • EventNdjsonLogger is refactored into a shared log store with batched writes, size-bounded rotation, transient-event filtering, and periodic retention enforcement to reduce disk churn.
  • RotatingFileSink no longer triggers an immediate rotation after a write; rotation is deferred to the next write cycle.
  • Risk: LocalApi browser facade no longer exposes server.* methods or shell.openInEditor; callers that previously received a rejected Promise will now see undefined properties.

Macroscope summarized 6b8a516.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@coderabbitai

coderabbitai Bot commented May 13, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: db92ffbb-f25e-4d12-94a9-61f4c23ece27

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/a55b49df

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
juliusmarminge marked this pull request as draft May 13, 2026 22:23
@juliusmarminge
juliusmarminge marked this pull request as draft May 13, 2026 22:23
@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list. labels May 13, 2026
macroscopeapp[bot]
macroscopeapp Bot reviewed May 13, 2026
View reviewed changes
Comment thread apps/web/src/hooks/serverSettingsWriteQueue.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed May 13, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for 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.

Autofix Details

Bugbot Autofix prepared fixes for both issues found in the latest run.

  • ✅ Fixed: Legacy patch fields silently override explicit backgroundActivity patch
    • Added a guard to skip computing backgroundActivityPatch when the explicit backgroundActivity field is present in the patch, ensuring new-style patches take precedence over legacy fields.
  • ✅ Fixed: Duplicated utility functions across settings panel files
    • Extracted BackgroundActivityOverridePatch, durationToSeconds, normalizeIntervalSeconds, backgroundActivityOverrideSettings, and BackgroundPolicyTooltip into a shared backgroundActivityUtils.tsx module imported by both SettingsPanels.tsx and SourceControlSettings.tsx.

Create PR

Or push these changes by commenting:

@cursor push 6d184f0660
Preview (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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/shared/src/serverSettings.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/web/src/components/settings/SourceControlSettings.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

@macroscopeapp

macroscopeapp Bot commented May 13, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@guilhermelippert guilhermelippert mentioned this pull request May 15, 2026
[Bug]: Codex provider drains plan credits while T3 Code is idle in background (Codex equivalent of #2191) #2720
Closed
2 tasks done
@juliusmarminge
juliusmarminge force-pushed the t3code/a55b49df branch from 038e209 to 8da0859 Compare May 20, 2026 08:44
@juliusmarminge
juliusmarminge marked this pull request as ready for review May 20, 2026 08:44
macroscopeapp[bot]
macroscopeapp Bot reviewed May 20, 2026
View reviewed changes
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Jun 16, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for 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.

Autofix Details

Bugbot Autofix prepared fixes for all 3 issues found in the latest run.

  • ✅ Fixed: VCS scope cwd mismatch
    • Added a scopeCwd parameter to makeRemoteRefreshLoop and retainRemotePoller that passes the raw (un-normalized) input.cwd to shouldRunScopeWork, ensuring scope keys match the client's lease scopes.
  • ✅ Fixed: Disconnect never clears leases
    • Added removeSession method to BackgroundPolicy that removes leases by sessionId, and wired it into the WebSocket disconnect handler's acquireUseRelease release function.
  • ✅ Fixed: Advanced dialog clears overrides
    • Changed the Advanced dialog's shared policy Select to update baseProfile while keeping profile as 'custom' and preserving existing overrides, instead of calling backgroundActivityProfileSettings which resets everything.

Create PR

Or push these changes by commenting:

@cursor push 44ee7a6c3a
Preview (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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/server/src/vcs/VcsStatusBroadcaster.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/background/BackgroundPolicy.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/web/src/components/settings/SettingsPanels.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Jun 16, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

🚀 Expo continuous deployment is ready!

  • Project → t3-code
  • Platforms → android, ios
  • Scheme → t3code-preview
  🤖 Android 🍎 iOS
Fingerprint 27e228668e373d1941548dc669856ecf3fd6261f fa880122b8876ecaafbb21281d21e292d7b09484
Build Details Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: 27e228668e373d1941548dc669856ecf3fd6261f
App version: 0.1.0
Git commit: 47234257cf10fea3f507f57916355a6ae1cde29c
Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: fa880122b8876ecaafbb21281d21e292d7b09484
App version: 0.1.0
Git commit: 8ef95c479ae1c01cbd33365fe792b762398ffd5d
Update Details Update Permalink
DetailsBranch: pr-2679
Runtime version: 27e228668e373d1941548dc669856ecf3fd6261f
Git commit: 47234257cf10fea3f507f57916355a6ae1cde29c
Update Permalink
DetailsBranch: pr-2679
Runtime version: fa880122b8876ecaafbb21281d21e292d7b09484
Git commit: 47234257cf10fea3f507f57916355a6ae1cde29c
Update QR
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

macroscopeapp[bot]
macroscopeapp Bot reviewed Jun 16, 2026
View reviewed changes
Comment thread apps/server/src/ws.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@t3dotgg t3dotgg changed the title Add background activity policy and host power monitoring Add native resource telemetry and demand-aware background scheduling Jun 17, 2026
@t3dotgg t3dotgg changed the title Add native resource telemetry and demand-aware background scheduling Reduce idle work and improve resource diagnostics with native telemetry Jun 17, 2026
cursor[bot]
cursor Bot reviewed Jun 17, 2026
View reviewed changes
Comment thread apps/server/src/resourceTelemetry/NativeTelemetryClient.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Jun 17, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for 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).

Autofix Details

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Output drain timeout drops logs
    • Added Fiber.interrupt for all output fibers after the 250ms drain timeout so that still-running fibers are stopped before persistFailure snapshots and clears the session buffer, preventing late chunks from being lost.

Create PR

Or push these changes by commenting:

@cursor push 3c6ed7cfa6
Preview (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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/desktop/src/backend/DesktopBackendManager.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge mentioned this pull request Jun 18, 2026
[Bug]: Extreme energy consumption, 12hr power 136x higher than comparable Electron apps #3143
Closed
2 tasks done
@juliusmarminge
juliusmarminge force-pushed the t3code/a55b49df branch from 2b59d67 to 4a875db Compare June 19, 2026 04:22
cursor[bot]
cursor Bot reviewed Jun 19, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for 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).

Autofix Details

Bugbot Autofix prepared fixes for both issues found in the latest run.

  • ✅ Fixed: Readiness timeout writes failure logs
    • Removed the persistFailure call from onReadinessFailure since the backend process is still running during a readiness timeout and failure logs should only be persisted on actual process exit via finalizeRun.
  • ✅ Fixed: Host suspend does not gate work
    • Added an early return of true in isHostConstrained when hostPower.suspended is true, so background work is paused during host suspend.

Create PR

Or push these changes by commenting:

@cursor push 54bbd4877a
Preview (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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/desktop/src/backend/DesktopBackendManager.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/background/BackgroundPolicy.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

macroscopeapp[bot]
macroscopeapp Bot reviewed Jun 19, 2026
View reviewed changes
Comment thread apps/server/src/resourceTelemetry/ResourceMonitorBinary.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/desktop/src/telemetry/DesktopTelemetryPublisher.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

This was referenced Jun 20, 2026
[codex] Structure Electron app boundary failures #3301
Merged
[codex] Structure macOS passkey signing failures #3303
Merged
[codex] Preserve desktop user-data probe failures #3304
Merged
@juliusmarminge juliusmarminge changed the title Reduce idle work and improve resource diagnostics with native telemetry Reduce idle work and disk churn with native resource diagnostics Jun 23, 2026
cursor[bot]
cursor Bot reviewed Jun 23, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for 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).

Autofix Details

Bugbot Autofix prepared fixes for both issues found in the latest run.

  • ✅ Fixed: Stuck flush flag drops batched logs
    • Changed drainPending to always clear flushScheduled to false after any flush (not just timer-fired), and added catchCause on scheduleFlush to reset the flag if the fork fails, preventing the flag from getting stuck.
  • ✅ Fixed: Flush failure disables thread logging
    • Changed drainPending to initialize failedSegments as a fresh empty set each drain instead of carrying over from state, so transient I/O errors no longer permanently block logging for a thread segment.

Create PR

Or push these changes by commenting:

@cursor push b5ebfe1577
Preview (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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/server/src/provider/Layers/EventNdjsonLogger.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/provider/Layers/EventNdjsonLogger.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
juliusmarminge force-pushed the t3code/a55b49df branch from 2f8211f to 8e2d5d3 Compare June 23, 2026 19:38
cursor[bot]
cursor Bot reviewed Jun 23, 2026
View reviewed changes

@cursor cursor Bot left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for 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).

Autofix Details

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Process diagnostics use stale cache
    • ProcessDiagnostics.read now attempts telemetry.refresh before mapping the snapshot, falling back to the cached latest on failure, ensuring on-demand reads always trigger a fresh sample from the native sidecar.

Create PR

Or push these changes by commenting:

@cursor push 8e66c61cc5
Preview (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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/server/src/diagnostics/ProcessDiagnostics.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

juliusmarminge and others added 8 commits July 29, 2026 13:56
@juliusmarminge @codex
Remove legacy local backend and telemetry RPC
7e86327
- drop browser-only local backend stubs in favor of desktop bridge
- route resource telemetry through the subscription path

Co-authored-by: codex <[email protected]>
@juliusmarminge @codex
Reduce provider observability disk churn
b2c8abc
Co-authored-by: codex <[email protected]>
@juliusmarminge @codex
Polish resource diagnostics and harden RPC scopes
53f2a8f
Co-authored-by: codex <[email protected]>
@juliusmarminge @codex
Address observability review findings
e0c0618
Co-authored-by: codex <[email protected]>
@juliusmarminge @codex
Address remaining observability review findings
c6f7b41
Co-authored-by: codex <[email protected]>
@juliusmarminge @codex
fix(desktop): honor backend stop deadlines
a2c20a4
Co-authored-by: codex <[email protected]>
@juliusmarminge @codex
fix(desktop): decode packaged host telemetry
51ca44e
Co-authored-by: codex <[email protected]>
@juliusmarminge @codex
fix(server): preserve telemetry error structure
c779e8b
Co-authored-by: codex <[email protected]>
macroscopeapp[bot]
macroscopeapp Bot reviewed Jul 29, 2026
View reviewed changes

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/server/src/resourceTelemetry/NativeTelemetryClient.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/server/src/resourceTelemetry/NativeTelemetryClient.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

macroscopeapp[bot]
macroscopeapp Bot reviewed Jul 29, 2026
View reviewed changes
Comment thread docs/architecture/resource-telemetry.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/web/src/components/settings/SettingsPanels.tsx Resolved

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge @codex
fix(server): bound telemetry supervisor failures
f09c4be
Co-authored-by: codex <[email protected]>
macroscopeapp[bot]
macroscopeapp Bot reviewed Jul 29, 2026
View reviewed changes

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread apps/server/src/resourceTelemetry/DesktopTelemetryReceiver.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

macroscopeapp[bot]
macroscopeapp Bot reviewed Jul 29, 2026
View reviewed changes
Comment thread apps/desktop/src/backend/DesktopBackendManager.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/contracts/src/background.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

juliusmarminge and others added 2 commits July 29, 2026 14:12
@juliusmarminge @codex
fix(settings): preserve advanced activity overrides
1d7c529
Co-authored-by: codex <[email protected]>
@juliusmarminge @codex
fix(observability): close lifecycle resource gaps
6b8a516
Co-authored-by: codex <[email protected]>
@UtkarshUsername UtkarshUsername mentioned this pull request Jul 29, 2026
perf(server): fix N+1 PowerShell process query and reduce sampling frequency #4829
Closed
2 of 4 tasks
@jakeleventhal jakeleventhal mentioned this pull request Jul 29, 2026
Refresh working tree diff after turns #3906
Closed
@t3code-tarik02 t3code-tarik02 Bot mentioned this pull request Jul 30, 2026
prepare stable release 2026.8.700 tarik02-org/t3code#95
Merged
@NoahHendrickson NoahHendrickson mentioned this pull request Jul 30, 2026
sync: absorb upstream v0.0.31 (34 commits) NoahHendrickson/no3ycode#38
Merged
@PLN PLN mentioned this pull request Jul 30, 2026
[Bug]: Excessive CPU usage on Windows #4182
Closed
2 tasks done
@aaditagrawal aaditagrawal mentioned this pull request Jul 31, 2026
sync: port upstream resource diagnostics, thread search, file picker, docs split (#2679–#4992) aaditagrawal/t3code#195
Merged
@jakob1379 jakob1379 mentioned this pull request Jul 31, 2026
t3code: 0.0.30 -> 0.0.31 NixOS/nixpkgs#547678
Merged
5 of 13 tasks
This was referenced Aug 1, 2026
perf(server): reduce Windows WMI polling #4339
Closed
[Bug]: Fix Windows WMI polling overhead #4024
Closed
fix(server): speed up Windows diagnostics and editor discovery #3911
Closed
@dominicwild dominicwild mentioned this pull request Aug 9, 2026
[Bug]: Windows port discovery re-spawns a doomed PowerShell/WMI probe every 3 s (the port-scanner half of #4182, not fixed by #2679) #5900
Closed
2 tasks done
@juliusmarminge juliusmarminge mentioned this pull request Sep 7, 2026
perf(telemetry): reduce idle resource monitoring CPU #5345
Closed
@SkiTee3000 SkiTee3000 mentioned this pull request Sep 11, 2026
t3-resource-monitor samples every process on the machine every 5 s with no live subscriber and cannot be turned off #11222
Closed
@only21mil only21mil mentioned this pull request Oct 22, 2026
fix(server): provider logs of finished threads obey retention limits #23274
Merged
@only21mil only21mil mentioned this pull request Nov 1, 2026
refactor(server): check background lease expiry in one place #28760
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] left review comments
@cursor cursor[bot] cursor[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@juliusmarminge
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.