Skip to content

Test a fault's bolus not delivered larger than the bolus in progress - #227

Merged
ps2 merged 2 commits into
devfrom
fix/bolus-not-delivered-cap
Nov 26, 2026
Merged

ps2 merged 2 commits into
devfrom
fix/bolus-not-delivered-cap

Conversation

@ps2

@ps2 ps2 commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

This PR adds tests for how a fault's bolus-not-delivered value is handled. It doesn't change any code.

An Omnipod 5 can report $07FF in the bolus-not-delivered word on a reset fault (0x22). After the 10-bit mask, that reads as 51.15 U (LoopKit/pod#32). UnfinalizedDose.cancel already ignores a remainder larger than the bolus. These tests pin that behavior down:

  • An 0x18 fault that reports $07FF during a 2 U bolus counts the whole 2 U as delivered, stopped at the fault minute.
  • A fault after an unacknowledged 4 U bolus that reports 1.8 U not delivered records 2.2 U.

OmniTests: 214 tests, 0 failures.

…us in progress

An Omnipod 5 0x22 reset fault has reported a bolus not delivered word of
$07FF, which decodes as 51.15 U. Any value larger than the bolus in progress
can't be right, so take the safe side and count the bolus as delivered, up
to the fault time, for every fault. This was already the effect of the
guard in UnfinalizedDose.cancel; now handlePodFault says so and logs the
raw value.

The check is made after an unacknowledged command is recovered, so a bolus
whose response was lost still has its real remainder subtracted.
@ps2 ps2 changed the title Count a fault's bolus not delivered as 0 when it is more than the bolus in progress Test a fault's bolus not delivered larger than the bolus in progress Nov 26, 2026

@itsmojo itsmojo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ps2
ps2 merged commit 4f59a04 into dev Nov 26, 2026
yurique added a commit to Artificial-Pancreas/OmnipodKit that referenced this pull request Nov 27, 2026
…unting, stale PeripheralManager, unresponsive pod handling

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
LucasSHYC pushed a commit to LucasSHYC/LoopWorkspace that referenced this pull request Dec 2, 2026
8df3d7be...4f59a04e
- Test a fault's bolus not delivered larger than the bolus in progress (loopandlearn/OmnipodKit#227); test only, no app code change

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dnzxy
dnzxy deleted the fix/bolus-not-delivered-cap branch December 2, 2026 23:58
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.

2 participants