Repository navigation
fix(plugin-sdk): project recorded health facts through computed account status - #117236
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 1, 2026, 1:44 AM ET / 05:44 UTC. ClawSweeper reviewWhat this changesThe PR forwards recorded ingress and run-health facts through computed channel account-status snapshots and adds regression coverage for the resulting channel-health evaluation. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 4 items remain Keep this active, protected-label PR open. Current Priority: P2 Review scores
Verification
How this fits togetherChannel runtimes record lifecycle and health facts in account snapshots. Computed plugin status adapters transform those facts into the snapshots consumed by channel health policy, CLI status, doctor, and gateway diagnostics. flowchart LR
A[Channel runtime lifecycle facts] --> B[Computed status adapter]
B --> C[Account status snapshot]
C --> D[Channel health policy]
D --> E[CLI, doctor, and RPC diagnostics]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +15, Tests +39, Generated 0. Total +54 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one canonical projection in Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main defines the health facts on Is this the best way to solve the issue? Yes: forwarding the already-recorded facts at the single computed-adapter projection boundary is preferable to adding downstream consumer exceptions and preserves the existing canonical health-policy flow. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6922ddd93610. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Runtime proof: recorded health facts now reach the operator-visible surface (redacted transcript)Real-behavior proof per review: the built dist from an integration build containing this PR ( Terminal transcript: On current Supporting live-runtime evidence from the same integration build: ephemeral gateway (isolated state dir, loopback) boots clean, 🤖 Generated with Claude Code |
|
Merged via squash.
|
…nt status (openclaw#117236) * fix(plugin-sdk): project recorded health facts through computed account status * fix(plugin-sdk): regenerate API baseline and pin ingressUnavailable literal in test
What Problem This Solves
Channels that use the computed account-status adapter (
createComputedAccountStatusAdapter/buildRuntimeAccountStatusSnapshotinsrc/plugin-sdk/status-helpers.ts) silently lose recorded health facts during projection. The projection allowlists omitingressUnavailable,busy,activeRuns,lastRunActivityAt, andactiveRunStartedAt, so:channels.status,openclaw doctor, and CLI health evaluate channel health against a snapshot that can never carryingressUnavailable— the operator-facing "Channel cannot admit inbound events" diagnostic insrc/infra/channels-status-issues.tsis unreachable for every adapter-based channel (Slack, Discord, Telegram, and most others).evaluateChannelHealth(src/gateway/channel-health-policy.ts) are also dropped, so busy-state is invisible on the same surfaces.The raw runtime store keeps these facts (health monitor and
/readyzsee them); only the operator-visible projection went blind. Silent divergence between surfaces reading "the same" snapshot is the worst-severity class per repo doctrine: recorded facts must survive to where they are read.Why This Change Was Made
The fix belongs at the projection boundary, not in consumers:
RuntimeLifecycleSnapshotandbuildRuntimeAccountStatusSnapshotare the single seam every computed adapter funnels through. Adding the missing fields there fixes all adapter-based channels at once with an additive, backward-compatible change.ingressUnavailablekeeps its deliberate optional-truesemantics (absence means unknown, never healthy).User Impact
Operators now see dead-ingress and busy state in
channels status,openclaw doctor, and thechannels.statusRPC for all channels with computed status adapters. Previously these conditions were only visible to the internal health monitor, which could restart a channel for a reason no status surface ever displayed.Evidence
node scripts/run-vitest.mjs src/plugin-sdk/status-helpers.test.ts— 24/24 pass (verified independently by reviewer session), including a new end-to-end assertion that a projected snapshot withingressUnavailable: trueyieldsevaluateChannelHealth→{ healthy: false, reason: "ingress-unavailable" }.pnpm plugin-sdk:surface:check— clean, no baseline changes.Note for reviewers: the end-to-end test imports
evaluateChannelHealthfromsrc/gateway/into a plugin-sdk test file. Placement follows "test where the bug lived" (the projection); flagging the cross-area import explicitly rather than hiding it.🤖 Generated with Claude Code
Runtime proof (added post-review)
Redacted terminal transcript through the built dist adapter (
createComputedAccountStatusAdapterfrom an integration build containing this PR): a runtime row recorded as the gateway records failed ingress projectsingressUnavailable+ run-state facts into the operator-visible snapshot, andevaluateChannelHealthon that projected snapshot returns{"healthy":false,"reason":"ingress-unavailable"}— structurally impossible on current main. Full transcript: #117236 (comment)Live ephemeral gateway on the same integration build: boots clean,
/readyzready, 3 plugins in 1.0s, clean 44ms shutdown.