Skip to content

fix(channels): reply-capable channels reject the documented replyToMode override - #119030

Closed
ayaangazali wants to merge 7 commits into
openclaw:mainfrom
ayaangazali:fix/reply-to-mode-schema-parity
Closed

ayaangazali wants to merge 7 commits into
openclaw:mainfrom
ayaangazali:fix/reply-to-mode-schema-parity

Conversation

@ayaangazali

@ayaangazali ayaangazali commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

replyToMode controls whether outbound replies thread under the triggering message. The filter that enforces it is channel-agnostic, but eight bundled channels reject the key, so setting the documented per-channel override refuses the whole config.

Affected: buzz, clickclack, feishu, irc, nextcloud-talk, qa-channel, reef, tlon.

The enforcement path does not branch per channel. src/auto-reply/reply/reply-threading.ts:39 normalizes any channel id, :53 reads cfg.channels[provider]?.replyToMode, and createReplyToModeFilter then strips payload.replyToId for whichever channel is replying. So every channel that emits a reply target is already governed by this setting, whether or not its own code mentions it. Feishu and ClickClack additionally read ctx.replyToMode in their outbound paths (extensions/feishu/src/outbound.ts:403, extensions/clickclack/src/outbound.ts:334).

Why This Change Was Made

Same owner-boundary shape as the merged #112392, #117206 and #110624: the runtime honors a key that individual strict schemas refuse. replyToMode is part of the shared common channel account shape, which is why channels built on that shape already accept it. These eight hand-roll their account schema and omit it.

Each gets ReplyToModeSchema.optional() from openclaw/plugin-sdk/channel-config-schema, the shared enum the resolver already understands, rather than a channel-local spelling.

User Impact

Operators of these eight channels can set channels.<id>.replyToMode as documented instead of having the entire config refused. Purely additive and optional: absent means the existing default threading behavior is unchanged.

Evidence

Before the schema change, all eight fail:

× buzz accepts channels.<id>.replyToMode
× clickclack accepts channels.<id>.replyToMode
× feishu accepts channels.<id>.replyToMode
× irc accepts channels.<id>.replyToMode
× nextcloud-talk accepts channels.<id>.replyToMode
... (8 total)

After:

$ node scripts/run-vitest.mjs src/plugins/contracts/channel-reply-to-mode.contract.test.ts
Tests  16 passed (16)

$ node scripts/run-vitest.mjs extensions/feishu   1470 passed
$ node scripts/run-vitest.mjs extensions/irc       142 passed
$ node scripts/run-vitest.mjs extensions/tlon      279 passed
$ node scripts/run-vitest.mjs extensions/reef      287 passed

$ node --import tsx scripts/generate-bundled-channel-config-metadata.ts --check   (clean)
$ node --import tsx scripts/generate-config-doc-baseline.ts --check               (clean)
$ node scripts/run-oxlint.mjs <changed files>                                     (clean)

I also confirmed from the regenerated metadata that exactly the nine intended channels still reject the key, which is the exclusion list below rather than an accidental gap.

What I checked and deliberately did not change, since this key has more intentional exclusions than the other parity keys:

  • imessage and msteams omit it on purpose: omit: ["mentionPatterns", "replyToMode"] at extensions/imessage/src/config-schema.ts:40 and omit: ["name", "mentionPatterns", "replyToMode"] at extensions/msteams/src/config-schema.ts:81.
  • zalo and zalouser pin it statically: both install createStaticReplyToModeResolver("off") (extensions/zalo/src/channel.ts:296, extensions/zalouser/src/channel.adapters.ts:447), so accepting the key would let operators set a value the resolver overrides. docs/channels/zalo.md:57 documents that quote-reply is fixed off there.
  • line, nostr, raft, sms and twitch emit no reply target at all (zero replyToId references in their src/), so the filter never applies and the key would be inert config surface.
  • I did not touch the resolver, the filter, replyToModeByChatType, or any channel's default.
  • The contract helper walks composed schemas, treating a union as accepting when any alternative accepts and allOf as an intersection where one closed component still refuses.
  • The regenerated metadata snapshot and config-surface baseline came from the repo generators, not hand editing.

Real behavior proof

Both readings come from a full rm -rf dist && pnpm build, so neither is a stale-dist artifact.

Before, on current main at aa07d55ec98, the eight target channels still reject the key:

buzz true   clickclack true   feishu true   irc true
nextcloud-talk true   qa-channel true   reef true   tlon true

After, on this branch at 7d692bfbf99, including the account-scoped form:

$ openclaw config get channels.irc
{
  "host": "irc.libera.chat",
  "nick": "openclaw-bot",
  "replyToMode": "off",
  "accounts": {
    "work": { "replyToMode": "first", "dmPolicy": "pairing", "groupPolicy": "allowlist" }
  },
  "dmPolicy": "pairing",
  "groupPolicy": "allowlist"
}

The account form is included deliberately: the generic config fallback previously dropped the account id, so accounts.<id>.replyToMode would have been accepted and ignored on exactly the channels this PR adds the key to. resolveConfiguredReplyToMode now resolves account then root for both replyToMode and replyToModeByChatType. The seven channels that already accepted the account form on main register a threading adapter that short-circuits ahead of that line, so their behavior is unchanged.


AI-assisted: researched, written, and validated with Claude Code under my direction. I have read and understand the change.

Copilot AI review requested due to automatic review settings August 4, 2026 00:39

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 docs Improvements or additions to documentation channel: nextcloud-talk Channel integration: nextcloud-talk channel: tlon Channel integration: tlon channel: feishu Channel integration: feishu channel: irc channel: qa-channel Channel integration: qa-channel channel: reef Channel integration: reef channel: buzz size: S labels Aug 4, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Aug 4, 2026
@clawsweeper

clawsweeper Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 6:49 PM ET / 22:49 UTC.

ClawSweeper review

What this changes

The PR adds replyToMode validation to seven bundled channel schemas and makes the shared no-adapter resolver honor per-account reply-threading settings.

Regression provenance

Possible regression — probable (reviewed change; reproduction). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open for explicit maintainer acceptance of the upgrade behavior: account-scoped reply settings that were previously inert can begin changing outbound reply threading. The implementation is otherwise a coherent owner-boundary repair with no blocking correctness finding.

Priority: P2
Reviewed head: a56915a2c31e26b423525911e5b53d0b6283cf83
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch and after-fix terminal evidence are solid; maintainer acceptance of the upgrade semantics remains the material merge decision.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The PR discussion includes a clean-build terminal before/after trace showing account and root reply modes, including canonical account-key matching, with unchanged fallback cases.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR discussion includes a clean-build terminal before/after trace showing account and root reply modes, including canonical account-key matching, with unchanged fallback cases.
Evidence reviewed 6 items Current-main defect: Current main's IRC account schema is strict and lacks replyToMode, while the generic resolver reads only root channel settings; an account-level setting therefore cannot both validate and affect generic delivery.
Owner-boundary repair: The branch declares the shared enum at the schema owner and resolves canonical account entries before root settings, with account chat-type, account default, root chat-type, then root default precedence.
Caller and delivery path: Routed reply preparation passes the route account and chat type into resolveReplyToMode before constructing the delivery context, so the repaired selection reaches outbound delivery.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw --help

Result: PASS (completed)

$ node scripts/run-node.mjs --help
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 103.67 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.7s
node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

[tsdown-build] invocation 2/2 finished in 14.3s
[plugin-control-plane-loads] verified 35 built modules with native require and checked doctor closures
runtime-postbuild: 11 phases completed in 4251ms (slowest: built plugin control-plane loads 3489ms)

OpenClaw 2026.8.1 (a56915a) — All your chats, one OpenClaw.

Usage: openclaw [options] [command]

Options:
  --container ‹name›   Run the CLI inside a running Podman/Docker container named ‹name› (default: env OPENCLAW_CONTAINER)
  --dev                Dev profile: isolate state under ~/.openclaw-dev, default gateway port 19001, and shift derived ports (browser/canvas)
  -h, --help           Display help for command
  --log-level ‹level›  Global log level override for file + console (silent|fatal|error|warn|info|debug|trace)
  --no-color           Disable ANSI colors
  --profile ‹name›     Use a named profile (iso
… output truncated …

Assertions:

  • PASS expect_output: config

How this fits together

Bundled channel schemas validate operator configuration before the shared reply-threading resolver selects whether an outbound reply keeps its target message. That resolved mode then reaches channel delivery as reply metadata.

flowchart LR
  Config[Operator channel config] --> Schema[Bundled channel schema]
  Schema --> Loaded[Loaded channel settings]
  Loaded --> Resolver[Reply-threading resolver]
  Resolver --> Context[Reply delivery context]
  Context --> Filter[Reply target filter]
  Filter --> Delivery[Channel delivery]
Loading

Decision needed

Question Recommendation
Should an upgrade intentionally make existing account-scoped replyToMode values control reply threading on the affected channels? Accept account-scoped activation: Land the repair with the documented account-over-root precedence so valid account settings control reply threading.

Why: The behavior change is the repair's purpose, but whether latent operator settings should become active is an upgrade-policy choice rather than a mechanical correctness question.

Before merge

  • Resolve merge risk (P1) - An upgrade can activate a previously inert account-scoped reply setting on a permissive or otherwise accepted configuration, changing where replies thread without an operator edit.
  • Resolve merge risk (P1) - Production code grows by +64/-12 to add generic account precedence and public schema declarations; this is justified only if maintainers accept account-scoped reply threading as the intended configuration contract.
  • Complete next step (P2) - A maintainer must explicitly accept the intended upgrade behavior before this otherwise-ready PR can merge.
Agent review details

Security

None.

PR surface

Source +52, Tests +163, Generated 0. Total +215 across 20 files.

View PR surface stats
Area Files Added Removed Net
Source 15 64 12 +52
Tests 2 163 0 +163
Docs 0 0 0 0
Config 0 0 0 0
Generated 3 26 26 0
Other 0 0 0 0
Total 20 253 38 +215

Review metrics

Metric Value Why it matters
Production vs test LOC production +64/-12; tests +163/-0; generated +26/-26 The production growth implements canonical account resolution and seven public schema declarations, while tests cover precedence and generated metadata records the contract.

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-reply-to-mode.contract.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Accept the intended upgrade behavior (recommended)
    Approve account-scoped replyToMode taking effect after upgrade, with the PR's precedence and regression coverage retained.
  2. Defer account scope
    Require a narrower root-only schema repair if maintainers do not want latent account settings to alter reply threading yet.

Technical review

Best possible solution:

Accept the documented account-scoped threading contract and land the schema declarations plus one canonical no-adapter resolver; otherwise narrow the PR to root-level validation and leave account scope unadvertised.

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

Yes, source-reproducible: current main strictly rejects the key in affected schemas, and its generic resolver reads only root channel settings. The supplied terminal before/after trace also shows account values winning after the fix.

Is this the best way to solve the issue?

Yes, subject to the maintainer upgrade decision: the PR repairs validation at plugin schema owners and account lookup at the shared generic resolver, while avoiding a shared-schema expansion that would broaden third-party plugin contracts.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded configuration-validation and reply-threading repair with limited channel blast radius.
  • merge-risk: 🚨 compatibility: Existing account-scoped settings can begin changing outbound threading after an upgrade.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR discussion includes a clean-build terminal before/after trace showing account and root reply modes, including canonical account-key matching, with unchanged fallback cases.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR discussion includes a clean-build terminal before/after trace showing account and root reply modes, including canonical account-key matching, with unchanged fallback cases.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main blame assigns the generic root-only resolver lines to this recent core history. (role: recent core reply-threading contributor; confidence: high; commits: 52bce84ca979; files: src/auto-reply/reply/reply-threading.ts)
  • ayaangazali: Earlier merged channel-schema parity work in the provided PR context covers the same configuration-owner pattern. (role: prior schema-parity contributor; confidence: medium; commits: d2c9e74702f4, 11069c3df574; files: extensions/irc/src/config-schema.ts, src/plugins/contracts/channel-reply-to-mode.contract.test.ts)

Rank-up moves

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

  • Record maintainer acceptance of account-scoped reply settings becoming active after upgrade.
  • Wait for exact-head required checks before merge.

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 (19 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-23T22:50:36.593Z sha a66ff6418137c20cddea397bf2a2c7b124ba67f6 :: needs changes before merge. :: [P2] Remove Reef’s inert reply-mode schema field
  • reviewed 2026-08-23T23:03:46.732Z sha a66ff6418137c20cddea397bf2a2c7b124ba67f6 :: needs changes before merge. :: [P2] Remove Reef's inert reply-mode schema field
  • reviewed 2026-08-24T00:00:06.580Z sha df685dc9639e2c3f678eae768f7d8e6627f3b1dd :: needs changes before merge. :: [P2] Remove Reef’s inert reply-mode schema field
  • reviewed 2026-08-24T02:11:05.277Z sha 062170f7e07d56b88473808d024093965cbafaef :: needs maintainer review before merge. :: none
  • reviewed 2026-08-24T06:35:27.633Z sha 1fa4c216f2df042d8415797622e9206f38da4953 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-24T19:01:08.424Z sha d409bc13d4e8f2f1114a973a5efaab842c72552a :: needs maintainer review before merge. :: none
  • reviewed 2026-08-24T19:35:46.933Z sha 7ea41038a8c376df69dbfdd806caeb11aaeae1ce :: needs maintainer review before merge. :: none
  • reviewed 2026-08-25T21:28:53.913Z sha 3acd07801a67fe3fe7c8702ce40c32978b7a3de6 :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot closed this Aug 4, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Aug 4, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 4, 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.

@openclaw-barnacle openclaw-barnacle Bot closed this Aug 4, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Aug 4, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Aug 4, 2026
@ayaangazali

Copy link
Copy Markdown
Contributor Author

CI triage for the red checks-node-changed-extensions-config lane on this branch. I do not think this is caused by the diff, and here is the evidence rather than an assertion.

The failure is extensions/nostr/src/channel.test.ts, returns empty array when not configured, with expected [ 'default' ] to strictly equal []. So listNostrAccountIds({ channels: {} }) returned an account id in that shard.

This branch's entire nostr change is one line:

+  mediaMaxMb: z.number().positive().optional(),

An optional key with no default cannot produce that result. listNostrAccountIds is built with fallbackAccountIdWhenEmpty: false and an implicit resolver that returns an id only when resolveNostrPrivateKey(account?.privateKey) is truthy (extensions/nostr/src/types.ts:39-50). With { channels: {} } there is no nostr section at all, so there is no path from my key to ['default']. This branch does not touch that file.

What I checked locally, on this branch and on unmodified main:

  • node scripts/run-vitest.mjs extensions/nostr/src/channel.test.ts — 45 passed on both.
  • node scripts/run-vitest.mjs extensions/nostr — 269 passed.
  • node scripts/run-vitest.mjs extensions/nostr extensions/googlechat — 48 files, 598 passed, in case the shard grouping leaked state between suites.

I could not reproduce it in isolation or grouped, on either ref.

Worth being precise about my role in it: this lane is changed-files-triggered and does not run on main at all, so there is no baseline to compare against. Touching extensions/nostr/src/config-schema.ts is what selects that test into CI; it is not what makes it fail. Two of my PRs that touch nostr config show the identical assertion, and the ones that do not touch it never run the lane.

I am not pushing a speculative fix for a failure I cannot reproduce and cannot mechanically connect to the change. If a maintainer reruns that shard I expect it green; if it reproduces, the shard's isolation is worth a look on its own, since the value it observes contradicts the resolver's guard.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

Rebased on current main (877c23d9007) and here is the current-head behavior proof you asked for, run as a before/after against the same config so the difference is visible rather than asserted.

Config under test, on a reply-capable channel that registers no threading adapter (clickclack), with the account key deliberately written in operator casing:

channels.clickclack.replyToMode                      = "off"
channels.clickclack.replyToModeByChatType.group      = "first"
channels.clickclack.accounts["Work Team"].replyToMode            = "all"
channels.clickclack.accounts["Work Team"].replyToModeByChatType.group = "batched"
channels.clickclack.accounts.support.replyToMode                 = "first"

Driving the shipped resolveReplyToMode export directly.

Before, on upstream/main (ab5b8b9):

case                                               account     chatType  resolved
account group map wins over channel group map      work-team   group     first
account replyToMode wins over channel group map    support     group     first
channel group map applies with no account          null        group     first
account default applies for an unmapped chat type  work-team   direct    off
channel default applies with no account            null        direct    off
unknown account falls back to channel              nope        group     first

After, on this PR head (877c23d9007):

case                                               account     chatType  resolved
account group map wins over channel group map      work-team   group     batched
account replyToMode wins over channel group map    support     group     first
channel group map applies with no account          null        group     first
account default applies for an unmapped chat type  work-team   direct    all
channel default applies with no account            null        direct    off
unknown account falls back to channel              nope        group     first

Two rows change and four do not, which is the point: the account value now wins where it was previously accepted by the schema and silently ignored (batched instead of first, all instead of off), while no-account, unknown-account, and channel-default resolution are untouched. The "Work Team" key resolving for a routed work-team also exercises the normalized matching, so a preserved operator casing no longer falls back to the root mode.

On your upgrade note: that is exactly right and worth stating plainly. An operator who already set accounts.<id>.replyToMode on one of these channels sees it start taking effect after this lands, where it was previously inert. That is the intended repair rather than a surprise, but it is a behavior change on upgrade and I did not want it buried.

Validation on this head: reply-threading 24 passed, config-cli 187 passed, schema.help.quality 10 passed, and both generated-artifact --check gates clean.

AI-assisted.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed 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. labels Aug 15, 2026
@ayaangazali
ayaangazali force-pushed the fix/reply-to-mode-schema-parity branch from 877c23d to b3b2371 Compare August 16, 2026 19:50
@ayaangazali

Copy link
Copy Markdown
Contributor Author

Rebased onto current main. Main had moved 296 commits ahead of this branch, which is also what the two red checks-node-compact-small shards were about: they were running an old base, not a defect in this change.

Re-ran the behavior trace on the rebased head to be sure the account precedence survived the move, since a clean rebase can still ship stale behavior:

account group map beats channel group map          -> batched
account replyToMode beats channel group map        -> first
channel group map, no account                      -> first
account default, unmapped chat type                -> all
channel default, no account                        -> off
unknown account falls back to channel              -> first

Same as before the rebase, so the account value still wins where the schema accepts it, and no-account and unknown-account resolution are untouched.

Validation on the new head: reply-threading 24 passed, config-cli 188, schema.help.quality 10, both generated-artifact --check gates clean, merges clean with main.

AI-assisted.

@clawsweeper clawsweeper Bot removed the rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. label Aug 16, 2026
@ayaangazali

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (46e44baf460). This branch had picked up the recurring conflict in the generated config baseline (docs/.generated/config-baseline.counts.json and config-baseline.sha256); it is now 0 commits behind and merge-clean.

The baseline was not hand-merged. I reset both generated files to main and re-ran both generators, so the artifacts match what CI regenerates:

node --import tsx scripts/generate-config-doc-baseline.ts --check                  clean
node --import tsx scripts/generate-bundled-channel-config-metadata.ts --check      clean

Local proof at head 8afd3375ad0:

src/plugins/contracts + src/config/schema.help.quality.test.ts   43 files, 1052 passed
src/cli/config-cli.test.ts                                      190 passed

On the red marks: check-lint, check-lint-core-5 and check-docs are failing here, and I do not believe any of them are this branch. All three die during pnpm install before their actual check step runs (::error::pnpm install failed, then Process completed with exit code 1), with no rule violations or docs drift reported. check-lint and check-lint-core-5 are also currently red on main itself (for example 44b41d5686d). This branch touches no package.json, pnpm-lock.yaml or pnpm-workspace.yaml.

I also think I made that worse: I pushed nine rebases within about a minute, so nine fork CI runs hit dependency install at once. That was my mistake in batching, not a change in the code. Happy to re-push to re-trigger if you would rather see a clean run.

AI-assisted.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (4994f7bacf3), 0 behind and merge-clean.

This one needed a real resolution rather than a replay. main changed extensions/nextcloud-talk/src/types.ts in #126251, and the conflict was on the import block, which contained a change of yours as well as mine:

  • main had added OpenClawConfig to the ../runtime-api.js type import (used at types.ts:100 for gateway?: OpenClawConfig["gateway"])
  • this branch adds import type { ReplyToMode } from "openclaw/plugin-sdk/config-contracts" for the account-scoped replyToMode

Resolved as the union, keeping your OpenClawConfig import rather than letting my side of the conflict drop it. Both are present and used at the final head.

The generated baseline was not hand-merged: reset to main and re-ran both generators, then re-verified no drift at the final head.

Verified at the final head (e909c89ddab), not at the resolution commit:

node scripts/run-vitest.mjs src/cli/config-cli.test.ts        191 passed
node scripts/run-vitest.mjs extensions/nextcloud-talk         24 files, 148 passed
node --import tsx scripts/generate-config-doc-baseline.ts --check              clean
node --import tsx scripts/generate-bundled-channel-config-metadata.ts --check  clean

AI-assisted.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

This head is 0 behind and merge-clean.

checks-node-compact-large-12 fails in ui/src/pages/chat/chat-send.test.ts > handleSendChat > retries an explicitly ... with AssertionError: expected 1 to be 2. This PR changes channel config schemas plus extensions/nextcloud-talk/src/types.ts, and touches nothing under ui/.

Measured at this head, three consecutive runs:

run1  271 passed (271)
run2  271 passed (271)
run3  271 passed (271)

expected 1 to be 2 on a retry assertion is a call-count check, which is the shape that goes wrong when a retry has not landed yet rather than when send logic changed. I could not reproduce it and there is no path from a channel config key to the chat send retry path, so I am not pushing a speculative change.

AI-assisted.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

Finding accepted, fixed in 062170f7e07. Verified it at the source before changing anything: extensions/reef/src/channel.ts:182 is resolveReplyToMode: () => "all", so the adapter answers before the generic fallback ever reads config. Accepting the key would have shipped a setting that can never change outbound replies, which is exactly the config surface bar in AGENTS.

Removed replyToMode from extensions/reef/src/config-schema.ts and dropped reef from REPLY_CAPABLE_CHANNELS. The contract file already documented this category for zalo and zalouser, so reef is now recorded there too rather than silently absent:

 * createStaticReplyToModeResolver("off") and reef pins it through a
 * resolveReplyToMode that returns "all", so config would be ignored; ...

That drops one key from the channel surface, so the generated baseline ratchets down from 3598 to 3597. Shrink-only, which is the direction the guard wants.

Schema-PR validation at 062170f7e07, 0 behind:

  • generate-config-doc-baseline.ts --check: exit 0
  • generate-bundled-channel-config-metadata.ts --check: exit 0
  • src/config/schema.help.quality.test.ts: 24 passed
  • src/cli/config-cli.test.ts: 14 passed
  • src/plugins/contracts: 1054 passed, including the replyToMode contract
  • src/auto-reply/reply/reply-threading.test.ts: 10 passed
  • extensions/reef: 300 passed
  • run-tsgo.mjs -p tsconfig.core.json: exit 0

Production delta is now +64/-12, down from +66/-12. The remaining growth is the shared fallback in reply-threading.ts plus the per-channel schema keys for the channels that can actually honor them, which was the justified part of your note.

If reef's adapter is later made configurable, adding the key back is a one-line change plus putting reef back in the contract list.

Channels that register a threading adapter resolve account scope themselves.
The config fallback that serves every other channel dropped the accountId, so
accounts.<id>.replyToMode and replyToModeByChatType validated with no effect
on the channels this PR newly accepts the key for.
…ypes

The generic reply-to-mode fallback looked accounts up by exact key while
routing hands it canonicalized ids, so a preserved config key like "Ops Team"
never matched the routed "ops-team" and the account override fell back to the
root mode. Resolve through resolveNormalizedAccountEntry the same way streaming
resolution does.

Also declares replyToMode on the five account config types whose schemas this
PR taught to accept it, so typed plugin consumers can reach what validation
now allows.
…the SDK baseline

resolveIrcAccount exposes IrcAccountConfig as ResolvedIrcAccount.config, so
typed consumers could not reach the setting the schema now accepts. Widening
the core Omit also expands the public declaration closure, so the Plugin SDK
API baseline is regenerated to match.
The generic fallback consulted the root replyToModeByChatType before the
account default, so a channel-wide chat-type policy overrode the account
setting this resolver exists to honor. Account scope is now exhausted first,
matching Signal's own resolver. Also regenerates the Plugin SDK API baseline,
which the widened Omit publishes through the public config contract.
The core-to-plugin boundary contract greps file contents, so citing
extensions/<id>/src/... in a comment trips it just like a real import would.
The comment keeps the reference without the path.
Reef's threading adapter pins resolveReplyToMode to "all", so it wins before
the generic fallback reads configuration. Accepting the key would have added
an apparently supported setting that can never change outbound replies.

Remove it and record reef alongside the other pinned channels in the contract,
which ratchets the channel baseline down by one.
@steipete

Copy link
Copy Markdown
Contributor

Superseded by merged #129679 (4426f8d). The landed replacement preserves your Feishu, IRC, and Nextcloud Talk root/account reply policies and normalized account precedence, documents all three channels, avoids unsupported or ineffective Buzz/ClickClack/QA/Tlon configuration and unrelated generated-baseline changes, and credits @ayaangazali as co-author. Buzz transport threading remains tracked separately in #120339. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: buzz channel: feishu Channel integration: feishu channel: irc channel: nextcloud-talk Channel integration: nextcloud-talk channel: qa-channel Channel integration: qa-channel channel: tlon Channel integration: tlon docs Improvements or additions to documentation extensions: clickclack 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: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants