Match planner admission and budgets to the selected engine - #1120
Merged
Conversation
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. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_698f4997-8f4c-4200-bfd7-d2ebda14b8ca) |
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.
A site without a home battery could enter Core DP planning even when it explicitly selected Core or used the stable/development default. Core DP then rejected every replan. Planner construction and API diagnostics now use the same resolved engine and require positive battery capacity for Core DP. Energyplan still permits batteryless sites; beta defaults and explicit aliases retain their existing behavior.
Core already applies PV uncertainty once to a deterministic downside horizon before calling Energyplan. The dead uncertainty branch in the worker budget is removed, and the guide now describes the actual contract: 500 ms for small requests, 5 s for larger fleets or PV control, with a 7 s transport timeout. The native request test uses the real constructor and Service.Replan path to verify the downside values, zero additional scenarios/CVaR and the serialized budget. The worker source and compiled bundle are unchanged.
The existing restore/shadow regression also gets current 15-minute price fixtures. Its hourly fixture fell outside the service lookback after minute 15, causing a missing current action instead of testing execution permission. The live/shadow/archive/new-plan assertions remain intact.
Validation:
Addresses the two late findings on #1118: #1118 (comment) and #1118 (comment). Includes a patch changeset. Existing #1003, #1052, #826, #735 and #734 retain their unrelated entrypoint work; these changes are confined to planner admission and its diagnostic reason.
Note
Medium Risk
Changes who gets an MPC service at boot and what diagnose reports for batteryless sites; behavior is engine-dependent but covered by new admission and API tests.
Overview
Planner admission now keys off the same resolved engine for
buildMPCand/api/mpc/diagnose. Sites with no home battery are rejected withno-battery-capacitywhen Core DP is selected (explicitcore, stable, or dev default). Energyplan (explicit or beta default on supported platforms) still allows batteryless planning. Engine resolution moves toconfig.Planner.EngineForBuildso the CLI and API stay in sync.Energyplan solve budget no longer treats PV uncertainty parameters as a reason to use the 5 s limit—Core already applies a single downside PV horizon before calling the worker, so only large models and PV curtailment bump the budget. Docs and integration tests reflect that contract (including serialized
TimeLimitSand downside PV values).A restore/shadow test fix seeds current 15-minute price slots so execution checks are not flaky outside the service lookback window.
Reviewed by Cursor Bugbot for commit a45fda4. Bugbot is set up for automated code reviews on this repo. Configure here.