Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): skip disabled settlement lookups #10313

Closedyashranaway(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/10313/headopened View on GitHub

What Changed

Check settlement settings before reading the shell snapshot or preparing candidates. Disabled timer and merge sweeps perform no snapshot or pull-request lookup work.

The final decision still reads fresh settings so disabling settlement during a lookup prevents a stale decision. Re-enabling the setting resumes settlement.

Why

Automatic settlement looks up candidate pull requests even when both settings are disabled, spawning Git and provider processes on each scheduled sweep.

Fixes #9714.

Testing

  • ThreadSettlementReactor.test.ts passes, 12/12, covering disabled timer and merge sweeps and re-enabling settlement.
  • Server typecheck, targeted lint, and formatting pass.

Checklist

  • One focused change
  • Explained what changed and why
  • Added regression coverage for the changed behavior
  • No UI layout or animation changes

Model: GPT-6 Astra Harness: T3 code

Note

Skip settlement work in ThreadSettlementReactor.sweep when both triggers disabled

  • The sweep method now reads server settings before loading the shell snapshot and returns immediately when merge-based settlement is disabled and the day-based interval is unset
  • Test harness makeThreadSettlementHarness records settings-service reads so tests can observe and assert on settings access
  • Adds a test verifying that startup, activation, timer, and merge sweeps perform no snapshot, pull-request, invalidation, or command work while both automatic-settlement settings are disabled, then resume after one is enabled
  • Behavioral Change: a disabled sweep now exits before the snapshot load, so existing tests that expected snapshot or lookup work during disabled sweeps have updated count expectations in ThreadSettlementReactor.test.ts
Macroscope summarized 68a4096.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at 68a4096

      Macroscope's review found this PR approvable — This is a focused server bug fix that avoids snapshot, Git, and pull-request lookups when both existing settlement options are disabled, while preserving enabled behavior. Regression tests cover startup, timer, merge, and re-enabling scenarios, and product defaults remain unchanged.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. Note

      🤖 Claude Fable 5.1 responding on behalf of Theo

      Rebased onto main as #10424 so this can land for the stable release. #10103 changed the same sweep function and test file, and my token could not push the rebase to your fork. Your commit and authorship are preserved. Only change: the rebased test asserts on dispatched commands instead of lookup counts, because inactive threads now settle without a PR lookup. Closing this in favor of #10424.

Sign in to join this conversation.