Skip to content

fix(autoisf): unlock lgsThreshold pref + remove SMB objective gate - #4

Merged
alex-poor merged 2 commits into
mainfrom
fix/autoisf-lgs-and-smb-gate
Nov 20, 2026
Merged

alex-poor merged 2 commits into
mainfrom
fix/autoisf-lgs-and-smb-gate

Conversation

@alex-poor

Copy link
Copy Markdown
Owner

Two independent fixes that make the autoISF plugin behave as an experienced operator expects.

1. Honour the lgsThreshold preference (was inert)

Mainline ships the lgsThreshold override commented out in DetermineBasalAutoISF.kt, while DetermineBasalSMB.kt keeps it active (both from base commit 43cc754677). So the user's Low Glucose Suspend threshold silently did nothing whenever autoISF was the active APS — the suspend floor fell back to the target-derived default (min_bg − 0.5·(min_bg−40), ≈4.4 mmol at target 6.5). Re-enabled the block, identical to the SMB plugin's. The pref still only raises the floor above the derived value.

2. Remove the SMB objective gate

ObjectivesPlugin.isSMBModeEnabled forced SMB off unless the SMB objective was started. After a CamAPS→autoISF switch that objective was never started, so SMB was silently disabled for days and autoISF ran basal-only. Removed the objective-progression gate. SMB is still gated by closed-loop (SafetyPlugin) and the use_smb preference, so the real safety checks are untouched. Test updated accordingly.

Testing

  • :plugins:aps + :plugins:constraints compile; ObjectivesPluginTest updated + passing.
  • Built as a loop APK and installed live (3.4.2.3-hovorka-autoisf-unlock): loop looping, no more Objective 8 not started, algorithm now logs SMB requested.

🤖 Generated with Claude Code

alex-poor and others added 2 commits November 20, 2026 21:48
Mainline ships the lgsThreshold override commented out in the autoISF
determine_basal (DetermineBasalSMB keeps it active), so the user's Low
Glucose Suspend threshold setting silently did nothing whenever autoISF was
the active APS — the suspend floor fell back to the target-derived default
(~4.4 mmol at target 6.5). Re-enable the block, identical to the SMB
plugin's, so the pref can raise the floor.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ing objectives

isSMBModeEnabled forced SMB off whenever the SMB objective was not started.
After the CamAPS->autoISF switch that objective was never started, so SMB
was silently disabled for an experienced operator who has run SMB on this
loop before — autoISF ran basal-only for days. Remove the objective-
progression gate. SMB is still gated by closed-loop (SafetyPlugin) and the
use_smb preference, so the real safety checks are untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant