Repository navigation
fix(channels): reply-capable channels reject the documented replyToMode override - #119030
ayaangazali wants to merge 7 commits into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 6:49 PM ET / 22:49 UTC. ClawSweeper reviewWhat this changesThe PR adds Regression provenancePossible regression — probable (reviewed change; reproduction). No predecessor PR is attributed. Merge readinessKeep 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 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherBundled 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]
Decision needed
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
Agent review detailsSecurityNone. PR surfaceSource +52, Tests +163, Generated 0. Total +215 across 20 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (19 earlier review cycles; latest 8 shown)
|
|
Disclosure that affects how the channel list on this PR should be read, found while gathering clean-build proof for a sibling PR. I have been using the generated channel metadata ( Confirmed end to end on a from-scratch build of What I think this does and does not change:
I would rather you hear this from me than discover it in review. Happy to drop the affected channel from the list, or to keep it with the framing corrected to "declares the key explicitly" instead of "rejects it", whichever you prefer. |
|
CI triage for the red The failure is This branch's entire nostr change is one line: An optional key with no default cannot produce that result. What I checked locally, on this branch and on unmodified
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 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. |
44dc1da to
645b377
Compare
645b377 to
877c23d
Compare
|
Rebased on current main ( Config under test, on a reply-capable channel that registers no threading adapter (clickclack), with the account key deliberately written in operator casing: Driving the shipped Before, on After, on this PR head (877c23d9007): 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 ( On your upgrade note: that is exactly right and worth stating plainly. An operator who already set Validation on this head: AI-assisted. |
877c23d to
b3b2371
Compare
|
Rebased onto current main. Main had moved 296 commits ahead of this branch, which is also what the two red 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: 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: AI-assisted. |
|
Rebased onto current 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: Local proof at head On the red marks: 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. |
|
Rebased onto current This one needed a real resolution rather than a replay.
Resolved as the union, keeping your The generated baseline was not hand-merged: reset to Verified at the final head ( AI-assisted. |
|
This head is 0 behind and merge-clean.
Measured at this head, three consecutive runs:
AI-assisted. |
|
Finding accepted, fixed in Removed 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
Production delta is now +64/-12, down from +66/-12. The remaining growth is the shared fallback in 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.
|
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! |
What Problem This Solves
replyToModecontrols 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:39normalizes any channel id,:53readscfg.channels[provider]?.replyToMode, andcreateReplyToModeFilterthen stripspayload.replyToIdfor 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 readctx.replyToModein 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.
replyToModeis 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()fromopenclaw/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>.replyToModeas 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:
After:
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:
imessageandmsteamsomit it on purpose:omit: ["mentionPatterns", "replyToMode"]atextensions/imessage/src/config-schema.ts:40andomit: ["name", "mentionPatterns", "replyToMode"]atextensions/msteams/src/config-schema.ts:81.zaloandzalouserpin it statically: both installcreateStaticReplyToModeResolver("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:57documents that quote-reply is fixed off there.line,nostr,raft,smsandtwitchemit no reply target at all (zeroreplyToIdreferences in theirsrc/), so the filter never applies and the key would be inert config surface.replyToModeByChatType, or any channel's default.allOfas an intersection where one closed component still refuses.Real behavior proof
Both readings come from a full
rm -rf dist && pnpm build, so neither is a stale-dist artifact.Before, on current
mainataa07d55ec98, the eight target channels still reject the key:After, on this branch at
7d692bfbf99, including the account-scoped form:The account form is included deliberately: the generic config fallback previously dropped the account id, so
accounts.<id>.replyToModewould have been accepted and ignored on exactly the channels this PR adds the key to.resolveConfiguredReplyToModenow resolves account then root for bothreplyToModeandreplyToModeByChatType. The seven channels that already accepted the account form onmainregister 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.