fix(server): skip disabled settlement lookups - #10313
Conversation
ApprovabilityVerdict: Approved at 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. |
|
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 |
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.tspasses, 12/12, covering disabled timer and merge sweeps and re-enabling settlement.Checklist
Model: GPT-6 Astra
Harness: T3 code
Note
Skip settlement work in
ThreadSettlementReactor.sweepwhen both triggers disabledsweepmethod now reads server settings before loading the shell snapshot and returns immediately when merge-based settlement is disabled and the day-based interval is unsetmakeThreadSettlementHarnessrecords settings-service reads so tests can observe and assert on settings accessMacroscope summarized 68a4096.