Skip to content

fix(gateway): isolate optional Hub display connection health - #5500

Merged
springfall2008 merged 4 commits into
mainfrom
fix/hub-display-optional-health
Oct 13, 2026
Merged

springfall2008 merged 4 commits into
mainfrom
fix/hub-display-optional-health

Conversation

@mgazza

@mgazza mgazza commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

An offline optional Hub display currently makes a working Cloud-controlled instance fail component health, report an optimisation error and return HTTP 500 from /api/ping. Keep display transport availability separate from the display component process health. Successful display housekeeping advances its timestamp and reports a separate connectivity sensor; active Hub control retains its existing transport-health checks.

Stacked on #5496. No production rollout or canary enablement.

Validation: 14 display regressions pass, including the real Components, PredBat final-run status and web ping paths with broker disconnection, offline Hub and stale online telemetry; a stopped component still fails the probe and control transport failures remain unhealthy. Native Gateway and component groups pass, as does the local TLS MQTT cross-repository integration covering GivEnergy/FoxESS config, token refresh, role transitions and command isolation. Black, Ruff and diff checks pass. Independent review found no new blocker.

The tests prove stopped-thread detection, not every possible live-thread stall. Provider APIs and physical Hub standby remain outside the local harness.

@springfall2008
springfall2008 marked this pull request as ready for review October 12, 2026 07:02
Copilot AI balanced review requested due to automatic review settings October 12, 2026 07:02

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.

🟢 Approval recommended

Core health behavior is correct; the remaining entity-grouping inconsistency is non-blocking.

1 open finding
What changed in this PR

Separates optional Hub display connectivity from Gateway component health while preserving control-mode transport checks.

Changes:

  • Publishes dedicated display connectivity health.
  • Keeps Cloud operation and /api/ping healthy during display outages.
  • Adds lifecycle and regression coverage.
File Description
apps/​predbat/​gateway.py Separates display transport and component health.
apps/​predbat/​tests/​test_gateway_display.py Tests outage isolation and control health.

🧠 Review effort: Balanced


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

Comment thread apps/predbat/gateway.py
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Base automatically changed from feat/hub-display-only to main October 13, 2026 19:13
@springfall2008 springfall2008 added the BOT_CLEANUP Trigger: bot should address PR review feedback and CI failures, then commit and push label Oct 13, 2026
…nal-health

# Conflicts:
#	apps/predbat/gateway.py
#	apps/predbat/tests/test_gateway_display.py
@springfall2008

Copy link
Copy Markdown
Owner

Automated cleanup failed to complete for this PR. Reason: The run exited cleanly but left 6 file(s) with uncommitted changes, so its fixes were never pushed. They are stashed in the bot's clone before the next flow runs. Failed at: triage_daemon.py:2149 in process_bot_cleanup_pr() (daemon d7d8c607). Not retrying automatically; remove BOT_FAILED and re-add BOT_CLEANUP to try again.

@springfall2008 springfall2008 added BOT_FAILED An automated triage/PR attempt failed; see the comment for details and removed BOT_CLEANUP Trigger: bot should address PR review feedback and CI failures, then commit and push labels Oct 13, 2026
@springfall2008
springfall2008 merged commit 6142227 into main Oct 13, 2026
2 checks passed
@springfall2008
springfall2008 deleted the fix/hub-display-optional-health branch October 13, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BOT_FAILED An automated triage/PR attempt failed; see the comment for details

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants