fix(gateway): merge runtime channel state into health snapshot#42543
fix(gateway): merge runtime channel state into health snapshot#42543ajayr wants to merge 184 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a7d2d492a8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Greptile SummaryThis PR attempts to fix a bug where
The PR requires fixes to all three areas before it can safely merge. Confidence Score: 1/5
|
…fix dedup logic to use latest runtimeSnapshot
When a caller provides a runtimeSnapshot while a refresh is already in-flight, await the current refresh and return the follow-up result instead of returning stale data from the in-flight promise. This ensures callers that supply fresh runtime state never receive a snapshot that omits their updates. Co-Authored-By: Claude Opus 4.6 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9b8ec809d9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| refreshHealthSnapshot: (opts) => | ||
| refreshGatewayHealthSnapshot({ ...opts, runtimeSnapshot: getRuntimeSnapshot() }), |
There was a problem hiding this comment.
Guard runtime snapshot capture from channel config errors
Calling getRuntimeSnapshot() inline in the health refresh wrapper makes health RPCs fail hard when any channel's config.resolveAccount throws (for example unresolved SecretRef in Google Chat throws at extensions/googlechat/src/accounts.ts:97-106). getRuntimeSnapshot currently resolves every account without a try/catch (src/gateway/server-channels.ts:539-543), so this new call path turns what used to be per-account diagnostics in getHealthSnapshot into a top-level UNAVAILABLE response for the whole endpoint; this is a regression introduced by passing runtimeSnapshot: getRuntimeSnapshot() before invoking refreshGatewayHealthSnapshot.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 11abee760 — getRuntimeSnapshot() is now wrapped in try/catch in both call sites (server.impl.ts lines 811-815 and 1081-1085). On failure, it logs a warning and the health refresh proceeds without runtime snapshot data instead of crashing the entire health RPC.
…rompt snapshot (openclaw#51721) The context-usage banner in the web UI fell back to inputTokens when totalTokens was missing. inputTokens is accumulated across all API calls in a run (tool-use loops, compaction retries), so it overstates actual context window utilization -- e.g. showing "100% context used 757.3k / 200k" when the real prompt snapshot is only 46k/200k (23%). Drop the inputTokens fallback so the banner only fires when a genuine prompt snapshot (totalTokens) is available. Made-with: Cursor
Merged via squash. Prepared head SHA: a7ab64e Co-authored-by: Pandadadadazxf <[email protected]> Co-authored-by: jalehman <[email protected]> Reviewed-by: @jalehman
Merged via squash. Prepared head SHA: 76eb184 Co-authored-by: huntharo <[email protected]> Co-authored-by: huntharo <[email protected]> Reviewed-by: @huntharo
…w#51753) * refactor(doctor): add shared doctor types * refactor(doctor): add shared allowlist helpers * refactor(doctor): extract empty allowlist warnings * refactor(doctor): extract telegram allowfrom scanning * refactor(doctor): extract telegram allowfrom repair * refactor(doctor): extract discord id repair * refactor(doctor): add shared object helpers * refactor(doctor): extract mutable allowlist scanning * refactor(doctor): extract open-policy allowfrom repair * refactor(doctor): extract allowlist policy repair * fix(doctor): unblock discord provider refactor checks * refactor(doctor): fix provider layering in shared warnings
…nclaw#40126) Merged via squash. Prepared head SHA: 5228d19 Co-authored-by: jarimustonen <[email protected]> Co-authored-by: jalehman <[email protected]> Reviewed-by: @jalehman
Merged via squash. Prepared head SHA: 89ca035 Co-authored-by: Matthew19990919 <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…nt (openclaw#30115) (openclaw#34222) Merged via squash. Prepared head SHA: bce6f0b Co-authored-by: lml2468 <[email protected]> Co-authored-by: jalehman <[email protected]> Reviewed-by: @jalehman
… cancellations in heartbeat sessions (openclaw#42119) Merged via squash. Prepared head SHA: 3429643 Co-authored-by: samzong <[email protected]> Co-authored-by: jalehman <[email protected]> Reviewed-by: @jalehman
* ACP: add hung-turn starvation repro * ACP: recover hung bound turns * ACP: preserve timed-out session handles --------- Co-authored-by: Onur <[email protected]>
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
4 similar comments
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
17 similar comments
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5e5e4542a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| OPENAI_CODEX_DEFAULT_MODEL, | ||
| type ProviderPlugin, | ||
| } from "openclaw/plugin-sdk/provider-models"; | ||
| import { OPENAI_CODEX_DEFAULT_MODEL } from "openclaw/plugin-sdk/provider-models"; |
There was a problem hiding this comment.
| options: {}, | ||
| }); | ||
| } | ||
|
|
||
| function expectPreparedResult(prepared: unknown): asserts prepared is { cfg: OpenClawConfig } { |
There was a problem hiding this comment.
Avoid duplicate function implementation in Telegram test
This new expectPreparedResult declaration collides with the existing expectPreparedResult function later in the same file, which triggers a duplicate function implementation compile error and prevents the test file from being typechecked/executed.
Useful? React with 👍 / 👎.
Summary
openclaw gateway call health --jsoncould report stale/defaultrunning/connectedvalues for channels like WhatsApp.healthandchannels.statusagree on runtime-backed channel state.Why this matters
channels.statuswas correctly showing live channel runtime state, whilehealthcould still showrunning: false, connected: falsefor an active WhatsApp channel. That made health-based monitoring and debugging misleading.What changed
runtimeSnapshotplumbing togetHealthSnapshot().getRuntimeSnapshot()into health snapshot generation.ChannelAccountSnapshotduring health snapshot creation.Scope
Linked issue
Closes #42538
Verification
healthreported stale/default runtime fieldschannels.statusreported the live runtime valuesNotes
I was not able to run the full test suite in the temp environment because
pnpmwas unavailable there, but the change is small and the added regression test documents the intended behavior clearly.