Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): skip disabled settlement lookups #10424

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/10424/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Rebase of #10313 by @yashranaway onto current main. My token could not push the rebase to the fork, so this carries the same commit with the conflicts resolved.

Problem

ThreadSettlementReactor.sweep ran the full shell snapshot read and pull request lookup before checking whether auto-settlement is enabled. With sidebarAutoSettleOnMerge: false and sidebarAutoSettleAfterDays: null a server with many worktrees still spawned about 50 git processes a minute for work that could never settle a thread. Reported in #9714.

Fix

Read settings first in sweep and return when both auto-settle options are off. The new test covers startup, timer, and merge sweeps while disabled, and confirms work resumes when a setting turns on. Since #10103 inactive threads settle without a PR lookup, so the rebased test asserts on dispatched commands rather than lookup counts.

Closes #9714. Supersedes #10313.

Rebased and verified by Claude Fable 5.1 in Claude Code. Original change by @yashranaway.

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. Approvability

      Verdict: Would Approve

      Macroscope's review found this PR approvable — The PR adds an early exit that prevents snapshot and pull-request lookups when both existing auto-settlement options are disabled, while preserving enabled behavior. Focused tests cover startup, timer, merge, and re-enable scenarios, and no product defaults or static-analysis settings are changed.

      Not approved because:

      • Monthly spending limit reached (workspace setting). Approvability relies on correctness review in order to determine eligibility
      Review your spending limits in [Billing settings](https://app.macroscope.com/pingdotgg/settings/billing). You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire13.5 KiB13.6 KiB+60 B (+0.4%)15.1 KiB✅
      CodexThread snapshot wire7.0 KiB7.0 KiB+1 B (+0.0%)7.3 KiB✅
      CodexLive turn WebSocket wire6.5 KiB6.6 KiB+59 B (+0.9%)7.8 KiB✅
      CodexLive turn WebSocket decoded57.0 KiB57.1 KiB+88 B (+0.2%)66.4 KiB✅
      CodexLive turn messages810+2 (+25.0%)21✅
      ClaudeTotal thread wire13.6 KiB13.6 KiB+52 B (+0.4%)15.1 KiB✅
      ClaudeThread snapshot wire7.0 KiB7.1 KiB+7 B (+0.1%)7.3 KiB✅
      ClaudeLive turn WebSocket wire6.5 KiB6.6 KiB+45 B (+0.7%)7.8 KiB✅
      ClaudeLive turn WebSocket decoded57.8 KiB57.9 KiB+88 B (+0.1%)66.4 KiB✅
      ClaudeLive turn messages810+2 (+25.0%)21✅

      Baseline: d6aa179 · PR result: 0a3ca8f · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 113.9 KiB
      • Claude decoded thread snapshot: 114.6 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Sign in to join this conversation.