Skip to content

fix(channels): honor supported group history limits - #129710

Merged
steipete merged 1 commit into
mainfrom
codex/issue-118152-channel-history-limits
Aug 26, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/issue-118152-channel-history-limits

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #118152

What Problem This Solves

Seven group-capable channels reject their documented channel-level historyLimit setting. LINE and Mattermost additionally ignore valid channel/account history overrides when building their pending inbound context.

Why This Change Was Made

The shared session-history owner already consumes root-level channel history settings. ClickClack, QA Channel, Tlon, Twitch, and Zalo now expose the setting only at that working channel root; their named-account schemas deliberately do not accept an option that the shared transcript owner cannot honor. Both closed Twitch configuration branches expose the root option.

LINE and Mattermost additionally support named-account settings because their actual pending-history owners consume them. Those owners now resolve account, then channel, then the existing global default without treating zero as absent. Separate transcript/compaction account parity remains tracked in #119326; this change does not claim that generic account-scoped transcript limits already work.

Buzz is deliberately excluded: its independently declared strict manifest schema does not support the setting. Existing Buzz room-level sender policies remain intact. Unrelated stale generated documentation-baseline drift is also excluded.

User Impact

Operators can use the existing documented root-level history setting on ClickClack, LINE, Mattermost, QA Channel, Tlon, Twitch, and Zalo. LINE and Mattermost pending inbound history additionally respects real channel/account overrides and an explicit zero. Existing generic transcript handling for zero is unchanged: zero disables these pending buffers, but does not mean that the generic transcript limiter removes all retained conversation history.

Evidence

  • The focused seven-channel configuration contract failed for all seven channels before the schema changes and passes afterward, including both Twitch union branches and assertions that only LINE/Mattermost expose named-account settings.
  • The real LINE webhook delivery boundary failed three account/root/zero cases before the owner repair; its full focused suite now passes all ten tests.
  • The real Mattermost pending-history recording boundary failed two account/zero cases before the owner repair; its focused suite now passes all three tests.
  • node --import tsx scripts/generate-bundled-channel-config-metadata.ts --check passes; direct generated-metadata inspection proves the existing Buzz room sender-policy fields remain present.
  • Core production, plugin production, core-plugin-contract tests, and plugin tests all pass their respective TypeScript checks. Formatting and independent structured review are clean.

Original investigation and channel-owner fixes: @ayaangazali in #118152.

@clawsweeper

clawsweeper Bot commented Aug 26, 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: line Channel integration: line channel: mattermost Channel integration: mattermost channel: tlon Channel integration: tlon channel: zalo Channel integration: zalo channel: twitch Channel integration: twitch channel: qa-channel Channel integration: qa-channel extensions: clickclack size: M maintainer Maintainer-authored PR labels Aug 26, 2026
@steipete
steipete marked this pull request as ready for review August 26, 2026 00:33
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 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, 8:39 PM ET / August 26, 2026, 00:39 UTC.

ClawSweeper review

What this changes

Adds root-level historyLimit validation for seven bundled group-capable channels and resolves LINE/Mattermost pending-history limits from account, channel, then global defaults.

Regression provenance

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

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

This PR remains necessary: current main still rejects the documented root override and LINE/Mattermost still ignore it for pending inbound history. The branch uses the owning schemas and buffer owners, with no concrete correctness finding found.

Priority: P1
Reviewed head: 7b804dc38c4378db8ebe72852247852b89ed0000

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, owner-aligned repair with targeted regression coverage; exact-head checks are still in progress.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body supplies focused after-fix test evidence, but no live-channel claim was required for this review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body supplies focused after-fix test evidence, but no live-channel claim was required for this review.
Evidence reviewed 7 items Current-main gap: Current main passes only the global group-history default to LINE's webhook handler, so a valid LINE channel/account override cannot affect its pending history.
Current-main gap: Current main likewise creates Mattermost's pending-history window from only the global default.
Owner-boundary repair: The branch keeps root-only support on schemas backed by the shared resolver, while LINE reads its merged account configuration at the webhook boundary without treating zero as absent.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs src/plugins/contracts/channel-history-limit.contract.test.ts

Result: FAIL (partial) — step 2 expect_output supported channel history limits: expected terminal output was not visible within 30 seconds: "supported channel history limits"

[test] starting test/vitest/vitest.contracts-plugin.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-129710-Rixk0X/target

 ✓  contracts-plugin  src/plugins/contracts/channel-history-limit.contract.test.ts (7 tests) 6ms

 Test Files  1 passed (1)
      Tests  7 passed (7)
   Start at  00:40:16
   Duration  557ms (transform 341ms, setup 54ms, import 130ms, tests 6ms, environment 0ms)

[test] passed 1 Vitest shard in 952ms
[test] starting test/vitest/vitest.contracts-plugin.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-129710-Rixk0X/target

 ✓  contracts-plugin  src/plugins/contracts/channel-history-limit.contract.test.ts (7 tests) 6ms

 Test Files  1 passed (1)
      Tests  7 passed (7)
   Start at  00:40:19
   Duration  274ms (transform 68ms, setup 25ms, import 25ms, tests 6ms, environment 0ms)

[test] passed 1 Vitest shard in 653ms

Assertions:

  • FAIL expect_output: supported channel history limits

How this fits together

Channel configuration is validated from bundled plugin schemas before the gateway starts. The shared transcript resolver consumes root channel limits, while LINE and Mattermost also feed effective limits into their own pending inbound-history buffers before prompt construction.

flowchart LR
  A[Operator channel configuration] --> B[Bundled channel schemas]
  B --> C[Generated configuration metadata]
  C --> D[Shared transcript history resolver]
  C --> E[LINE and Mattermost inbound handlers]
  D --> F[Agent prompt history]
  E --> G[Pending inbound context]
  G --> F
Loading

Before merge

  • Resolve merge risk (P1) - Production code grows by 16 net lines across independent plugin schemas and inbound owners; that growth is justified by the documented configuration contract and cannot be absorbed into one shared owner without incorrectly advertising account support.
  • Complete next step (P2) - No mechanical repair remains; this maintainer-authored, protected-label PR needs normal exact-head CI completion and merge review.
Agent review details

Security

None.

PR surface

Source +16, Tests +137, Generated 0. Total +153 across 15 files.

View PR surface stats
Area Files Added Removed Net
Source 11 27 11 +16
Tests 3 138 1 +137
Docs 0 0 0 0
Config 0 0 0 0
Generated 1 19 19 0
Other 0 0 0 0
Total 15 184 31 +153

Review metrics

Metric Value Why it matters
Production versus regression coverage production +16, tests +137, generated metadata 0 net The production growth is limited to seven strict schema declarations and two actual pending-history owners; focused tests cover schema exposure and effective-limit precedence.

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the scoped schema additions and the two owner-level precedence repairs after exact-head checks complete; retain root-only support for channels whose shared transcript owner does not yet honor account scope.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the scoped schema additions and the two owner-level precedence repairs after exact-head checks complete; retain root-only support for channels whose shared transcript owner does not yet honor account scope.

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

Yes—source-reproducible: current main’s strict schemas omit the documented key, and LINE/Mattermost pass only the global default at their pending-history boundaries.

Is this the best way to solve the issue?

Yes—the branch repairs validation at each plugin schema and resolves account precedence only where that channel’s actual pending-history owner can honor it.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P1: Documented channel history overrides currently reject configuration or silently have no effect on pending inbound context for affected channels.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body supplies focused after-fix test evidence, but no live-channel claim was required for this review.

Label justifications:

  • P1: Documented channel history overrides currently reject configuration or silently have no effect on pending inbound context for affected channels.
  • 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: This maintainer-authored PR is exempt from the external-contributor proof gate; its body supplies focused after-fix test evidence, but no live-channel claim was required for this review.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main history shows substantial Line and Mattermost account-resolution and inbound-monitor work, including the account-resolution refactor and recent Mattermost monitor maintenance. (role: recent area contributor; confidence: high; commits: 08b1ff73e2f3, 24c463749fb1; files: extensions/line/src/accounts.ts, extensions/mattermost/src/mattermost/accounts.ts, extensions/mattermost/src/mattermost/monitor-posts.ts)
  • ayaangazali: Authored the merged schema-parity repair that established the same documented-channel configuration boundary and is credited in the related investigation. (role: adjacent configuration-contract contributor; confidence: high; commits: 11069c3df574; files: extensions/line/src/config-schema.ts, extensions/mattermost/src/config-schema-core.ts)

Rank-up moves

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

  • Let the exact-head required 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.

@steipete
steipete merged commit 4c4152e into main Aug 26, 2026
280 checks passed
@steipete
steipete deleted the codex/issue-118152-channel-history-limits branch August 26, 2026 01:23
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

channel: line Channel integration: line channel: mattermost Channel integration: mattermost channel: qa-channel Channel integration: qa-channel channel: tlon Channel integration: tlon channel: twitch Channel integration: twitch channel: zalo Channel integration: zalo extensions: clickclack maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. 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.

1 participant