fix(gateway): merge runtime state into health endpoint channel snapshots#42586
fix(gateway): merge runtime state into health endpoint channel snapshots#42586rstar327 wants to merge 1 commit into
Conversation
01e398f to
dc16f0a
Compare
Greptile SummaryThis PR fixes a real bug where the Core correctness: The merge order ( What changed:
Confidence Score: 4/5
Last reviewed commit: dc16f0a |
4526a1b to
2b55832
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
|
Codex automated review: keeping this open. Keep this PR open. Current main still lacks the runtime-state merge that this PR is trying to add, and the canonical maintainer repair remains open/unmerged with explicit maintainer guidance not to close duplicate or superseded PRs yet. Best possible solution: Keep this PR open while maintainer PR #72417 remains open and explicitly asks not to close duplicate or superseded PRs yet. The maintainer path is to review and land #72417 once clean and validated; otherwise, salvage this PR by rebasing it onto current main, threading runtime through the current gateway health refresh path, projecting only safe runtime fields, preserving probe behavior deliberately, and adding regression tests for health snapshots and gateway health refresh. What I checked:
Remaining risk / open question:
Codex Review notes: model gpt-5.5, reasoning high; reviewed against 9bc703213bb3. |
Summary
healthendpoint returnsrunning: false, connected: falsefor WhatsApp (and other channels) even when the channel is active, whilechannels.statusreturns the correct valuesgetHealthSnapshot()now accepts optional runtime state and merges it into channel snapshots before passing tobuildChannelSummary. The gateway wiresgetRuntimeSnapshotfrom the channel manager throughstartGatewayMaintenanceTimers→setRuntimeSnapshotFn→refreshGatewayHealthSnapshotchannels.statusendpoint, CLI health command (no runtime available in CLI context), channel manager runtime trackingChange Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
The
healthendpoint now returns correctrunningandconnectedvalues for all channels, matchingchannels.status.Security Impact (required)
Repro + Verification
Environment
Steps
healthendpointchannels.whatsapp.runningandchannels.whatsapp.connectedExpected
running: true, connected: true(matchingchannels.status)Actual
running: false, connected: falserunning: true, connected: trueEvidence
Human Verification (required)
Review Conversations
Compatibility / Migration
Failure Recovery (if this breaks)
Risks and Mitigations
buildChannelSummaryaccountId,enabled,configuredoverride it, maintaining the same priority as before