Repository navigation
fix(irc): config validation rejects the documented healthMonitor override - #117302
Conversation
|
Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 1:54 AM ET / 05:54 UTC. ClawSweeper reviewWhat this changesThe PR lets IRC accept documented channel and account health-monitor settings, aligns its config type and generated metadata, and adds a focused validation regression test. Merge readiness✅ Ready for maintainer review This repair remains necessary: current main and v2026.9.2 still omit the documented IRC override. The narrowed patch resolves the validation mismatch, retains convincing CLI proof, and has no actionable correctness findings. Priority: P2 Review scores
Verification
How this fits togetherIRC configuration passes through plugin-owned validation before the Gateway can use it. The Gateway already reads account and channel health-monitor settings to decide whether automatic health-monitor restarts are enabled. flowchart LR
A[IRC channel settings] --> C[IRC config validation]
B[Named account settings] --> C
C --> D[Validated configuration]
D --> E[Account override then channel default]
E --> F[Monitor restarts enabled or skipped]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +12, Tests +16, Generated 0. Total +28 across 6 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the repair in IRC's schema and type while preserving the Gateway's existing precedence and enabled-by-default behavior. Do we have a high-confidence way to reproduce the issue? Yes. Current-main strict schemas reject healthMonitor at both IRC scopes, and the contributor supplies a matching before/after built-CLI validation transcript; this review did not execute target code. Is this the best way to solve the issue? Yes. Adding the existing contract to IRC's schema fixes the rejection at its owner without introducing another resolver, changing defaults, or widening the shared plugin SDK. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5579546f18c8. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (90 earlier review cycles; latest 8 shown)
|
|
CI note: The failing case is Why I do not think this PR caused it:
So this looks like a shard/environment issue rather than a defect in the change. I have not pushed anything speculative at gateway, tooling, or memory-core level, since nothing here touches them. Happy to rebase onto the newest |
3b93111 to
2e9d539
Compare
|
Follow-up: rebased onto current The evidence that this is not from this PR got a bit stronger while I waited:
I will report the result of the fresh run either way. If it fails again on this head I will stop treating it as environmental and dig into the planner properly. |
|
Closing the loop: |
|
Pushed a baseline fix: Regenerated with the repo generator ( I hit the same thing on my other schema PRs today and have fixed each one the same way. |
|
Both findings addressed in 1. 2. Traverse composed schema alternatives. Also correct, and fixing it exposed a real defect in a sibling PR. That does not change this PR's verdict, because Twitch is not one of the nine channels |
|
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 The The same job also logged a separate QA matrix harness error, which is not a test assertion at all: Measured on this head: This branch changes the IRC config schema, one contract test and the generated baselines. It touches nothing under Worth noting how this lane gets selected: it is triggered by changed extension config paths, so touching Not pushing anything speculative. Happy to push a no-op refresh to re-trigger if a rerun is inconvenient. AI-assisted. |
|
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. |
|
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.
This branch changes the IRC health-monitor config schema. It touches nothing under Worth restating how this lane selects work, since it keeps looking incriminating: AI-assisted. |
|
Finding accepted, fixed in
if (Array.isArray(schema.oneOf) && schema.oneOf.length > 0) {
const accepting = schema.oneOf.filter((branch) => !rejectsKey(asSchema(branch), key)).length;
if (accepting !== 1) {
return true;
}
}
if (Array.isArray(schema.anyOf) && schema.anyOf.length > 0) {
return schema.anyOf.every((branch) => rejectsKey(asSchema(branch), key));
}New One deliberate exception, and it is worth flagging because my first attempt got it wrong. I initially applied the same counting to const healthMonitor = asSchema(schema.properties?.healthMonitor);
if (!healthMonitor) {
return true; // "constrains nothing here"
}So counting its trues would treat "constrains nothing" as a matching Validation at
The runtime schema repair is unchanged, as you noted it needed to be. |
|
The failure is one browser test: This PR changes the IRC config schema, its types, and a contract test. It contains no browser files, and The test drives a mock CDP server through This is the second distinct browser test to fail on this same shard across two of my unrelated PRs today. #125977, which touches only That mirrors #125976, where the same shape was recorded for I have rebased onto current |
|
Not from this diff. This PR changes three files under That harness is being actively stabilised on
I rebased so the branch carries both. New head One caveat I would rather state than leave implied: this file also fails locally for me on pristine This is the fourth failure on this PR in two days where the failing file was one the diff does not touch and the cause was the branch trailing a main-side fix: |
|
Added the final-head both-scopes proof the last review asked for. The earlier terminal readback was root-scope only and was not tied to a specific head, which is what left this at
I built the CLI from source on each revision rather than reusing one build, so the before and after come from their own trees. |
|
Pushed the consolidation, rebased onto current main. All three review points are addressed. P1/P2, one evaluator instead of two. The duplicate now lives in One thing worth flagging, because I got it wrong on the first attempt. I started by extracting the evaluator from The P3, the vacuous account assertion. Fixed, and here is the channel it was hiding. I counted the account-entry schemas each documented channel actually resolves to:
Validation, all at the final rebased head
One proof gap, stated plainly: Net effect on the two contracts is -141 lines; the shared helper is 156. Follow-up, not in this PR. |
|
Three red checks on
This is the same failure already diagnosed on #139598: #139592 added
This branch changes no file in that test's graph. The diff is limited to the IRC config schema, two contract tests, one new test helper, and the regenerated config baseline artifacts, with nothing under I do not have rerun rights on this repository, so I cannot retry the two jobs myself. Happy to rebase again whenever the shard limit is sorted out. |
The parent-key assertions pass for a strict empty healthMonitor object while the documented enabled setting is refused, so they did not pin the contract.
An allOf component that is closed and omits healthMonitor entirely refuses the leaf at config load, but the helper reported it as not rejecting, so the contract stayed green on a schema that cannot load.
…ust its shape
The leaf assertions only proved healthMonitor.enabled was structurally present
and not rejected, so a leaf typed as anything else would pass while real config
loading refused the documented { enabled: false }.
…d branch The value check reused propertySchema, which returns the first matching branch, so an allOf sibling typing enabled as a string would still report the documented boolean as accepted while real config loading refused it.
…check Flattening anyOf/oneOf into the same every() as allOf over-rejected a valid union, where one accepting branch is enough. The value check now mirrors the combinators rejectsKey uses: alternatives need one match, components need all.
…helpers The key helpers collapsed anyOf and oneOf into one any-branch reading, so a oneOf whose documented value matches two branches was reported as accepted even though config load refuses it. Count accepting branches for oneOf and keep the union reading for anyOf. acceptsDocumentedOverride keeps the union reading on purpose: it returns a vacuous true for a component that says nothing about the leaf, so counting those trues would treat "constrains nothing" as a matching branch.
… contracts The health-monitor and configWrites contracts each carried their own JSON-Schema combinator walk. The two had already drifted: the configWrites copy flattened every combinator and reported a key as rejected when any reachable closed alternative omitted it, which is wrong under anyOf, where a config validates as soon as one branch accepts. The health-monitor copy models oneOf exclusivity, anyOf union and allOf intersection properly. Move the correct evaluator to a shared test helper and point both contracts at it, so the same schema can no longer produce two different answers. The combinator unit tests now cover the shared helper directly. Also fixes a vacuous assertion: msteams publishes no accounts envelope, so the parent account-scope check resolved to undefined and passed without testing anything. Account entries are now enumerated, and channels without an envelope are skipped explicitly rather than silently.
|
Rebased onto Nothing about the change itself moved. Still 8 files, 3 of them the regenerated config baseline artifacts, and 3 added lines of IRC production code. Contracts pass 98, |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
What Problem This Solves
docs/gateway/health.mddocumentschannels.<provider>.healthMonitor.enabledand lists IRC among the channels that expose the override. IRC's strict schema rejects that key at both channel and named-account scope, so following the documentation refuses the configuration before the existing Gateway health-monitor precedence can use it.Why This Change Was Made
The repair belongs in IRC's plugin-owned schema, beside its existing
configWritesfield. IRC hand-builds its account schema, so it declares the same optional strict boolean leaf already consumed by the Gateway.buildMultiAccountChannelSchemareuses that account base for root and named-account configuration.The review-driven global contract expansion was removed. The existing
channel-config-writescontract is restored byte-for-byte, and the proposed shared schema helper and global health-monitor contract are absent. One focused test beside IRC'sconfigWritestest safe-parses both supported scopes and asserts their values.User Impact
IRC operators can disable health-monitor restarts per channel or per account as documented instead of having the entire configuration rejected. Behavior is unchanged when the optional key is absent, and the Gateway's existing account-over-channel precedence is untouched.
Evidence
Retained contributor real behavior proof
The contributor built the CLI from source at both revisions and ran the same dry-run validation with an isolated
OPENCLAW_STATE_DIR, so no real configuration was touched. The payload set the key at root scope and at a named account in one patch:{ "channels": { "irc": { "healthMonitor": { "enabled": true }, "accounts": { "libera": { "healthMonitor": { "enabled": false } } } } } }Before, on main
f1782c7a36d, the command exited 1:After, on repaired production head
af66cc8fb8e, the command exited 0:The current head retains the same IRC schema, type, and generated metadata repair. Its only follow-up change removes the global test/helper expansion and adds the focused IRC regression:
healthMonitor.enabledsafe-parses asfalse;healthMonitor.enabledsafe-parses astrue;configWritescontract is restored exactly.The contributor previously reported
extensions/irc166/166, the full plugin-contract lane green, zero core type errors, and a clean generated-metadata check on the repaired production bytes. The maintainer repair did not execute contributor code locally; fresh exact-head hosted CI is the execution authority.