Repository navigation
fix(channels): feishu and mattermost reject the contextVisibility key their runtime reads - #117287
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 10:23 AM ET / 14:23 UTC. ClawSweeper reviewWhat this changesThe branch makes Feishu and Mattermost accept the existing Merge readinessKeep open: this remains a focused repair for a current configuration-validation defect. The owner-schema changes align the documented setting with both channels’ existing runtime resolution, and no blocking patch defect was found. Priority: P1 Review scores
Verification
How this fits togetherChannel configuration is validated before a channel starts, then inbound handlers resolve flowchart LR
A[Operator configuration] --> B[Plugin-aware validation]
B --> C[Feishu and Mattermost schemas]
C --> D[Channel startup]
D --> E[Inbound context policy resolver]
E --> F[Filtered history and quotes for the model]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +7, Tests +29, Docs 0, Generated 0. Total +36 across 9 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the owner-schema declarations, Mattermost type alignment, regenerated metadata, and boundary validation once exact-head checks complete; keep the shared resolver unchanged. Do we have a high-confidence way to reproduce the issue? Yes. A clean-build CLI validation path is documented in the PR body, and current-main source independently shows the strict schemas omit a setting that both runtimes resolve. Is this the best way to solve the issue? Yes. Adding the existing shared enum at each plugin’s schema owner is narrower and safer than changing the shared builder, because only these runtimes consume this policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fae557490851. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (31 earlier review cycles; latest 8 shown)
|
|
Correction, and CI caught me being wrong. In the PR body I said Feishu already accepts What misled me: I ran the "before" check against a working tree whose So the fix now covers both channels, which is what the original diff did before I trimmed it. Pushed as I also changed the contract test to assert against the generated channel metadata instead of calling One unrelated note: Sorry for the churn. The rest of the PR body stands, and I will re-check the "what I did not change" claims the same way before asking anyone to look again. |
|
Both review items are addressed in The typed-contract finding was correct. Feishu clean-build proof added. I rebuilt with Same config on a from-scratch build of Worth flagging since it shaped this PR: the reason my earlier Feishu claim was wrong is that |
323eb5d to
f273358
Compare
|
On the baseline-shrink finding: the contraction is real, but it belongs to Bisect on unmodified checkouts, no local diff:
The gap is
So this branch is not discarding supported channel config. It reruns the generators on the current merge base and commits what they produce, which is the accurate count for a tree that no longer contains QQBot. Preserving I have reported it on #107295 with the same evidence rather than opening a chore PR for a one-command regeneration on someone else's change; happy to send that PR if a maintainer would rather have it from outside. |
|
Follow-up on the baseline finding: it is resolved upstream, and this branch is rebased so the diff now reads correctly.
The practical effect here is that this PR's baseline diff no longer looks like a deletion. Rebased onto current Both generator |
|
Rebased onto current main; this one merges clean again. There is a structural problem with this sweep that I should have flagged sooner, and it is mostly mine to fix. Seven of these schema-parity PRs each commit a regenerated If it would help, I am happy to collapse the family into a single PR: one regenerated artifact, one review, one merge. The individual changes are small and independent, so a single PR would still read per key:
I would open the combined PR, carry over the evidence, and close the other six pointing at it. Equally happy to leave them exactly as they are if you would rather take them one at a time, or to close the whole set if the parity sweep is not worth your review time right now. Any of those three is a fine answer and I will do the work either way. I did not want to restructure seven open PRs without asking first. AI-assisted. |
|
Rebased onto current main; the branch was 50 commits behind. On the red The rebase re-runs it on a current base. AI-assisted. |
|
Rebased onto current main. The red The failing case is This PR touches Ran it locally to be sure rather than asserting from the file list:
The rebase re-runs that shard on a current base. Contract and config-cli suites pass on the new head (4 and 188), and both generated-artifact Separately, the earlier AI-assisted. |
|
These red checks are a GitHub platform incident, not this branch. Evidence rather than assertion. GitHub's own status API, checked while writing this: My own API probes from the same session: GraphQL failing 2 of 6 calls, REST healthy. A The failing checks match that shape:
One check I could not read: Since I could not read it, I ran the equivalent suites locally on this exact head instead. All green, no failures. I am deliberately not force-pushing a rebase to re-roll CI while the incident is open: it would re-run straight back into the outage and would mean acting on API data I already know is unreliable. The branch is 0 behind 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 The remaining red is I want to be straight about what I can and cannot show here. These are real assertion failures rather than timeouts, so I am not going to wave them off as runner load the way I did for two sibling PRs today. What I can show: this PR changes
What I cannot show: the CI shard is If you would rather I keep digging on that shard specifically before this is considered, say so and I will. AI-assisted. |
|
Rebased onto current Two red shards, and neither reproduces here.
That is the WebSocket wait in
(The count differs only because this branch is slightly behind on test additions.) So it passes on both sides locally and I have no reproduction. This branch changes one Feishu config schema file, four Mattermost files, one contract test, one docs page and the generated baselines. There is no path from it to the CLI updater or to gateway chat. I am not going to keep force-pushing to chase a green run on these. If you want a rerun I am happy to push a no-op refresh, and if you would rather I dig into either shard properly before this is considered, say which and I will. AI-assisted. |
|
Rebased onto current The Exit 143 is 128 + 15, so the shard was SIGTERMed. The log is 90KB with no test summary, no failing assertion and no timeout message, which means it was terminated part way through rather than finishing with a result. Nothing to fix on the branch from that, and I would rather say so than push a speculative change. Happy to push a no-op refresh to re-trigger. Separately, the earlier AI-assisted. |
|
The whole log is 11KB and contains no oxlint output and no formatter output, because the workspace was never populated. That is an infrastructure or credential failure on the runner, not something this branch can cause or fix. This head is 0 behind and merge-clean, and the contract suites plus both generated-artifact gates are green locally. AI-assisted. |
|
Rebased onto current main. Same note as the sibling branches: #129710 added contextVisibility: ContextVisibilityModeSchema.optional(),
historyLimit: z.number().int().min(0).optional(),Local checks at the new head: |
|
The failure is one tooling test: This PR changes the Feishu and Mattermost config schemas, the Mattermost account type, a docs line, and a contract test. It touches nothing under A/B locally, three runs each: pristine I have rebased onto current For what it is worth, this is the third distinct infrastructure-shaped failure across my open PRs in the last day, each in a different area and none in a file the PR touches: a browser CDP mock race on #117302, a browser upload timeout race on #125977, and this process-reaping race here. I am not filing an issue for it, since #125976 already records the same shape for a different file, but the pattern seemed worth naming in one place. |
…the channel runtime reads
|
Thanks @ayaangazali! Proof: A fresh-state built CLI on current main rejected
Example
|
What Problem This Solves
Feishu and Mattermost both read the documented
contextVisibilitysetting at runtime. Their strict plugin config schemas reject that same setting at channel and account scope, so the full configuration is invalid before either channel can start.Why This Change Was Made
The mismatch belongs to the two plugin schema owners. This change adds the existing shared
ContextVisibilityModeSchemaleaf to Feishu and Mattermost, aligns the exported Mattermost account type, and refreshes generated config metadata.The regression test now calls
validateConfigObjectWithPluginsat the real plugin-aware validation boundary. It covers both plugins, both scopes, and value preservation. It replaces the earlier generated-JSON structure check.The shared channel builder is unchanged because that would expose the key to plugins whose runtimes do not consume it. Resolver precedence and the default
allbehavior are unchanged.User Impact
Operators can set
channels.feishu.contextVisibility,channels.feishu.accounts.<id>.contextVisibility,channels.mattermost.contextVisibility, andchannels.mattermost.accounts.<id>.contextVisibilitywithout invalidating the full configuration.Evidence
Built command-line interface proof used a fresh state directory for each revision and the same config with all four scopes.
a696e4f6875014a9a76fb48ead73b0f7da4937cb: all fourconfig getpath reads, both channel-object reads, andconfig validateexited 1. Validation reported all fourcontextVisibilityproperties as unsupported.22aa22b959fea0bdd6bae5664da538356e2250d6: all seven commands exited 0. Feishu returnedallowlistandallowlist_quote; Mattermost returnedallandallowlist;config validatereportedConfig valid.1522f8712f3a5bcfd41908821afddf4dbc474fd6differs from the built repaired revision only indocs/.generated/config-baseline.sha256. Runtime source, build inputs, generated channel metadata, and tests are byte-identical.Focused validation on the final head:
Production source is +8/-1. Tests are +29/-0. Generated files are +22/-22. Docs are +1/-1.
AI-assisted: researched, written, and validated with coding agents under maintainer direction. The contributor stated that they read and understood the change.