Skip to content

Fault 0x31 on a bolus sent while a bolus is running - #38

Merged
ps2 merged 1 commit into
mainfrom
fault-31-bolus-during-bolus
Nov 30, 2026
Merged

ps2 merged 1 commit into
mainfrom
fault-31-bolus-during-bolus

Conversation

@ps2

@ps2 ps2 commented Nov 30, 2026

Copy link
Copy Markdown

A bolus sent while a bolus is running now faults the simulated pod with 0x31 (049, insulin delivery command error), as a real pod does.

In a DASH field report, the phone sent a third prime 15 s into a cannula insertion bolus, and the pod faulted with 0x31. Its detailed status kept the sequence number of the previous program, not the one that faulted it. It also reported that previous bolus's 37 undelivered pulses as bolus not delivered. So the simulator takes neither the new bolus nor its sequence number, and SetFault stops the running bolus the way it does for any fault.

Tested end to end in the iOS Simulator with OmnipodKit dev (plus next-dev's e60e0ab, so the Simulator talks to the pod) and the pod setup failure from loopandlearn/OmnipodKit#228:

  1. The initial basal schedule was left unacknowledged (crashNextCommand after processing).
  2. Tapping Pair Pod in settings re-sent the prime, which the pod took as the cannula insertion bolus.
  3. Reopening setup during that bolus sent a third prime. Loop then showed "Critical Pod Fault 049".

New tests: TestABolusWhileABolusIsRunningFaults0x31, and TestABolusAfterTheLastOneEndedIsTaken for the case without a fault. go test ./pkg/... passes.

A real pod faults with 0x31 (049, insulin delivery command error) when
it gets a bolus while one is running. It takes neither the new bolus nor
its sequence number: in a field report, a third prime sent during a
cannula insertion bolus faulted the pod, whose detailed status kept the
previous program's sequence number and that bolus's undelivered pulses.

The simulator now does the same, so a phone that sends a bolus during a
bolus sees the fault it would see with a real pod.

@marionbarker marionbarker left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approve with a positive Claude review and a test build on an rPi.
Reconnected the updated rPi to an existing instance of OS-AID running the rPi.

  • connects fine after fresh build
  • deactivate worked as expected
  • pair/prime/insert worked as expected

@ps2
ps2 merged commit a06cbfc into main Nov 30, 2026
1 check passed
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