Repository navigation
Conversation
A car that stopped asking for current stayed out of the plan until it was unplugged. While it stays plugged in with a goal to meet, Core now ends that refusal an hour after it formed, or when a new goal window starts, at most once an hour. A car that is full or at its own limit declines again and the latch re-forms after 90 s. No retry for a met goal, a car whose fresh reading is Complete or at its limit, a passed one-time deadline, a charger Core may not command, or while Charge now holds. The plan replans when a refusal forms and when it ends, so a retry costs one short offer. Decision: Fredrik, 25 November 2026. Refs #2080 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Fredrik Ahlgren <fredrik@sourceful-labs.com>
Codex Review Summary: ✅ CompletedThis 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. |
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.
Refs #2080. Stacked on #2082 (base
fix-2080); retarget tomasterbefore #2082 merges.Decision (Fredrik): FTW offers a car that declined current again later in the same plug-in, with a time bound.
Rule
A car that stops asking for current while Core offers it latches
charging_declinedafter 90 s (unchanged), and the plan leaves it out. While the car stays plugged in, Core ends that latch once, and the plan takes the car in again:DeclineRetryInterval(1 hour) after the car declined, orCore ends a latch at most once per interval, so a car that always declines is offered current at most once an hour, deadline rolls included. A car that is full or at its own limit declines again, and the latch re-forms after the usual 90 s. The plan then decides when the offer comes, as for any planned car.
No retry when:
Completeor at its charge limit;Registry.CanControl; an approved OCPP charger counts), disabled, offline, or dispatch is held (the check runs after the controller's existing gates);Unplug, a higher goal, Charge now, measured charging, a corrected level, and a vehicle-limit car reporting
Chargingstill clear the latch at once.The plan also follows the latch's edges at once. A new edge check beside the EV-stop replan requests a replan when the latch forms (
loadpoint_declined) and when it ends while plugged in (loadpoint_decline_ended). Before, the old plan kept offering a declining car, or held back a car that may charge, until the next scheduled replan. That bounds the cost of a retry to one short offer.Why an hour
A retry against a car that is full or at its own limit costs the 90 s refusal window, plus the charger's start delay (Easee: up to about 5 min at 6 A, per the driver's start-boost note) and two replans. An hour keeps that under a tenth of the time.
An hour is also longer than both the Easee start delay and
LoadBalancerRaiseWait(15 min, #2050), so one retry has ended before the next can begin. Neither is affected: the retry only runs while Core holds the charger at 0 A. The latch re-forms only on the car's own refusal (Easee reason 50 or op mode 4), never on a load-balancer hold, which keepsrequest_activetrue.And an hour is short enough that a car that paused on its own (a timer in the car, a cold battery) loses at most an hour of a night's charging.
What the owner sees
While latched: "Car not taking power" (
vehicle_not_requesting, #2082). During a retry: the normal offer verdicts (waiting for response, thenvehicle_declinedif the car refuses for 90 s, or charging). No new reason names, settings or UI.Tests
New in
go/internal/loadpoint/controller_decline_retry_test.go. The rig runs the controller tick, schedule roll and a planner stand-in that, like Core's, leaves out a declined car. The car refuses offers, and the charger reports the car as asking under Core's 0 A, as an Easee does.TestDeclinedCarIsOfferedAgainAfterTheRetryInterval: latched at 0 W withvehicle_not_requestinguntil the interval passes, then planned and offered again.TestDeclinedCarIsOfferedAgainAtTheNextRecurringDeadline: the deadline roll brings an offer less than an interval after the refusal.TestCarThatKeepsDecliningIsNotFlapped: five hours of refusals with a deadline roll in between give 4–5 offers, each at least an hour apart.TestDeclinedCarRetryNeedsAGoalStillToMeet: retries for an unmet goal. No retry when the goal is lowered below the level, the car is at its own limit or reportsComplete, a one-time deadline passed, or Core may not command the charger.TestDeclineExitsStillActAtOnce: Charge now and unplug still clear the latch at once.TestDeclineEdgesReplan(go/cmd/ftw): replans on the latch forming and ending, not on unplug.On the base branch, with a stub for the two new names, the first three tests fail and the "goal not met" row fails. The guard rows and the exit tests pass there, as they should. On this branch all pass.
go test ./internal/loadpoint/ ./internal/mpc/ ./internal/api/ ./internal/control/ ./cmd/ftw/: all ok.GOFLAGS=-p=4 make verify: vet, tests (88 packages ok) and build clean. One earlier run hit a port already in use in an OCPP test (TestLuaEaseeWebsocketStaysPendingAndDoesNotReceiveCurrent, another run on the same machine); it passed alone three times and in the next full run.No scenario in
go/test/sitecovers a declining car today, so this PR adds none there.Changeset:
minor. This is a visible change in charging behaviour, approved by Fredrik.🤖 Generated with Claude Code