Skip to content

fix(fox): bump settings cache version to force-refresh fdpwr_max on upgrade - #4532

Merged
springfall2008 merged 1 commit into
mainfrom
fix/fox-cache-version-bump
Aug 15, 2026
Merged

fix(fox): bump settings cache version to force-refresh fdpwr_max on upgrade#4532
springfall2008 merged 1 commit into
mainfrom
fix/fox-cache-version-bump

Conversation

@springfall2008

Copy link
Copy Markdown
Owner

Summary

  • Follow-up to fix(fox): correct half-kW inverter capacity and round noisy production totals #4527. battery_rate_max (fdpwr_max) is only recomputed when get_scheduler() makes a live API call, gated to once an hour by FOX_REFRESH_SETTINGS - otherwise it's restored as-is from the persisted scheduler_state cache. That meant a customer upgrading to the fix(fox): correct half-kW inverter capacity and round noisy production totals #4527 fix kept the old, wrongly-clamped fdpwr_max (e.g. 10000W on a 10.5kW inverter) for up to an hour after upgrading, while inverter_capacity/inverter_limit (recomputed live every publish cycle straight from cached device_detail) updated immediately - producing a confusing mismatch between the two ("AC limit 10.5kW" vs "battery rate raw 10000.0W" in the log).
  • Bumps FOX_SETTINGS_CACHE_VERSION, which triggers the existing self-heal path (added for exactly this kind of derivation change) that forces one scheduler refresh regardless of cache age.

Test plan

  • ./run_all --test fox_api passes
  • ./run_pre_commit passes (ruff, black, cspell, docstrings, full test suite)

🤖 Generated with Claude Code

…pgrade

battery_rate_max is only recomputed when get_scheduler() actually makes a
live call, which is otherwise gated to once an hour - so a customer
upgrading to the capacity_watts() fix kept the old, wrongly-clamped
fdpwr_max from their persisted cache while inverter_capacity (recomputed
live every publish cycle from cached device_detail) updated immediately.
Bumping FOX_SETTINGS_CACHE_VERSION triggers the existing self-heal path
that forces one scheduler refresh regardless of cache age.
Copilot AI lite review requested due to automatic review settings August 15, 2026 13:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR forces a one-time refresh of Fox scheduler-derived settings after upgrade by bumping FOX_SETTINGS_CACHE_VERSION, ensuring fdpwr_max (battery rate max) is recomputed immediately rather than potentially lingering from persisted scheduler_state cache for up to FOX_REFRESH_SETTINGS (60 minutes).

Changes:

  • Bump FOX_SETTINGS_CACHE_VERSION from 2 → 3 to invalidate persisted Fox settings/scheduler cache and trigger the existing self-heal refresh path.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@springfall2008
springfall2008 merged commit 1f950c6 into main Aug 15, 2026
3 checks passed
@springfall2008
springfall2008 deleted the fix/fox-cache-version-bump branch August 15, 2026 14:21
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