Skip to content

fix(channels): honor supported account reply-threading policies - #129679

Merged
steipete merged 2 commits into
mainfrom
codex/issue-119030-reply-threading
Aug 26, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/issue-119030-reply-threading

Conversation

@steipete

@steipete steipete commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Related: #119030

What Problem This Solves

Fixes an issue where operators configuring reply threading for Feishu, IRC, or Nextcloud Talk would have otherwise valid channel settings rejected. Named-account threading settings could also silently inherit the channel-wide setting instead of honoring the account override.

Why This Change Was Made

The channel schemas now expose the existing reply mode only where the actual transport consumes it. The shared threading-policy owner resolves canonical account names and exhausts account-level policy before channel-level policy. Buzz, ClickClack, Tlon, and QA Channel are intentionally excluded because their inbound transports currently hardcode reply anchors, making that setting inert. This preserves the useful work from #119030 without introducing misleading settings or unrelated generated-baseline drift.

User Impact

Feishu, IRC, and Nextcloud Talk operators can control reply threading at channel or account scope. Scalar account overrides, human-form account names, and channel-wide defaults resolve consistently; existing defaults and unsupported channels do not change. Each affected channel now documents both configuration scopes.

Evidence

  • Before the fix, the new owner contract failed for all three affected channels; afterward node scripts/run-vitest.mjs src/plugins/contracts/channel-reply-to-mode.contract.test.ts passes all three cases.
  • Direct execution of the actual shared threading owner with real account normalization and lookup and strict-schema-valid scalar settings proves canonical account/group = all, human-form account/direct = all, a second account override = first, unknown-account fallback = off, and channel-only fallback = off. Before the owner fix, all three account cases incorrectly returned the channel-wide off setting.
  • The full shared threading-owner suite passes all ten cases, and the focused three-channel schema contract passes all three cases.
  • The three affected channel guides document the accepted scalar values, default, and account-level override; MDX and all documentation config examples validate.
  • node --import tsx scripts/generate-bundled-channel-config-metadata.ts --check passes.
  • Focused core lint, formatting, independent architectural verification, and complete two-pass structured review pass.
  • The existing documentation-baseline generator already fails on unmodified main with unrelated core/plugin drift; those unrelated baseline artifacts are deliberately absent from this change.

Original proposal and foundational account-precedence work: @ayaangazali in #119030.

@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added channel: nextcloud-talk Channel integration: nextcloud-talk channel: feishu Channel integration: feishu channel: irc size: S maintainer Maintainer-authored PR labels Aug 25, 2026
@steipete
steipete marked this pull request as ready for review August 25, 2026 23:40
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. 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. labels Aug 26, 2026
@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 10:46 PM ET / August 26, 2026, 02:46 UTC.

ClawSweeper review

What this changes

The PR allows Feishu, IRC, and Nextcloud Talk to accept reply-threading settings at channel and named-account scope, with account policy overriding the channel default.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

No blocking correctness or security defect was found. Keep this maintainer-labeled PR open for exact-head checks and maintainer confirmation of the additive multi-account configuration contract.

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

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is focused and source-supported, with the remaining merge gate limited to exact-head compatibility validation.
Proof confidence 🌊 off-meta tidepool Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR body nevertheless records direct terminal evidence for the shared resolver and focused suites.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR body nevertheless records direct terminal evidence for the shared resolver and focused suites.
Evidence reviewed 6 items Current-main gap: Current main resolves only channel-level chat-type and scalar policy, so a named-account replyToMode cannot affect the generic fallback path.
Shared owner repair: The PR-head resolver canonically finds the routed account and gives its chat-type/scalar policy precedence before the channel policy.
Routing caller: Routed delivery passes the reply account and chat type to the shared resolver before it builds the transport payload.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs src/auto-reply/reply/reply-threading.test.ts

Result: PASS (completed)

[test] starting test/vitest/vitest.auto-reply.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-129679-vsAhA8/target

 ✓  auto-reply  src/auto-reply/reply/reply-threading.test.ts (10 tests) 93ms

 Test Files  1 passed (1)
      Tests  10 passed (10)
   Start at  02:47:24
   Duration  3.25s (transform 2.39s, setup 940ms, import 1.89s, tests 93ms, environment 0ms)

[test] passed 1 Vitest shard in 8.96s
[test] starting test/vitest/vitest.auto-reply.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-129679-vsAhA8/target

 ✓  auto-reply  src/auto-reply/reply/reply-threading.test.ts (10 tests) 57ms

 Test Files  1 passed (1)
      Tests  10 passed (10)
   Start at  02:47:34
   Duration  1.69s (transform 804ms, setup 427ms, import 985ms, tests 57ms, environment 0ms)

[test] passed 1 Vitest shard in 7.38s

Assertions:

  • NOT OBSERVED expect_output: applies canonical account policy before channel-wide threading defaults — command exited successfully; expected output was not observed in the captured pane

How this fits together

Outbound reply preparation reads the routed channel, account, and chat type, then resolves whether to keep a reply reference. Strict plugin schemas must accept the same policy that the shared reply-threading resolver consumes.

flowchart LR
A[Channel configuration] --> B[Strict plugin schema]
B --> C[Account policy lookup]
C --> D[Reply-threading resolver]
D --> E[Outbound reply payload]
E --> F[Channel transport]
Loading

Decision needed

Question Recommendation
Should this PR’s additive named-account reply-threading contract be accepted once exact-head checks confirm the documented defaults remain unchanged? Approve after exact-head checks: Accept the additive schema and precedence contract once CI confirms the current head and existing default behavior.

Why: The patch changes configuration acceptance and precedence for existing multi-account operators; the protected maintainer label requires an explicit maintainer merge judgment.

Before merge

  • Resolve merge risk (P1) - This expands strict configuration acceptance and changes effective precedence for existing named-account deployments; exact-head checks should confirm omitted values retain the current default and explicit account values affect only the routed account.
  • Resolve merge risk (P1) - Production code grows by 28 net lines for a bug fix; the added canonical lookup and three strict-schema declarations are justified by the new accepted configuration contract, with no smaller owner-boundary path found.
  • Complete next step (P2) - The remaining action is maintainer acceptance of a compatibility-sensitive configuration contract after exact-head checks, not an automatable code repair.
Agent review details

Security

None.

PR surface

Source +28, Tests +40, Docs +6, Generated 0. Total +74 across 14 files.

View PR surface stats
Area Files Added Removed Net
Source 8 35 7 +28
Tests 2 40 0 +40
Docs 3 6 0 +6
Config 0 0 0 0
Generated 1 15 15 0
Other 0 0 0 0
Total 14 96 22 +74

Review metrics

Metric Value Why it matters
Configuration contract 3 channel schema families broadened at root and account scope Feishu, IRC, and Nextcloud Talk now accept a previously rejected policy in strict multi-account configuration.
Production versus test LOC production +35/-7; tests +40; docs +6; generated metadata +15/-15 The production growth implements one canonical account lookup plus schema/type alignment; generated metadata is net-neutral.

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. Complete exact-head compatibility validation (recommended)
    Before merge, let exact-head checks confirm the three strict schemas accept the documented account override without changing omitted-value defaults.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Require exact-head checks to pass and verify omitted account policies retain channel defaults.

Technical review

Best possible solution:

Retain one shared account-aware resolver and align only reply-capable channel schemas with it, while preserving the existing default when no account override is configured.

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

Yes, from source: current main’s generic resolver ignores account policy and the three strict schemas reject the setting; the focused owner test encodes the failing precedence cases, though this read-only review did not execute it.

Is this the best way to solve the issue?

Yes: resolving account policy in the shared fallback owner is preferable to adding channel-specific resolver copies, while strict schemas expose only the policy that those transports consume.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: The PR repairs a bounded reply-threading configuration path for three channel plugins.
  • merge-risk: 🚨 compatibility: Existing multi-account configurations gain a new accepted policy and account-over-channel precedence.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR body nevertheless records direct terminal evidence for the shared resolver and focused suites.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main blame attributes the generic reply-policy resolver to this recent commit, and the current PR continues that owner-boundary work. (role: recent area contributor; confidence: high; commits: c1bab399abac, 69f914bc9538; files: src/auto-reply/reply/reply-threading.ts, extensions/irc/src/config-schema.ts)
  • ayaangazali: The linked open PR established the broader schema-rejection report that this narrower implementation explicitly carries forward. (role: related fix proposer; confidence: medium; files: extensions/feishu/src/config-schema.ts, extensions/irc/src/config-schema.ts, extensions/nextcloud-talk/src/config-schema.ts)

Rank-up moves

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

  • Let exact-head checks complete 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 (4 earlier review cycles)
  • reviewed 2026-08-25T23:46:17.037Z sha 0ff521f :: found issues before merge. :: [P2] Align chat-type policy with the strict channel schemas | [P3] Document the newly accepted reply-threading setting
  • reviewed 2026-08-26T00:19:19.263Z sha b1c0a1faedcd73295a59a48bdeeb3cea908a1c88 :: found issues before merge. :: [P2] Align chat-type policy with the strict schemas | [P3] Document the newly accepted reply-threading setting
  • reviewed 2026-08-26T01:58:36.290Z sha b1c0a1faedcd73295a59a48bdeeb3cea908a1c88 :: found issues before merge. :: [P2] Keep the account-policy test schema-valid | [P3] Document the newly accepted reply-threading setting
  • reviewed 2026-08-26T02:14:08.019Z sha 99e8692 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/issue-119030-reply-threading branch from 0ff521f to b1c0a1f Compare August 26, 2026 00:14
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 26, 2026
@steipete
steipete force-pushed the codex/issue-119030-reply-threading branch from b1c0a1f to 99e8692 Compare August 26, 2026 02:08
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Aug 26, 2026
@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. 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. labels Aug 26, 2026
@steipete
steipete force-pushed the codex/issue-119030-reply-threading branch from 99e8692 to 69f914b Compare August 26, 2026 02:40
@steipete
steipete merged commit 4426f8d into main Aug 26, 2026
342 of 344 checks passed
@steipete
steipete deleted the codex/issue-119030-reply-threading branch August 26, 2026 04:09
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 26, 2026
…claw#129679)

* fix(channels): honor supported account reply-threading policies

Co-authored-by: ayaangazali <[email protected]>

* fix(channels): document valid account reply policies

Co-authored-by: ayaangazali <[email protected]>

---------

Co-authored-by: ayaangazali <[email protected]>
vincentkoc added a commit that referenced this pull request Aug 26, 2026
* origin/main: (24 commits)
  fix(gateway): reject rootless session permission modes (#128149)
  docs(memory): document shipped turn-taint propagation for network tool output (#129837)
  fix(ui): pool reply-less wake activity into one chat rollup (#128442)
  fix(package): prevent installs from deleting validated runtime assets (#129724)
  fix(nodes): approve silent initial node surfaces and name the pending surface approval (#129795)
  fix(backup): preserve configured agent state roots (#129773)
  fix(ui): own chat history issuance with a closed state machine (#129776)
  fix(cron): preserve cancellation reason after late finalization (#129331)
  fix(cron): prevent run waits from failing after clock changes (#129805)
  fix(telegram): route commentary through one frozen progress owner (#128259)
  fix(release): start approved VCR mirror recovery jobs (#129829)
  test: complete current-plugin-metadata-snapshot mock factories (#129791)
  test(telegram): remove duplicate reaction case (#129848)
  fix(channels): honor supported account reply-threading policies (#129679)
  refactor(cli): deduplicate lazy subcommand registration (#129351)
  fix(ai): report interrupted local-model streams instead of empty success (#129794)
  refactor(cli): consolidate Gateway fallback and hook ownership (#129802)
  fix(qa): reject token confidence lanes without executed evidence (#129830)
  fix(tui): fence session state and delayed actions (#129810)
  fix(control-ui): keep task progress full width on hover (#129832)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu channel: irc channel: nextcloud-talk Channel integration: nextcloud-talk docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

1 participant