Skip to content

fix(channels): bundled channels reject the documented heartbeatVisibility override - #117520

Closed
ayaangazali wants to merge 8 commits into
openclaw:mainfrom
ayaangazali:fix/heartbeat-visibility-schema-parity
Closed

ayaangazali wants to merge 8 commits into
openclaw:mainfrom
ayaangazali:fix/heartbeat-visibility-schema-parity

Conversation

@ayaangazali

@ayaangazali ayaangazali commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

docs/gateway/heartbeat.md:135-137 documents heartbeat visibility as a per-channel override with no restriction on which channels support it:

  • channels.defaults.heartbeatVisibility sets visibility defaults for all channels.
  • channels.<channel>.heartbeatVisibility overrides channel defaults.
  • channels.<channel>.accounts.<id>.heartbeatVisibility (multi-account channels) overrides per-channel settings.

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:

  • Any bundled channel can be a heartbeat delivery target. src/config/validation.ts:571-573 builds the allowed target set from every bundled channel id, so agents.defaults.heartbeat.target may name any of the 15 above.
  • The resolver is channel-agnostic. src/infra/heartbeat-visibility.ts:44-55 reads cfg.channels?.[channel]?.heartbeatVisibility and then accounts?.[accountId]?.heartbeatVisibility for 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. heartbeatVisibility is 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 existing configWrites entry, matching src/config/zod-schema.channels.ts:5-12 field for field. The leaf is declared locally because the core schema is not exported through openclaw/plugin-sdk/*, following the existing precedent at extensions/feishu/src/config-schema.ts:108. Declaring it on each account base covers both the channel level and accounts.<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:

× buzz accepts channels.<id>.heartbeatVisibility
× clickclack accepts channels.<id>.heartbeatVisibility
× irc accepts channels.<id>.heartbeatVisibility
× line accepts channels.<id>.heartbeatVisibility
× matrix accepts channels.<id>.heartbeatVisibility
× mattermost accepts channels.<id>.heartbeatVisibility
... (15 total, plus the accounts.<account> cases)

After:

$ node scripts/run-vitest.mjs src/plugins/contracts/channel-heartbeat-visibility.contract.test.ts
Tests  55 passed (55)

$ node scripts/run-vitest.mjs src/plugins/contracts
Test Files  43 passed (43)
     Tests  1104 passed (1104)

$ node scripts/run-vitest.mjs extensions/matrix      1611 passed
$ node scripts/run-vitest.mjs extensions/mattermost   742 passed
$ node scripts/run-vitest.mjs extensions/line         508 passed
$ node scripts/run-vitest.mjs extensions/irc          140 passed

$ node --import tsx scripts/generate-bundled-channel-config-metadata.ts --check
(clean)

I also confirmed from the regenerated metadata that all 27 channels now accept the key and that 23 use the canonical showOk/showAlerts/useIndicator field set.

What I checked and deliberately did not change:

  • Feishu is the one channel I left alone, and it looks like a separate bug worth its own decision. Its heartbeatVisibility declares visibility and intervalMs (extensions/feishu/src/config-schema.ts:108-114) rather than the canonical fields. Nothing in src/** or extensions/** reads either of those, while the resolver only reads showOk/showAlerts/useIndicator, so channels.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 matching openclaw doctor --fix migration and is a maintainer call rather than a drive-by. Happy to open that as a follow-up if you want it.
  • I did not export ChannelHeartbeatVisibilitySchema through the plugin SDK. That would widen a public surface and belongs in its own change; the local leaf matches what Feishu already does.
  • I did not touch the resolver, its layering, or its defaults.
  • I did not touch agents.defaults.heartbeat, which is a different valid key.
  • The regenerated metadata snapshot came from the repo generator, not hand editing.

Related: #117513 fixes the documentation examples that still used the retired channels.<id>.heartbeat spelling 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 isolated OPENCLAW_STATE_DIR, with IRC configured at channel and account scope.

Before, on a clean build of main (7107b0b0033):

$ openclaw config get channels.irc
OpenClaw config is invalid: /tmp/oc-hv.xDLqRQ/openclaw.json
- channels.irc: invalid config: must not have additional properties: "heartbeatVisibility"
- channels.irc.accounts.ops: invalid config: must not have additional properties: "heartbeatVisibility"

After, on a clean build of this branch:

$ openclaw config get channels.irc
  "heartbeatVisibility": {
    "showOk": true,
    "showAlerts": false,
    "useIndicator": true
    "ops": {
      "heartbeatVisibility": {
        "showAlerts": false

$ openclaw config validate
Config valid: /tmp/oc-hv.xDLqRQ/openclaw.json

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 what src/infra/heartbeat-visibility.ts reads. 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.

Copilot AI review requested due to automatic review settings August 1, 2026 16:59

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@openclaw-barnacle openclaw-barnacle Bot added channel: line Channel integration: line channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: nextcloud-talk Channel integration: nextcloud-talk channel: nostr Channel integration: nostr channel: tlon Channel integration: tlon channel: zalo Channel integration: zalo channel: zalouser Channel integration: zalouser channel: irc channel: qa-channel Channel integration: qa-channel channel: sms Channel integration: sms channel: raft Channel integration: Raft channel: reef Channel integration: reef channel: buzz size: M labels Aug 1, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 8, 2026, 5:48 PM ET / 21:48 UTC.

ClawSweeper review

What this changes

This 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 readiness

⚠️ Needs maintainer review before merge - 4 items remain

Keep 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
Reviewed head: 65e4dd4349091bee10e2f5712df1369820422962
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The main repair has strong direct proof, but the known Feishu exception prevents a merge-ready patch.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The PR body includes isolated clean-build terminal proof that IRC root and account overrides failed on main and validated after the schema change; the later head update is a merge refresh, not a change to that repaired path.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body includes isolated clean-build terminal proof that IRC root and account overrides failed on main and validated after the schema change; the later head update is a merge refresh, not a change to that repaired path.
Evidence reviewed 6 items Feishu is excluded from the new invariant: The PR's new contract test defines Feishu as non-canonical and skips canonical leaf-field assertions for it.
Current Feishu schema remains incompatible: Current main and the PR head retain a strict Feishu leaf accepting only visibility and intervalMs, not showOk, showAlerts, or useIndicator.
Runtime reads only the canonical fields: The channel-agnostic resolver reads showOk, showAlerts, and useIndicator at channel and account scope; no Feishu runtime reader uses its legacy fields.
Findings 1 actionable finding [P2] Cover Feishu with the canonical heartbeat contract
Security None None.

How this fits together

Heartbeat 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]
Loading

Decision needed

Question Recommendation
Should this PR include a migration-safe canonical Feishu heartbeat contract, or should the documented universal override be narrowed to exclude Feishu? Canonicalize Feishu with Doctor migration: Replace the inert Feishu leaf with the canonical fields, migrate existing root and account settings, and let the universal test cover it.

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

  • Cover Feishu with the canonical heartbeat contract (P2) - This exemption leaves the advertised all-channel repair incomplete: Feishu still rejects the documented showOk/showAlerts/useIndicator object and accepts fields the resolver never reads. Canonicalize its leaf with a plugin Doctor migration for existing settings, then remove the exemption.
  • Resolve merge risk (P1) - Merging preserves a documented Feishu override that rejects the resolver's canonical fields; changing its currently accepted legacy shape later requires a plugin-owned Doctor migration for existing config files.
  • Complete next step (P2) - A maintainer must choose Feishu's migration-compatible contract before a safe repair can be dispatched.

Findings

  • [P2] Cover Feishu with the canonical heartbeat contract — src/plugins/contracts/channel-heartbeat-visibility.contract.test.ts:47-52
Agent review details

Security

None.

PR surface

Source +156, Tests +157, Generated 0. Total +313 across 30 files.

View PR surface stats
Area Files Added Removed Net
Source 26 156 0 +156
Tests 1 157 0 +157
Docs 0 0 0 0
Config 0 0 0 0
Generated 3 21 21 0
Other 0 0 0 0
Total 30 334 21 +313

Review metrics

Metric Value Why it matters
Existing config acceptance 16 channel schemas enabled; 0 new setting names The production growth implements an already documented resolver contract rather than adding a new configuration concept.
Production versus tests production +177/-21; tests +157/-0 The production increase is justified by per-plugin schema ownership, generated validation metadata, and matching local types.

Stored data model

Persistent data-model change detected: unknown-data-model-change: src/config/bundled-channel-config-metadata.generated.ts, vector/embedding metadata: src/plugins/contracts/channel-heartbeat-visibility.contract.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Finish the Feishu migration before merge (recommended)
    Canonicalize Feishu's heartbeat visibility, add its Doctor migration, and remove the test exemption so all documented channels share one contract.
  2. Explicitly scope the exception
    Retain the legacy Feishu shape only with a maintainer-approved docs and contract exception describing that heartbeat visibility is unsupported there.

Technical review

Best 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:

  • [P2] Cover Feishu with the canonical heartbeat contract — src/plugins/contracts/channel-heartbeat-visibility.contract.test.ts:47-52
    This exemption leaves the advertised all-channel repair incomplete: Feishu still rejects the documented showOk/showAlerts/useIndicator object and accepts fields the resolver never reads. Canonicalize its leaf with a plugin Doctor migration for existing settings, then remove the exemption.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 909509a5db8d.

Labels

Label justifications:

  • P2: A documented per-channel configuration override remains unusable for one bundled channel despite this otherwise bounded repair.
  • merge-risk: 🚨 compatibility: Resolving Feishu requires changing an already accepted persisted configuration shape and providing an upgrade migration.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (terminal): The PR body includes isolated clean-build terminal proof that IRC root and account overrides failed on main and validated after the schema change; the later head update is a merge refresh, not a change to that repaired path.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes isolated clean-build terminal proof that IRC root and account overrides failed on main and validated after the schema change; the later head update is a merge refresh, not a change to that repaired path.

Evidence

What I checked:

Likely related people:

  • steipete: Current blame connects commit 82f6280 to the resolver, documentation, and Feishu schema area; partial history prevents stronger original-authorship claims. (role: recent core config and heartbeat contributor; confidence: medium; commits: 82f6280fa86; files: src/infra/heartbeat-visibility.ts, extensions/feishu/src/config-schema.ts, docs/gateway/heartbeat.md)
  • ayaangazali: Authored this PR and the merged sibling channel-schema parity repairs for the same owner-boundary pattern. (role: related config-contract repair author; confidence: high; commits: 2ee64b484447, 20b90bf46d8b, 11069c3df574; files: src/plugins/contracts/channel-heartbeat-visibility.contract.test.ts, extensions/irc/src/config-schema.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Resolve Feishu’s canonical shape with a plugin Doctor migration and remove the test exemption.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (17 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-02T15:51:33.512Z sha 41bb7116f9066d8ce0942eb06de84a028db05930 :: needs changes before merge. :: [P2] Align IRC’s config type with its schema | [P2] Align Mattermost’s config type with its schema
  • reviewed 2026-08-02T17:38:32.485Z sha f4e4f939f2c770172ac792d8cf4ef902938d09a1 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-03T15:00:14.341Z sha f4e4f939f2c770172ac792d8cf4ef902938d09a1 :: found issues before merge. :: [P2] Resolve the Feishu contract instead of excluding it
  • reviewed 2026-08-04T08:12:56.936Z sha f4e4f939f2c770172ac792d8cf4ef902938d09a1 :: found issues before merge. :: [P2] Resolve the Feishu contract instead of excluding it
  • reviewed 2026-08-05T10:48:59.062Z sha f4e4f939f2c770172ac792d8cf4ef902938d09a1 :: found issues before merge. :: [P2] Resolve Feishu's heartbeat contract
  • reviewed 2026-08-06T12:12:55.768Z sha f4e4f939f2c770172ac792d8cf4ef902938d09a1 :: needs changes before merge. :: [P2] Resolve Feishu’s heartbeat-visibility contract
  • reviewed 2026-08-08T14:45:10.064Z sha f4e4f939f2c770172ac792d8cf4ef902938d09a1 :: found issues before merge. :: [P2] Cover Feishu with the canonical heartbeat contract
  • reviewed 2026-08-08T19:39:46.036Z sha 20b90bf :: found issues before merge. :: [P2] Resolve Feishu’s canonical heartbeat contract

@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Aug 1, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 1, 2026
@ayaangazali

Copy link
Copy Markdown
Contributor Author

Pushed b7b7fe8a9f1, which fixes a gate I had genuinely missed rather than a flake.

node --import tsx scripts/generate-config-doc-baseline.ts --check was failing on this branch:

channel: current 3796 > budget 3692; config surface grew; either remove config elsewhere or
consciously raise the budget in docs/.generated/config-baseline.counts.json in this PR and
justify it in the PR body. See the AGENTS.md config-surface bar.
Config baseline drift detected.
Hash mismatch: docs/.generated/config-baseline.sha256

So per that instruction, here is the conscious raise and the justification.

Budget raised: channel 3692 to 3796 (+104). That is 15 channels times the heartbeatVisibility object plus its three leaves, counted at both channel root and accounts.<id> where the channel is multi-account. Regenerated with the repo generator, not hand-edited.

Why the growth is justified rather than something to remove elsewhere: this PR adds no new config concept. heartbeatVisibility with exactly showOk, showAlerts, useIndicator already exists in the shared channel account shape and is already accepted by the other 12 bundled channels, so the count grows only because 15 hand-rolled schemas were missing a key the docs and the resolver already treat as universal. The alternative reading of the bar, removing config elsewhere, would mean deleting a documented setting that src/infra/heartbeat-visibility.ts reads, which is the opposite of the fix.

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).

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 2, 2026
@ayaangazali
ayaangazali force-pushed the fix/heartbeat-visibility-schema-parity branch from f2c956f to 41bb711 Compare August 2, 2026 08:33
@ayaangazali

Copy link
Copy Markdown
Contributor Author

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 f2c956f6cde are timeouts, not assertions.

  • check-sqlite-session-flip-proof: Error: Test timed out in 180000ms. Note this is a different failure mode from the previous run, which failed on the sessions.json assertion. A deterministic defect does not usually change shape between runs.
  • checks-node-compact-large-2: src/gateway/server-startup-model-runtime.event-loop.test.ts, Error: Test timed out in 120000ms.

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 main:

gateway startup event-loop test:   main 8.55s   branch 9.39s
sqlite flip proof e2e:             main 62.83s  branch 59.93s

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 main (9517b10778b, the branch was 50 behind) and pushed 41bb7116f90, which keeps the branch current and re-runs both suites. Contract test 107 passed, gateway startup test passed, metadata and config-doc baseline checks clean.

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.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

Fixed in f4e4f939f2c. You are right that this PR introduced the divergence, and my earlier note that irc and mattermost would be covered by their own PRs was wrong: #117302 and #117287 add healthMonitor and contextVisibility to those types, not heartbeatVisibility. Since this PR is what adds the schema leaf for them, the type belongs here.

IrcAccountConfig and MattermostAccountConfig now declare heartbeatVisibility?: { showOk?, showAlerts?, useIndicator? }, matching the schema and the other eight channels aligned earlier in this PR. Both root types are reused for accounts entries, so this covers channel and account scope.

$ node scripts/run-vitest.mjs extensions/irc          142 passed
$ node scripts/run-vitest.mjs extensions/mattermost   714 passed
$ node --import tsx scripts/generate-config-doc-baseline.ts --check
OK

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 2, 2026
@ayaangazali

Copy link
Copy Markdown
Contributor Author

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 (src/config/bundled-channel-config-metadata.generated.ts, closed schema plus key absent) as my oracle for which channels reject a key. For two channels that oracle over-reports, because their generated JSON Schema says additionalProperties: false while their live zod schema is permissive:

matrix  live runtime.safeParse({ totallyBogusKey: 1 })  -> accepted
tlon    live runtime.safeParse({ totallyBogusKey: 1 })  -> accepted
buzz / raft                                              -> correctly strict

Confirmed end to end on a from-scratch build of main: channels.matrix.dmHistoryLimit, a key matrix's generated schema marks absent-and-closed, is accepted by the CLI. So in a source checkout these two channels were not actually refusing the documented key, and for them the "rejects the key" framing in my PR body is imprecise.

What I think this does and does not change:

  • The schema additions themselves stay correct and harmless for these channels: declaring the key makes it explicit and typed rather than silently passing through an open object, and it matches what every channel on the shared account shape already publishes.
  • It does matter for the packaged path, where validation falls back to the generated metadata, so the same config can behave differently between a source checkout and a dist-only install. That divergence looks like its own defect, and I am not folding a fix for it into this PR.
  • The other channels in this PR were verified strict, so the finding is scoped to the ones named above.

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.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

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 main:

MATRIX_LIVE_ACCEPTS_UNKNOWN_KEY=true      // runtime safeParse with a bogus key succeeds
matrix generated additionalProperties: false
tlon   generated additionalProperties: false

The cause is a three-way zod distinction collapsing into two JSON Schema outputs:

zod form runtime behavior generated additionalProperties
.strict() (irc) rejects unknown keys false
.passthrough() (qqbot) keeps unknown keys {}
plain z.object({...}) (matrix config-schema.ts:130, tlon) accepts and strips unknown keys false

So plain objects and strict objects both emit false, but only one of them actually refuses a config. false in JSON Schema means reject, so for every plain-object channel the artifact asserts a rejection that does not happen.

Two consequences worth your judgment:

  1. Any consumer that validates against the generated schema will refuse configs the runtime accepts. That is the packaged-vs-source divergence I mentioned earlier, now with a mechanism rather than a guess.
  2. It is the oracle my parity contract tests use, so for plain-object channels those tests assert "the schema rejects this key" when the truth is "the runtime silently drops it". The schema additions in this PR and its siblings are still right, since an explicitly declared and typed key beats a silently dropped one, but the framing is imprecise for Matrix and Tlon specifically.

I am not sending a fix, because the two directions are a product call and I do not want to pick one for you:

  • make those schemas .strict(), which matches the artifact but is a behavior change for existing configs and would want a doctor migration, or
  • make the generator emit additionalProperties: {} for non-strict objects, which makes the artifact truthful but changes what every consumer of that metadata sees

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.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (82f6280fa86); this is mergeable again.

Re-verified the gap before rebasing rather than trusting the original write-up. Against the generated metadata on current main, heartbeatVisibility is still rejected by closed schemas on all sixteen channels this touches: buzz, clickclack, irc, line, matrix, mattermost, nextcloud-talk, nostr, qa-channel, raft, reef, sms, tlon, twitch, zalo and zalouser.

Conflicts were confined to the three generated artifacts. I reset those to main and re-ran both generators instead of hand-merging, so they reflect current main plus this change. Both --check gates pass, src/plugins/contracts is 45 files / 1163 tests green, and tsgo -p tsconfig.core.json is clean.

On the red checks: build-artifacts, checks-fast-bun-launcher and check-sqlite-session-flip-proof fail here because fork PRs run on the standard 2-core ubuntu-24.04 runner while same-repo PRs get blacksmith-32vcpu-ubuntu-2404. The build-spawning shards do not fit in the wall clock on 2 cores, so they end in exit 143, which is SIGTERM rather than a failed assertion. That is an infrastructure limit rather than anything in this diff, so I have not pushed a speculative fix for it.

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.

@ayaangazali
ayaangazali force-pushed the fix/heartbeat-visibility-schema-parity branch from f4e4f93 to 20b90bf Compare August 8, 2026 18:52
@ayaangazali

Copy link
Copy Markdown
Contributor Author

Checked all five reds here. None of them come from this diff, and I am not pushing a speculative fix.

checks-node-compact-large-8 fails on src/state/openclaw-state-lease.test.ts. That suite fails on pristine main with none of my changes: I checked out a9012617543 clean and ran it twice, and both runs gave Tests 1 failed | 5 passed (6). Note CI failed a different case in that file (never transfers an expired lease away from its live process owner) than the one that fails locally (releases ownership when a CLI exits from inside the leased operation), which is the signature of a timing-sensitive suite rather than a deterministic break.

checks-node-compact-large-5 fails on src/gateway/session-message-events.test.ts. That file passes 27/27 locally on this branch.

build-artifacts, checks-fast-bun-launcher and check-sqlite-session-flip-proof are the fork-runner limit I described above: these jobs ran on ubuntu-24.04 (2 core) because fork PRs cannot reach blacksmith-32vcpu-ubuntu-2404, and the build-spawning shards exceed their wall clock there and end in SIGTERM.

Both failing shards above also ran on ubuntu-24.04.

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 --check gates pass, src/plugins/contracts is 45 files / 1163 tests green, and tsgo -p tsconfig.core.json is clean.

Worth flagging separately: src/state/openclaw-state-lease.test.ts failing on clean main is not specific to this PR and will keep marking unrelated work red. Happy to open an issue for it if that is useful, rather than leaving it buried in a schema PR thread.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

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 main this morning and it still reproduces, the branch is rebased and mergeable, and both generator --check gates pass. The problem is on my side: I let the queue grow to the cap, and openclaw-barnacle has now auto-closed three of my newer PRs for exceeding it, including fixes that already had review findings addressed. Holding the widest, least-reviewed changes open was costing narrower ones their slot.

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 ayaangazali:fix/heartbeat-visibility-schema-parity stays intact, so if you would like this repaired, say so and I will resubmit it, either whole or split per channel so it is cheaper to land.

@ayaangazali ayaangazali closed this Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: buzz channel: irc channel: line Channel integration: line channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: nextcloud-talk Channel integration: nextcloud-talk channel: nostr Channel integration: nostr channel: qa-channel Channel integration: qa-channel channel: raft Channel integration: Raft channel: reef Channel integration: reef channel: sms Channel integration: sms channel: tlon Channel integration: tlon channel: twitch Channel integration: twitch channel: zalo Channel integration: zalo channel: zalouser Channel integration: zalouser docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants