Repository navigation
fix(channels): bundled channels reject the documented heartbeatVisibility override - #117520
ayaangazali wants to merge 8 commits into
Conversation
|
Codex review: found issues before merge. Reviewed August 8, 2026, 5:48 PM ET / 21:48 UTC. ClawSweeper reviewWhat this changesThis PR adds the existing documented heartbeat-visibility object to 16 bundled channel schemas and local types, then regenerates validation metadata and adds a cross-channel contract test. Merge readinessKeep open: the 16 channel-local schema repairs are sound, but the new universal contract explicitly excludes Feishu, whose documented canonical fields still fail validation while its accepted legacy fields are inert. Priority: P2 Review scores
Verification
How this fits togetherHeartbeat delivery resolves per-channel and per-account visibility from OpenClaw configuration before rendering a heartbeat message. Bundled channel schemas and generated metadata determine whether that documented configuration can load at all. flowchart LR
A[Heartbeat documentation] --> B[Operator configuration]
B --> C[Bundled validation metadata]
C --> D[Channel schemas]
D --> E[Heartbeat visibility resolver]
E --> F[Channel heartbeat presentation]
Decision needed
Why: Feishu currently accepts an incompatible persisted shape, so resolving the contradiction requires an explicit compatibility choice rather than silently invalidating existing configuration. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +156, Tests +157, Generated 0. Total +313 across 30 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Make Feishu use the canonical heartbeat-visibility shape, migrate its legacy root and account settings through its Doctor contract, and remove the contract-test exception. Do we have a high-confidence way to reproduce the issue? Yes—source establishes the failure: Feishu's strict schema rejects the documented canonical object while the resolver reads only those canonical fields; the PR body also provides isolated before/after CLI proof for the same strict-schema failure mode. Is this the best way to solve the issue? No—the local schema additions are the right owner boundary for the 16 channels, but excluding Feishu leaves the claimed all-channel contract false instead of resolving or explicitly scoping it. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 909509a5db8d. LabelsLabel 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
HistoryReview history (17 earlier review cycles; latest 8 shown)
|
|
Pushed
So per that instruction, here is the conscious raise and the justification. Budget raised: Why the growth is justified rather than something to remove elsewhere: this PR adds no new config concept. Worth noting for the reviewer: the surface counter treats "make an existing documented key actually usable" the same as "invent a new key". That is the right default for a high config bar, but here the user-visible surface is unchanged; only the number of schemas that accept the documented key changed. I have applied the same baseline regeneration to my three sibling PRs, which had the same hash drift within budget: #117287 (3696), #117302 (3696), #117306 (3703). |
b7b7fe8 to
ef6d05a
Compare
f2c956f to
41bb711
Compare
|
I said I would stop calling this environmental if it failed again on the rebased head, so I went and measured the mechanism instead of asserting anything. Here is what I found. Both failures on
Both are gateway-booting suites, which is exactly what a plausible "my change made startup slower" theory would predict, so I tested that theory directly rather than hand-waving it. This PR grows the channel config surface, and the gateway compiles those schemas at startup. Measured on this machine, same commands, branch versus current The e2e is actually faster on the branch, and the startup test difference is noise on a single-test run. So the schema-size hypothesis does not hold: nothing here makes startup materially slower. Both suites also pass locally on the branch, and both are green on other open PRs right now (117861, 117863, 117864). What I do think is going on, and it is a property of this PR rather than of the code: it touches 16 extension packages, so it fans out to 131 check contexts, against roughly 35 to 66 on my smaller PRs. More concurrent heavy jobs on the same pool makes timeout-prone suites likelier to get starved, which fits two different long suites timing out in the same run while the assertions themselves never fail. I have not pushed a speculative fix, since there is no defect to fix that I can find. I did rebase onto current Also worth flagging honestly: my earlier "no failing checks" reports on this PR were wrong because I was reading only the first 100 check contexts and this PR has 131. That is fixed in how I check now. If these two time out again on this head, I will stop treating fan-out as the explanation and propose splitting this PR per channel group so each lands with a smaller CI footprint. |
|
Fixed in
|
|
Disclosure that affects how the channel list on this PR should be read, found while gathering clean-build proof for a sibling PR. I have been using the generated channel metadata ( Confirmed end to end on a from-scratch build of What I think this does and does not change:
I would rather you hear this from me than discover it in review. Happy to drop the affected channel from the list, or to keep it with the framing corrected to "declares the key explicitly" instead of "rejects it", whichever you prefer. |
|
Upgrading an earlier disclosure from symptom to root cause, because I finally pinned why it happens and it affects how much weight the generated metadata can carry. I have flagged before that Matrix and Tlon are permissive at runtime while the generated schema reports them closed. Re-verified on current The cause is a three-way zod distinction collapsing into two JSON Schema outputs:
So plain objects and strict objects both emit Two consequences worth your judgment:
I am not sending a fix, because the two directions are a product call and I do not want to pick one for you:
Happy to implement either once you say which, or to leave it if the artifact is intentionally a statement of canonical keys rather than of runtime rejection. This applies equally to the sibling parity PRs that include Matrix or Tlon, so I am noting it here rather than repeating it on each. |
|
Rebased onto current Re-verified the gap before rebasing rather than trusting the original write-up. Against the generated metadata on current Conflicts were confined to the three generated artifacts. I reset those to On the red checks: This is the widest of the schema-parity set. Happy to split it per channel if the scope is the blocker, or to close it if you would rather not carry this one. |
f4e4f93 to
20b90bf
Compare
|
Checked all five reds here. None of them come from this diff, and I am not pushing a speculative fix.
Both failing shards above also ran on This branch touches channel config schemas, the two generated artifacts, and contract tests. It does not touch gateway avatar projection, state leases, the build pipeline, or SQLite session flipping. Locally both generator Worth flagging separately: |
|
Closing this one deliberately, to keep my open queue under this repo's 20-PR author cap. Nothing here was withdrawn on merit. I re-verified the gap on current I picked this one because it is the broadest of my schema-parity set, which makes it the most expensive to review and the easiest to reconstruct later. The branch |
What Problem This Solves
docs/gateway/heartbeat.md:135-137documents heartbeat visibility as a per-channel override with no restriction on which channels support it:15 of 27 bundled channels reject that key, so overriding heartbeat visibility on any of them refuses the whole config:
buzz,clickclack,irc,line,matrix,mattermost,nextcloud-talk,nostr,qa-channel,raft,reef,sms,tlon,zalo,zalouser.This is not a case where only some channels can be affected:
src/config/validation.ts:571-573builds the allowed target set from every bundled channel id, soagents.defaults.heartbeat.targetmay name any of the 15 above.src/infra/heartbeat-visibility.ts:44-55readscfg.channels?.[channel]?.heartbeatVisibilityand thenaccounts?.[accountId]?.heartbeatVisibilityfor whichever channel it is delivering to, with no allowlist.So an operator can legitimately point heartbeats at one of these channels and then cannot tune its visibility, and the failure mode is a rejected config rather than an ignored setting.
Why This Change Was Made
Same owner-boundary shape as #112392, #117206, #117287, #117302 and #117306: the runtime and docs agree on a key, and individual strict schemas do not.
heartbeatVisibilityis part of the shared common channel account shape (src/config/zod-schema.channel-messaging-common.ts), which is why the other 12 channels already accept it. These 15 hand-roll their account schema and omit it.Each channel gets the canonical leaf (
showOk,showAlerts,useIndicator, all optional, strict) beside its existingconfigWritesentry, matchingsrc/config/zod-schema.channels.ts:5-12field for field. The leaf is declared locally because the core schema is not exported throughopenclaw/plugin-sdk/*, following the existing precedent atextensions/feishu/src/config-schema.ts:108. Declaring it on each account base covers both the channel level andaccounts.<id>where the channel is multi-account.User Impact
Operators can set
channels.<id>.heartbeatVisibility(and the per-account form) on every bundled channel as documented, instead of having the entire config refused. Purely additive and optional: absent means the resolver's existing defaults (showOk: false,showAlerts: true,useIndicator: true) apply exactly as before, so no existing config changes behavior.Evidence
The contract test enumerates every bundled channel from the generated metadata rather than hardcoding a list, so future channels are covered automatically. Before the schema change, all 15 fail:
After:
I also confirmed from the regenerated metadata that all 27 channels now accept the key and that 23 use the canonical
showOk/showAlerts/useIndicatorfield set.What I checked and deliberately did not change:
heartbeatVisibilitydeclaresvisibilityandintervalMs(extensions/feishu/src/config-schema.ts:108-114) rather than the canonical fields. Nothing insrc/**orextensions/**reads either of those, while the resolver only readsshowOk/showAlerts/useIndicator, sochannels.feishu.heartbeatVisibility: { showOk: true }is rejected today and anything Feishu does accept there is ignored. I did not "fix" it here because replacing that shape would invalidate configs that currently validate, which per the repo's config rules wants a matchingopenclaw doctor --fixmigration and is a maintainer call rather than a drive-by. Happy to open that as a follow-up if you want it.ChannelHeartbeatVisibilitySchemathrough the plugin SDK. That would widen a public surface and belongs in its own change; the local leaf matches what Feishu already does.agents.defaults.heartbeat, which is a different valid key.Related: #117513 fixes the documentation examples that still used the retired
channels.<id>.heartbeatspelling for this same setting.AI-assisted: researched, written, and validated with Claude Code under my direction. I have read and understand the change.
Real behavior proof (head
ca5f2eb8dc8)Both transcripts come from from-scratch builds (
rm -rf dist && pnpm build) of the respective commits, using an isolatedOPENCLAW_STATE_DIR, with IRC configured at channel and account scope.Before, on a clean build of
main(7107b0b0033):After, on a clean build of this branch:
Contract now validates the leaf, not just the container
The finding was right: asserting only the container let a channel pass while refusing the documented
{ showOk: true }body. The test now asserts each canonical field (showOk,showAlerts,useIndicator) resolves inside the leaf, which is whatsrc/infra/heartbeat-visibility.tsreads. 81 assertions, all passing.Feishu is explicitly excluded from the leaf assertion, with the reason in the code: it declares an unrelated
{ visibility, intervalMs }object under the same key, the resolver reads neither field, and replacing that shape would invalidate configs that validate today, so it wants a doctor migration and a maintainer decision rather than a silent change inside this PR.