Skip to content

refactor(config): retire flat streaming keys from the last six channel schemas via doctor migration - #105709

Merged
steipete merged 7 commits into
mainfrom
claude/chanref-flatkeys-batch
Jul 12, 2026
Merged

steipete merged 7 commits into
mainfrom
claude/chanref-flatkeys-batch

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

After #104693/#105054, six bundled channels still treated flat streaming keys as canonical config: signal and irc (core schemas), nextcloud-talk and irc again (via the shared ReplyRuntimeConfigSchemaShape), whatsapp, googlechat, and mattermost (which additionally accepted scalar/boolean streaming as a mode). That split kept the SDK resolvers' flat fallback load-bearing for bundled channels and left users with two config dialects. None of the migrated-channel work has shipped in a release tag yet, so completing the retirement now gives users a single migration event in one release train.

Why This Change Was Made

  • All six channels move to nested streaming.{chunkMode,block.enabled,block.coalesce} (mattermost also streaming.mode, retiring its scalar/boolean form). Schemas reject flat keys; openclaw doctor --fix migrates via defineChannelAliasMigration specs (refactor(config): declarative doctor alias-migration DSL with inheritance-aware account seeding #105636), with per-channel semantics determined from runtime source: signal/irc/nextcloud-talk/whatsapp/googlechat are deliveryOnly (no preview mode); mattermost resolves partial for both absent and object-without-mode so no default pinning is needed.
  • Account seeding follows each channel's real merge semantics. Five channels use the DSL's accountStreamingReplacesRoot; WhatsApp has an extra accounts.default shared layer between root and named accounts, so it gets plugin-local layered seeding (including case-insensitive accounts.Default, matching resolveAccountEntry) — an autoreview-caught correctness fix that the generic DSL path could not express without core learning WhatsApp's layering.
  • Bespoke flat reads deleted: signal monitor, irc/nextcloud-talk inbound gates, whatsapp account-config/monitor/inbound-dispatch — all now resolve through the shared SDK resolvers.
  • The SDK resolvers' flat fallback now warns once per process per key (Flat channel streaming key "…" is deprecated; move it to streaming.…; removed after the next release train.), making remaining consumers visible instead of guessed. Warn-once state lives outside streaming.ts so the export * SDK barrels don't leak test-reset hooks.
  • Docs updated (docs/concepts/streaming.md, messages.md, signal/nextcloud-talk/whatsapp/mattermost channel pages, docs/gateway/config-channels.md including a stale telegram scalar example); bundled channel config metadata and the plugin-sdk API baseline regenerated.

User Impact

  • One canonical streaming config shape across these six channels; existing flat-key configs are blocked loudly at startup and rewritten behavior-preservingly by openclaw doctor --fix (inheritance-aware for multi-account setups).
  • Third-party SDK plugins keep working through the flat fallback for one more train, now with an explicit deprecation warning and removal date.
  • Known residual (documented in-code and in docs): matrix and feishu plugin schemas (and qqbot's scalar streaming) still accept flat/scalar forms — follow-up PR before the fallback-removal train.

Evidence

  • Per-channel semantics determinations with file:line evidence in the review artifacts (e.g. whatsapp layering extensions/whatsapp/src/account-config.ts:41-67; mattermost resolveChannelPreviewStreamMode(merged, "partial") at extensions/mattermost/src/mattermost/accounts.ts:138; shared-shape consumers enumerated: irc + nextcloud-talk only).
  • Blacksmith Testbox: target suites green except 12 pre-existing failures in two whatsapp test files (WhatsApp runtime not initialized) — proven unrelated: identical failures at the branch base and on clean origin/main (leases tbx_01kxc0snzm4vd0vzjaar0c5495, tbx_01kxc102h3rbmea166sc8730tn; post-rebase re-run tbx_01kxc2gmct85rd30k7qgk7smv5); tracked as a separate task chip. Full remote check:changed green (lease tbx_01kxc1g9khdseb7vg9egj6m64s, 11m43s; post-rebase re-run green).
  • Autoreview (codex gpt-5.6-sol xhigh), six rounds per-commit: three accepted findings fixed (whatsapp accounts.default layer lost in seeding; docs overgeneralizing "all bundled channels"; case-insensitive default-account key), final round clean (0.97).
  • Fires-once deprecation warning covered by tests (once per key, all four keys, silent when nested config present).

Refs #104693, #105054, #105636. Follow-up: matrix/feishu/qqbot flat retirement before the fallback-removal train.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: googlechat Channel integration: googlechat channel: mattermost Channel integration: mattermost channel: nextcloud-talk Channel integration: nextcloud-talk channel: signal Channel integration: signal channel: whatsapp-web Channel integration: whatsapp-web gateway Gateway runtime commands Command implementations channel: irc size: XL maintainer Maintainer-authored PR labels Jul 12, 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. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 12, 2026
@clawsweeper

clawsweeper Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 12, 2026, 6:20 PM ET / 22:20 UTC.

Summary
The PR migrates Signal, IRC, Nextcloud Talk, WhatsApp, Google Chat, and Mattermost from flat streaming configuration to nested streaming objects, adds doctor migrations and resolver deprecation warnings, removes bespoke flat-key reads, and updates tests, docs, generated metadata, and Plugin SDK baselines.

PR surface: Source +275, Tests +488, Docs +2, Generated 0. Total +765 across 49 files.

Reproducibility: yes. A strict external plugin schema spreading the v2026.6.11 ReplyRuntimeConfigSchemaShape accepts flat streaming fields before this PR and rejects them afterward, before resolver fallback can run.

Review metrics: 2 noteworthy metrics.

  • Config contract changes: 6 bundled schemas migrated; 1 shipped SDK primitive made nested-only. Only the bundled schemas have repository-controlled doctor migrations, so the public primitive creates a wider upgrade boundary.
  • Compatibility placement: 4 resolver fallbacks retained; 0 schema fallbacks retained. Strict schema validation can reject legacy plugin config before runtime resolver compatibility executes.

Stored data model
Persistent data-model change detected: migration/backfill/repair: docs/concepts/messages.md, migration/backfill/repair: extensions/googlechat/src/doctor-contract.test.ts, migration/backfill/repair: extensions/googlechat/src/doctor-contract.ts, migration/backfill/repair: extensions/irc/doctor-contract-api.test.ts, migration/backfill/repair: extensions/irc/doctor-contract-api.ts, migration/backfill/repair: extensions/mattermost/src/doctor-contract.test.ts, and 18 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: same_root_cause
Canonical: #105054
Summary: The blocker reverses part of the external Plugin SDK compatibility restored by the merged canonical PR; the other related PRs supply migration infrastructure or bundled-channel precedent rather than replacing this PR.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Separate the public compatible schema from the bundled nested-only schema and add focused external-plugin regression coverage.
  • [P1] Add redacted terminal output or logs from a real external-plugin upgrade through parsing, migration, and runtime resolution.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR provides extensive tests and Testbox checks but no after-fix real external-plugin upgrade showing legacy config parsing, migration guidance, and successful runtime behavior; add redacted terminal output or logs, update the PR body, and request @clawsweeper re-review if a fresh review does not trigger automatically.

Risk before merge

  • [P2] Existing external plugin configurations built from the shipped public schema can become invalid during upgrade before the retained runtime fallback can warn or preserve behavior.
  • [P1] The PR body promises another release train of external flat-key compatibility, but schema-level rejection makes that promise incomplete unless plugin authors independently own and ship migrations.
  • [P1] The upgrade path still lacks after-fix proof from a real external plugin using the shipped schema and legacy configuration.

Maintainer options:

  1. Separate public and bundled schemas (recommended)
    Restore the shipped public flat fields and move bundled channels to a dedicated nested-only shape with compatibility regression tests.
  2. Approve a breaking SDK transition
    Land the public schema break only with explicit owner acceptance, revised deprecation terms, and real external-plugin upgrade proof.
  3. Pause the broad migration
    Keep the PR open but do not merge until the public Plugin SDK ownership and upgrade path are resolved.

Next step before merge

  • [P1] The author should restore the public schema compatibility boundary and provide real upgrade proof; the protected maintainer label requires explicit maintainer handling rather than automatic repair routing.

Security
Cleared: No concrete security or supply-chain regression was found; the diff adds no dependencies, workflow changes, downloaded code, publishing changes, secret handling, or new execution source.

Review findings

  • [P1] Preserve the shipped reply-runtime schema contract — src/config/zod-schema.core.ts:704
Review details

Best possible solution:

Use a dedicated nested-only delivery schema for the six bundled channels while keeping ReplyRuntimeConfigSchemaShape flat-key-compatible for external plugins through the announced deprecation window, with focused strict-schema tests and a real upgrade transcript.

Do we have a high-confidence way to reproduce the issue?

Yes. A strict external plugin schema spreading the v2026.6.11 ReplyRuntimeConfigSchemaShape accepts flat streaming fields before this PR and rejects them afterward, before resolver fallback can run.

Is this the best way to solve the issue?

No. Migrating the bundled schemas is appropriate, but changing the shared shipped primitive is broader than necessary; separating public compatibility from bundled nested-only validation is the safer owner-aligned fix.

Full review comments:

  • [P1] Preserve the shipped reply-runtime schema contract — src/config/zod-schema.core.ts:704
    Keep ReplyRuntimeConfigSchemaShape accepting the flat delivery fields during the SDK deprecation window and use a separate nested-only shape for bundled schemas. External plugins can spread this shipped primitive into a strict schema, so removing these fields rejects existing configs before resolver fallback or plugin doctor logic can run; this blocker is unchanged from the previous review.
    Confidence: 0.97

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 95f142bf0c50.

Label changes

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.

Label justifications:

  • P1: The PR can break existing external plugin configurations during upgrade within an explicitly retained compatibility window.
  • merge-risk: 🚨 compatibility: The branch removes accepted fields from a shipped public Plugin SDK schema and changes six bundled channel configuration contracts.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR provides extensive tests and Testbox checks but no after-fix real external-plugin upgrade showing legacy config parsing, migration guidance, and successful runtime behavior; add redacted terminal output or logs, update the PR body, and request @clawsweeper re-review if a fresh review does not trigger automatically.
Evidence reviewed

PR surface:

Source +275, Tests +488, Docs +2, Generated 0. Total +765 across 49 files.

View PR surface stats
Area Files Added Removed Net
Source 29 452 177 +275
Tests 11 509 21 +488
Docs 7 35 33 +2
Config 0 0 0 0
Generated 2 16 16 0
Other 0 0 0 0
Total 49 1012 247 +765

What I checked:

  • Shipped public contract: Release v2026.6.11 exports ReplyRuntimeConfigSchemaShape through public Plugin SDK entrypoints, and that shape accepts chunkMode, blockStreaming, and blockStreamingCoalesce. (src/config/zod-schema.core.ts:654, e085fa1a3ffd)
  • Breaking schema change: The PR removes the shipped flat fields from the same exported shape and replaces them with nested streaming, so strict external plugin schemas can reject existing config before resolver compatibility runs. (src/config/zod-schema.core.ts:704, 120c9d2d7b71)
  • Fallback occurs too late: The public streaming resolvers retain flat-key fallbacks and warnings, but those execute only after a plugin's strict config schema has accepted the input. (src/channels/streaming.ts:43, 120c9d2d7b71)
  • Public and bundled callers share the primitive: Plugin SDK barrels export the shared shape, while IRC and Nextcloud Talk spread it directly into bundled strict schemas; a separate bundled-only shape can preserve both boundaries. (extensions/irc/src/config-schema.ts:68, 95f142bf0c50)
  • Re-review continuity: The files supporting the previous P1 finding are unchanged between the prior reviewed SHA and the current force-pushed head; intervening changes are unrelated CI and UI base updates. (src/config/zod-schema.core.ts:704, 120c9d2d7b71)
  • Current validation state: Most current checks pass and remaining checks are pending; green CI does not resolve the upgrade contract because no strict external-plugin compatibility test or real upgrade proof is supplied. (120c9d2d7b71)

Likely related people:

  • steipete: Introduced the shared reply-runtime shape on current main and authored the related doctor-owned migration, resolver compatibility, migration DSL, and current schema changes. (role: feature-history contributor; confidence: high; commits: 2821abc1f5c5, 508f6a29963c, 199993510897; files: src/config/zod-schema.core.ts, src/channels/streaming.ts, src/config/channel-alias-migration.ts)
  • Vincent Koc: The latest shipped release commit is relevant to establishing the exact public Plugin SDK contract users currently receive, though the feature-history trail is less direct. (role: release-history contributor; confidence: low; commits: e085fa1a3ffd; files: src/config/zod-schema.core.ts, src/plugin-sdk/channel-config-primitives.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.
Review history (1 earlier review cycle)
  • reviewed 2026-07-12T21:23:48.190Z sha 854fdec3d2bd2666c5c0a5afeb6c04e7e5f3a87c :: needs real behavior proof before merge. :: [P1] Preserve the shipped reply-runtime schema contract

@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 Jul 12, 2026
steipete added 7 commits July 12, 2026 23:14
…l schemas

signal, irc, nextcloud-talk, whatsapp, googlechat, and mattermost now accept
only the nested streaming.{chunkMode,block.enabled,block.coalesce} shape
(mattermost also drops scalar/boolean streaming); flat spellings migrate via
each channel's defineChannelAliasMigration doctor contract with root seeding
for their wholesale-replace account merges.
…fallback is used

Bundled schemas now reject the flat delivery keys, so the streaming.ts
fallback only serves external SDK plugin configs; emit a once-per-process
per-key subsystem warning and pin the removal plan to the next release train.
…s.default layer

WhatsApp resolution layers accounts.default shared config between root and
named accounts, so doctor-materialized account streaming objects now inherit
default-account settings over root ones; mattermost schema test moves to the
nested-only shape with explicit rejection coverage; scope flat-key deprecation
notes to the pending Matrix/Feishu migrations.
@steipete
steipete force-pushed the claude/chanref-flatkeys-batch branch from 854fdec to 120c9d2 Compare July 12, 2026 22:14

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 120c9d2d7b

ℹ️ 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".

chunkMode: z.enum(["length", "newline"]).optional(),
blockStreaming: z.boolean().optional(),
blockStreamingCoalesce: BlockStreamingCoalesceSchema.optional(),
streaming: ChannelDeliveryStreamingConfigSchema.optional(),

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.

P2 Badge Preserve flat SDK schema keys through deprecation

For third-party channel plugins that import ReplyRuntimeConfigSchemaShape from openclaw/plugin-sdk/channel-config-schema, this strict nested-only shape now rejects existing chunkMode/blockStreaming/blockStreamingCoalesce configs during plugin validation before the runtime can reach the warn-once flat fallback in streaming.ts; there is also no plugin-agnostic doctor migration for arbitrary external channel IDs. That makes the intended one-release SDK fallback unusable for external plugins using this public schema primitive.

Useful? React with 👍 / 👎.

Comment on lines +17 to +20
const streamingAliasMigration = defineChannelAliasMigration({
channelId: "googlechat",
streaming: { defaultMode: "partial", deliveryOnly: true },
accountStreamingReplacesRoot: true,

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.

P2 Badge Preserve Google Chat default streaming inheritance

When channels.googlechat.accounts.default carries flat streaming defaults and a named account has its own flat streaming key, the generic accountStreamingReplacesRoot migration only seeds from the root channels.googlechat.streaming. Google Chat’s account resolver also layers accounts.default into named accounts, so after migration the named account’s materialized streaming object can overwrite the default account’s migrated streaming object and drop inherited settings such as block.enabled; this is the same inheritance case that needed plugin-local seeding for WhatsApp.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot removed the rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. label Jul 12, 2026
@clawsweeper clawsweeper Bot added the rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. label Jul 12, 2026
@steipete
steipete merged commit 4a05a08 into main Jul 12, 2026
118 of 120 checks passed
@steipete
steipete deleted the claude/chanref-flatkeys-batch branch July 12, 2026 22:27
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 13, 2026
…l schemas via doctor migration (openclaw#105709)

* refactor(config): retire flat streaming keys from the last six channel schemas

signal, irc, nextcloud-talk, whatsapp, googlechat, and mattermost now accept
only the nested streaming.{chunkMode,block.enabled,block.coalesce} shape
(mattermost also drops scalar/boolean streaming); flat spellings migrate via
each channel's defineChannelAliasMigration doctor contract with root seeding
for their wholesale-replace account merges.

* feat(channels): warn once per key when the deprecated flat streaming fallback is used

Bundled schemas now reject the flat delivery keys, so the streaming.ts
fallback only serves external SDK plugin configs; emit a once-per-process
per-key subsystem warning and pin the removal plan to the next release train.

* chore(config): regenerate bundled channel config metadata for nested-only streaming

* docs: describe nested-only channel streaming config and the SDK flat-key deprecation window

* fix(whatsapp): seed migrated named-account streaming from the accounts.default layer

WhatsApp resolution layers accounts.default shared config between root and
named accounts, so doctor-materialized account streaming objects now inherit
default-account settings over root ones; mattermost schema test moves to the
nested-only shape with explicit rejection coverage; scope flat-key deprecation
notes to the pending Matrix/Feishu migrations.

* fix(whatsapp): resolve the default account case-insensitively when seeding migrated streaming

* chore(plugin-sdk): repin API baseline for nested-only channel streaming types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: googlechat Channel integration: googlechat channel: irc channel: mattermost Channel integration: mattermost channel: nextcloud-talk Channel integration: nextcloud-talk channel: signal Channel integration: signal channel: whatsapp-web Channel integration: whatsapp-web commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant