Repository navigation
fix(irc): drop the never-read mentionPatterns config key - #119356
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 5:54 PM ET / 21:54 UTC. ClawSweeper reviewWhat this changesThe PR removes IRC’s unused root- and account-level Merge readinessNo blocking correctness finding: this is a coherent owner-boundary repair for an IRC setting that current main accepts but never reads. It remains necessary; a maintainer must accept the intentional Doctor-backed retirement of a previously accepted saved setting before merge. Priority: P2 Review scores
Verification
How this fits togetherThe IRC plugin validates saved channel configuration before receiving inbound messages, while shared mention matching reads agent or global group-chat patterns. Doctor loads the IRC plugin’s compatibility contract to repair retired settings before strict validation. flowchart LR
A[Saved IRC configuration] --> B[Doctor compatibility contract]
B --> C[Strict IRC schema]
C --> D[IRC inbound message]
D --> E[Shared mention matching]
E --> F[Agent or global group-chat patterns]
Decision needed
Why: The implementation is mechanically sound, but removal changes a shipped configuration contract and requires maintainer intent about the upgrade behavior. Before merge
Agent review detailsSecurityNone. PR surfaceSource +21, Tests +65, Generated 0. Total +86 across 14 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retire the inert IRC key with the current root-and-account Doctor migration, leaving agent and global group-chat mention patterns as the only supported configuration path. Do we have a high-confidence way to reproduce the issue? Yes at source level: current main accepts the IRC array while inbound mention matching has no reader for it. The supplied built-CLI transcript also demonstrates the fixed strict-validation and Doctor-repair sequence, though this review did not execute contributor code. Is this the best way to solve the issue? Yes, conditional on maintainer acceptance of the compatibility transition: deleting the inert local setting and migrating it at the plugin Doctor owner avoids introducing a second mention-pattern source of truth. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5b605da38946. 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 (28 earlier review cycles; latest 8 shown)
|
|
Fixed, and the finding was right: removing only the extension-local field left The declaration is gone along with its now-unused Also added the rejection coverage you asked for, in Verification on the rebased head: Thanks for catching the core half. I had grepped |
0c72259 to
16ca2da
Compare
|
Root cause: Verified locally on the new head: Worth noting this is the second thing the removal pulled with it, after the core |
|
Three of my open PRs are now failing that job, with completely unrelated diffs, all in the same suite with the same errors:
The failing log for this PR contains zero references to I also ran that suite locally on the #119326 branch, and it passes 21/21. The durations are the interesting part: Those are per-test durations on an unloaded local machine against CI's 150000ms cap. The slowest single test is already using about 58% of the budget with nothing competing for the box, so on a contended runner it tips over. That matches the failure signature exactly: timeouts and 30s gateway RPC waits, never an assertion. To be clear about the premise, since it was raised: Not pushing a speculative commit, and I cannot rerun jobs myself ( The parts of this PR I can verify are green locally: |
|
Answering rather than pushing, because there is now a clean result that settles this. The red check here is still pointing at run 30960716338 on the unchanged head The decisive new evidence: #119357 just went
I am deliberately not pushing anything here. This PR is at Worth raising separately: that suite's timing margin will keep producing red on unrelated PRs until it is either given more headroom or split. Happy to file it as its own issue with the numbers above if that is useful rather than noise. Local state on this head is unchanged and green: |
|
Rebased onto The only conflict was Verified after regenerating:
No source changes in this push — the four original commits are unchanged, this is only the merge plus regenerated output. That also puts the PR on a fresh CI run rather than the stale |
fdc88bf to
f3b782e
Compare
a75c3e2 to
9bfd4e0
Compare
|
Rebased onto current main; the branch was 50 commits behind. Both red checks look environmental rather than ours, and here is the evidence rather than an assertion.
So the analysis never started. Across my open PRs the Security High suite runs seven checks each; six pass everywhere, and the single failure lands on a different member per PR with no code annotations. That is an init flake, not a finding.
The rebase re-runs both lanes on a current base. Happy to dig further if either reproduces on the new head. AI-assisted. |
9bfd4e0 to
58ac975
Compare
638fcf2 to
3258367
Compare
|
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. |
dc4ad4f to
7bd9ab5
Compare
|
Rebased onto current Failing cases: The assertions are downstream of an unhandled harness error in the same job: That is the WebSocket message wait in // enough to avoid flaky RPC timeouts, but still fail fast when a response
// never arrives.
timeoutMs = 10_000,The shard recorded the whole file at 32657ms. Locally on this head the same file is 55 passed (55) at about 19s of test time, so a single RPC wait crossing 10s on a loaded 4-vCPU hosted shard is not a stretch. The count assertion then reads This branch only deletes the never-read On the fix shape, I did not want to just push a bigger number. Raising a timeout is one of the things this repo's AGENTS.md explicitly lists as masking a root cause, and AI-assisted. |
7bd9ab5 to
d89fe72
Compare
d89fe72 to
d48b3b2
Compare
|
Rebased onto current The Verified at this head, both generated-artifact gates clean and the suites this PR owns passing. Nothing about the change itself moved; same diff, newer base. AI-assisted. |
d48b3b2 to
cff8393
Compare
|
Rebased onto current The jump to ten red checks on the previous head, including
So this push simply moves the branch past that window. Nothing about the change itself moved; same diff, newer base. AI-assisted. |
|
Rebased head is 0 behind and merge-clean, and the previous batch of red cleared. The one remaining red, Measured at this head: I could not reproduce it, and there is no path from an IRC config key to the Claude live-process approval flow. Not pushing a speculative change. AI-assisted. |
cff8393 to
2b41a36
Compare
The IRC schema accepted channels.irc.mentionPatterns and the type declared it, but nothing in the IRC runtime ever read it, so operators could set a mention allowlist that silently did nothing. Restored after an earlier rebase of this branch resolved a conflict in extensions/irc/src/config-schema.ts in favour of main and reverted the removal, leaving the PR carrying only generated-baseline churn.
|
Thanks @ayaangazali! Proof: Exact current main accepts the retired IRC
Example
Maintainer decision
Review metrics
CI attribution
Final gates
Local verification
|
What Problem This Solves
channels.irc.mentionPatternsis accepted by the IRC config schema and read by nothing.It is declared in two places and never used anywhere else:
extensions/irc/src/config-schema.ts:56-mentionPatterns: z.array(z.string()).optional()extensions/irc/src/types.ts:59-mentionPatterns?: string[]A repo-wide search for the key outside those two files returns no reader in
extensions/irc/srcand none in core. It has been dead since the key was introduced in the original "feat: IRC - add first-class channel support" commit, it is not mentioned indocs/channels/irc.md, and no commit ever wired it intoinbound.tsormonitor.ts.Two things make it worse than a merely unused field.
It cannot work through the core path either. IRC's inbound calls
core.channel.mentions.buildMentionRegexes(config as OpenClawConfig)(extensions/irc/src/inbound.ts:287) with no options object, soresolveMentionPatternPolicynever receives a provider and cannot look up channel policy at all.And the name collides with a different core concept. Core's
channels.<channel>.mentionPatternsis the scoping policy object{mode, allowIn, denyIn}, andisMentionPatternsPolicyConfigexplicitly rejects arrays. So an operator who copies the documented policy form into IRC gets a validation error, and one who guesses the array form gets silence. Either way the setting does nothing.Mention patterns for IRC already come from the global mechanism,
messages.groupChat.mentionPatterns(and the per-agentagents.entries.*.groupChat.mentionPatterns), which IRC picks up throughbuildMentionRegexes. So the channel-local key is redundant as well as inert.Why This Change Was Made
Removing the key is the smaller and more honest fix than wiring a second, IRC-only pattern list that would duplicate the global one.
Because the key was accepted by a shipped schema, removing it alone would turn a loading config into a failing one. Root
AGENTS.mdrequires a matchingopenclaw doctor --fixmigration for exactly that case, so this PR adds one to IRC's existing doctor contract rather than only deleting the field.The migration extends what is already there instead of introducing a parallel surface.
extensions/irc/doctor-contract-api.tsalready exportedlegacyConfigRulesandnormalizeCompatibilityConfigfor the streaming alias migration, so the retired-key rules compose onto that list and the strip runs after the alias normalization on the same config. It uses the sharedstripRetiredChannelKeyshelper withscope: "root-and-accounts", the same helper Telegram uses for its retired tuning knobs, so root and everyaccounts.<id>are covered by one call.Production LOC is net negative on the schema side (two declarations removed) and the config surface shrinks:
docs/.generated/config-baseline.counts.jsonchannel count goes 3692 to 3688.User Impact
channels.irc.mentionPatternsis no longer accepted. An operator who has it set gets a clear message naming the supported replacement, andopenclaw doctor --fixremoves the key for them at both root and account scope. Nobody loses behavior, because the key never had any.This is a removed config surface, so it is upgrade-sensitive by nature. The migration is the mitigation, and the proof below walks the exact upgrade path an affected operator hits.
Evidence
All CLI output below is from a full
rm -rf dist && pnpm build, so none of it is a stale-dist reading.Starting config, with the retired key at both scopes:
{ "channels": { "irc": { "host": "irc.libera.chat", "nick": "openclaw-bot", "mentionPatterns": ["\\bopenclaw\\b"], "accounts": { "work": { "nick": "openclaw-ops", "mentionPatterns": ["\\bops\\b"] } } } } }openclaw doctor --fixreports both rules:openclaw config get channels.ircthen loads cleanly.Worth saying plainly: my first attempt at this migration did not work. I registered the hooks on the channel plugin's
doctor:adapter block, and this exact CLI walkthrough showeddoctor --fixfailing with the same validation error instead of repairing the config. The doctor contract registry loadsdoctor-contract-api.*from the plugin root (src/plugins/doctor-contract-artifact.ts:18), not that adapter block, so the migration never ran. Moving it todoctor-contract-api.tsis what made step 2 work. Recording it because the schema-only half of this PR would have looked fine in tests while stranding real configs.Tests:
node scripts/run-vitest.mjs extensions/ircgives 20 files / 144 tests passing, including 2 added cases that assert both new rules match only when the key is present and that the strip clears root and account scope while preserving neighboring fields.Gates:
generate-bundled-channel-config-metadata.ts --checkclean,check-extension-package-tsc-boundary.mjsexit 0, oxlint clean on the changed files,git diff --checkclean. Metadata and config-doc baseline regenerated with the repo generators, not by hand.AI-assisted: written with AI assistance. I read the schema, the IRC inbound mention path, the core policy resolver, the doctor contract registry, and the existing IRC doctor contract myself, and ran the build, the CLI walkthrough, and the tests locally.