fix(compare) compare tariffs using stale iBoost plan from live tariff - #4661
Open
chickenonaraft88 wants to merge 1 commit into
Open
Conversation
chickenonaraft88
marked this pull request as draft
August 22, 2026 21:57
chickenonaraft88
marked this pull request as ready for review
August 22, 2026 21:58
…ariff iboost_plan (the low-rate slots iBoost may run in) was only ever computed once against the live tariff's rates. Compare scenarios swapped in each tariff's own rates but reused that stale plan, so iBoost timing in a compare-plan reflected the current live tariff instead of the one being compared. Add recompute_iboost(), matching the existing recompute_car_charging pattern, and call it per tariff in run_single(). Save/restore iboost_plan in run_all() alongside iboost_today. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
chickenonaraft88
force-pushed
the
worktree-fix-iboost-compare-recompute
branch
from
August 22, 2026 22:16
8569d33 to
6665ac1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
compare.py'srun_single()swaps in each compared tariff's own import/export rates, butiboost_plan(the low-rate slots iBoost is allowed to run in) was only ever computed once, at startup, against the live tariff's rates. Every tariff comparison reused that same stale plan, so a compare-plan's iBoost timing reflected your current live tariff instead of the tariff actually being compared — it would show iBoost running at your live tariff's cheap period even on a tariff with a completely different rate structure.Fix
recompute_iboost()toCompare, mirroring the existingrecompute_car_charging()pattern, and call it per tariff inrun_single()right before the car charging recompute.fetch.py's existing logic for when the live plan buildsiboost_plan, so Compare now decides whether/how to plan iBoost exactly the same way the real plan does.iboost_planinrun_all()alongsideiboost_today, so the live plan's iBoost schedule isn't left clobbered by whichever tariff ran last.Before / after
Before the fix — iBoost only ran on the current tariff's cheap slot, and on "EDF Go Electric" it ran during the expensive daytime rate instead of that tariff's own cheap overnight period:
Current tariff

Other tariff

After the fix — each tariff's compare-plan now schedules iBoost against its own rates, running during EDF Go Electric's cheap overnight window while the battery charges:
Current tariff

Other tariff

Test plan
test_compare.pyT13/T14 coveringrun_single()recomputingiboost_planper tariff, and clearing it when smart-rate planning doesn't apply./run_all --test compare --test iboost_smartpasses./run_all --quickpasses (one pre-existing unrelated flaky failure infox_api'stest_run_midnight_reset, confirmed present without this change too)