Repository navigation
fix(mpc): drop the fuse-saturation replan; Core replans name their cause - #1824
Merged
Merged
Conversation
The fuse trigger and the startup replan called mpc.Service.Replan, which labels its plan "manual". On the home box on 25 Oct 2026 that put three "manual" replans at 02:35, 02:36 and 02:37 CET, each one second after "fuse-saturated → MPC replan triggered", with nobody at the box. All 54 "manual" replans there in the past week followed that trigger. The two callers now pass "fuse_saturated" and "startup". Replan keeps "manual" for POST /api/mpc/replan and tests. A test in cmd/ftw fails on any .Replan( call there, so the next trigger has to name its cause. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
When the joint allocator held the battery or an EV under the fuse, Core started a new plan on the rising edge, at most once a minute. The new plan could not end the overage, which live dispatch already holds, so a charging night got several replans an hour with nothing to gain. Fredrik asked to remove it (25 Oct 2026). The startup replan keeps its own reason; "manual" is the Replan button only. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Update: the fuse-saturation replan is removed (3e5856c)
Fredrik decided (25 Oct 2026) to remove the trigger rather than rename it. While the car wants more than the fuse allows, the rising edge fired again after each 60 s cooldown, about six times an hour on a charging night. The new plan cannot end the overage, which live dispatch already holds, so the replan protected nothing. The block in
go/cmd/ftw/main.goand its state (prevFuseSaturated,lastFuseReplan,fuseReplanCooldown) are gone;ctrl.FuseSaturatedstill feeds the feedback it fed before. The startup replan keepsstartup, and "manual" now means only the Replan button. The changeset says so.Problem
On 25 Oct 2026 the home box (v0.155.1-beta.1) logged three replans with
reason=manual, at 02:35:08, 02:36:20 and 02:37:23 CET. Nobody asked for them. Each one came about one second after Core's own fuse trigger:The Easee car was charging; at 02:35:03 the fuse clamp cut it from 10 350 W to 9 660 W. The journal shows no API, app, relay, cloud, agent or loadpoint goal event between 02:30 and 02:40. In the past week all 54
manualreplans on the box followed this trigger. The clock change did not cause it: the same pattern ran at 02:45–02:52 CEST on 19 Oct.Cause
The fuse trigger in
go/cmd/ftw/main.gocallsmpcSvc.Replan(ctx), andReplanlabels its planmanual(go/internal/mpc/service.go). The startup replan does the same. The Plan page then shows "replanned 1m ago (manual)", and the plan history and the support report give a manual trigger.Change
fuse_saturated. The startup replan passesstartup.ReplankeepsmanualforPOST /api/mpc/replanand tests. Its comment now says so.TestCoreReplansNameTheirCausereadsgo/cmd/ftwand fails on any.Replan(call there. On master it fails onmain.go:1901andmain.go:3262; on this branch it passes.Core replans at the same moments as before. Only the label changes. No web code changes; the Plan page prints the new reason as it prints the others (
missing_plan_retry,loadpoint_ev_stopped).Left as is
While the car wants more than the fuse allows, the flag rises again after the 60 s cooldown, and Core replans again. The new plan does not end the overage, so a charging night gives a few of these an hour (six between 02:00 and 03:00 CET). Dispatch already holds the fuse, so the replan carries no safety duty. Whether to keep it is a separate decision.
Evidence
go vet ./internal/... ./cmd/ftw/...: clean.go test ./internal/... ./cmd/ftw/...with drivers fetched: all pass exceptinternal/energyreportandinternal/statsrelay, which fail the same way on clean master on this laptop and pass in master CI.🤖 Generated with Claude Code