Skip to content

fix(channels): feishu and mattermost reject the contextVisibility key their runtime reads - #117287

Merged
obviyus merged 5 commits into
openclaw:mainfrom
ayaangazali:fix/context-visibility-schema-parity
Aug 28, 2026
Merged

obviyus merged 5 commits into
openclaw:mainfrom
ayaangazali:fix/context-visibility-schema-parity

Conversation

@ayaangazali

@ayaangazali ayaangazali commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Feishu and Mattermost both read the documented contextVisibility setting 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 ContextVisibilityModeSchema leaf to Feishu and Mattermost, aligns the exported Mattermost account type, and refreshes generated config metadata.

The regression test now calls validateConfigObjectWithPlugins at 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 all behavior are unchanged.

User Impact

Operators can set channels.feishu.contextVisibility, channels.feishu.accounts.<id>.contextVisibility, channels.mattermost.contextVisibility, and channels.mattermost.accounts.<id>.contextVisibility without 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.

  • Current main a696e4f6875014a9a76fb48ead73b0f7da4937cb: all four config get path reads, both channel-object reads, and config validate exited 1. Validation reported all four contextVisibility properties as unsupported.
  • Repaired runtime 22aa22b959fea0bdd6bae5664da538356e2250d6: all seven commands exited 0. Feishu returned allowlist and allowlist_quote; Mattermost returned all and allowlist; config validate reported Config valid.
  • Final head 1522f8712f3a5bcfd41908821afddf4dbc474fd6 differs from the built repaired revision only in docs/.generated/config-baseline.sha256. Runtime source, build inputs, generated channel metadata, and tests are byte-identical.

Focused validation on the final head:

src/config/validation.channel-metadata.test.ts  44 passed
extensions/feishu/src/config-schema.test.ts     100 passed
extensions/mattermost/src/config-schema.test.ts 15 passed

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.

Copilot AI review requested due to automatic review settings August 1, 2026 07:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@openclaw-barnacle openclaw-barnacle Bot added channel: mattermost Channel integration: mattermost size: S labels Aug 1, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 10:23 AM ET / 14:23 UTC.

ClawSweeper review

What this changes

The branch makes Feishu and Mattermost accept the existing contextVisibility setting at channel and account scope, aligns Mattermost’s account type, refreshes generated metadata, and adds validation coverage.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep 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
Reviewed head: 1522f8712f3a5bcfd41908821afddf4dbc474fd6

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with direct CLI behavior proof and targeted validation coverage.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Fresh-state built-CLI evidence in the PR body shows main rejecting all four configured scopes and the repaired runtime accepting them with Config valid.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): Fresh-state built-CLI evidence in the PR body shows main rejecting all four configured scopes and the repaired runtime accepting them with Config valid.
Evidence reviewed 7 items Current runtime consumer: Feishu resolves the policy from the full effective configuration and active account ID before filtering quoted and historical context.
Current runtime consumer: Mattermost resolves the same policy from the full configuration and active account ID before deciding whether denied-sender history is retained.
Owner-boundary repair: The shared Feishu shape is used by both root and account schemas, while Mattermost’s multi-account base is likewise used at both scopes; each now admits the existing shared enum.
Findings None None.
Security None None.

How this fits together

Channel configuration is validated before a channel starts, then inbound handlers resolve contextVisibility to decide which supplemental history or quoted content reaches the model. Feishu and Mattermost already use the shared resolver; their strict plugin schemas were the rejecting boundary.

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]
Loading

Before merge

  • Resolve merge risk (P1) - This changes strict accepted configuration for two existing channel plugins; exact-head checks should complete before merge because generated channel metadata is part of the validation path.
  • Resolve merge risk (P2) - Production is +8/-1: the net growth is limited to required per-plugin schema/type contract parity, with no added resolver or fallback path.
  • Complete next step (P2) - This coherent active PR already owns the repair; complete normal exact-head checks rather than create a replacement.
Agent review details

Security

None.

PR surface

Source +7, Tests +29, Docs 0, Generated 0. Total +36 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 4 8 1 +7
Tests 1 29 0 +29
Docs 1 1 1 0
Config 0 0 0 0
Generated 3 22 22 0
Other 0 0 0 0
Total 9 60 24 +36

Review metrics

Metric Value Why it matters
Production and regression-test delta production +8/-1; tests +29/-0; generated +22/-22; docs +1/-1 The small production increase is confined to schema/type contract parity, while the regression test covers both plugin scopes.

Stored data model

Persistent data-model change detected: unknown-data-model-change: src/config/bundled-channel-config-metadata.generated.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Complete exact-head compatibility checks (recommended)
    Let the running exact-head checks finish before merging the additive plugin configuration-contract change.

Technical review

Best 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.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. Fresh-state built-CLI evidence in the PR body shows main rejecting all four configured scopes and the repaired runtime accepting them with Config valid.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Fresh-state built-CLI evidence in the PR body shows main rejecting all four configured scopes and the repaired runtime accepting them with Config valid.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: A documented configuration path currently invalidates the full Feishu or Mattermost channel configuration before startup.
  • merge-risk: 🚨 compatibility: The PR changes the accepted configuration contract for existing Feishu and Mattermost installations.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Fresh-state built-CLI evidence in the PR body shows main rejecting all four configured scopes and the repaired runtime accepting them with Config valid.
  • proof: sufficient: Contributor real behavior proof is sufficient. Fresh-state built-CLI evidence in the PR body shows main rejecting all four configured scopes and the repaired runtime accepting them with Config valid.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Introduced configurable context visibility and recently maintained channel account-policy inheritance. (role: feature owner and recent area contributor; confidence: high; commits: 35e16051479f, 596a86fa2989; files: src/config/context-visibility.ts, extensions/feishu/src/bot.ts, extensions/mattermost/src/mattermost/monitor-posts.ts)
  • ayaangazali: Authored the focused schema parity work and a merged Mattermost-related channel configuration repair on current main. (role: recent channel-config contributor; confidence: medium; commits: 724c9dd9a591, 081c2dc3b7cb, 0bb870a40a6d; files: extensions/feishu/src/config-schema.ts, extensions/mattermost/src/config-schema-core.ts, extensions/mattermost/src/types.ts)

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 (31 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-26T21:17:00.587Z sha 343319f4d51657861b65aa488aaa527b58f56822 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-26T23:53:30.519Z sha 5f1f467dfcfe25be3cac3b6e73759149574b832c :: needs maintainer review before merge. :: none
  • reviewed 2026-08-27T01:52:13.040Z sha 04832e273a6ae07b0ba3674a2c9f7486fb09eeaf :: needs maintainer review before merge. :: none
  • reviewed 2026-08-27T03:51:18.152Z sha edd79c23e09655f069fdef519374a171047af954 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-27T05:57:31.721Z sha 25489683ef8194df5dc867e7f7c623104bc8a6f7 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-27T20:07:07.168Z sha 0b9507fefd807a14eff190d37c3c8027924fe08d :: needs maintainer review before merge. :: none
  • reviewed 2026-08-28T00:25:30.780Z sha 2da9d2e3752334342acc6f88c6944cb63b39509b :: needs maintainer review before merge. :: none
  • reviewed 2026-08-28T04:37:45.437Z sha c66f05dd53cfa0cd3fd3b42bd0a6ce001a4c45ca :: needs real behavior proof before merge. :: none

@ayaangazali

Copy link
Copy Markdown
Contributor Author

Correction, and CI caught me being wrong.

In the PR body I said Feishu already accepts channels.feishu.contextVisibility today and excluded it from the fix. That was wrong. Feishu rejects it exactly like Mattermost, and the contract test failing on checks-fast-contracts-plugins-b was correct to flag it.

What misled me: I ran the "before" check against a working tree whose dist had already been rebuilt with my fix, so the CLI accepted the key and I read that as Feishu being fine. When I deleted dist and rebuilt current main (dccb1b90138) from scratch, the real behaviour showed up:

$ openclaw config get channels.feishu
- channels.feishu: invalid config: must not have additional properties: "contextVisibility"

$ openclaw config get channels.mattermost
- channels.mattermost: invalid config: must not have additional properties: "contextVisibility"

So the fix now covers both channels, which is what the original diff did before I trimmed it. Pushed as 3198646a141.

I also changed the contract test to assert against the generated channel metadata instead of calling validateConfigObjectWithPlugins in-process. The in-process validator resolves plugin schemas through built output, so locally it reported Feishu as passing while the schema was still broken. The metadata assertions match what the freshly built CLI actually does, and they fail before the fix and pass after:

before:  × feishu accepts channels.<id>.contextVisibility
         × feishu accepts channels.<id>.accounts.<account>.contextVisibility
after:   Tests  4 passed (4)

One unrelated note: extensions/feishu/src/doctor.test.ts > removes only unhealthy Feishu direct sessions ... fails for me locally, and it fails the same way with my changes stashed, so it is not from this PR. It is not among the checks reporting on this head.

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.

@ayaangazali ayaangazali changed the title fix(mattermost): config validation rejects the contextVisibility key the channel runtime reads fix(channels): feishu and mattermost reject the contextVisibility key their runtime reads Aug 1, 2026
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Aug 1, 2026
@openclaw-barnacle openclaw-barnacle Bot added the channel: feishu Channel integration: feishu label Aug 1, 2026
@ayaangazali

Copy link
Copy Markdown
Contributor Author

Both review items are addressed in 096b2565afd, and the PR body now carries the evidence.

The typed-contract finding was correct. MattermostAccountConfig declared configWrites but not contextVisibility, so the schema would have accepted a key the exported type denied. Fixed in extensions/mattermost/src/types.ts, re-exporting ContextVisibilityMode through extensions/mattermost/runtime-api.ts from openclaw/plugin-sdk/config-contracts, which is how Matrix already does it. Feishu needed nothing equivalent because its account type is z.infer<typeof FeishuAccountConfigSchema> and tracks the schema automatically.

Feishu clean-build proof added. I rebuilt with rm -rf dist && pnpm build on this branch and validated the key at root and account scope:

$ openclaw config get channels.feishu
  "appId": "cli_example",
  "contextVisibility": "allowlist",
    "work": {
      "appId": "cli_work",
      "contextVisibility": "allowlist_quote"

$ openclaw config validate
Config valid

Same config on a from-scratch build of main is refused for both channels, which is the behaviour this PR removes.

Worth flagging since it shaped this PR: the reason my earlier Feishu claim was wrong is that pnpm openclaw runs from built dist, so a "before" check taken after building the fix silently reports the fixed behaviour. Every before/after above now comes from a from-scratch build of the relevant commit.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 1, 2026
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Aug 1, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 9, 2026
@ayaangazali
ayaangazali force-pushed the fix/context-visibility-schema-parity branch 3 times, most recently from 323eb5d to f273358 Compare August 10, 2026 20:39
@clawsweeper clawsweeper Bot removed the rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. label Aug 10, 2026
@ayaangazali

Copy link
Copy Markdown
Contributor Author

On the baseline-shrink finding: the contraction is real, but it belongs to main, not to this branch. I checked before answering, because "your regenerated artifact deletes coverage" is exactly the shape of thing I should not wave away.

Bisect on unmodified checkouts, no local diff:

  • At 84c7d45f15c~1, committed baseline is channel: 3716, plugin: 4040 and regenerating produces exactly 3716 / 4040.
  • At current main, the committed baseline is still 3716 / 4040 but regenerating produces 3582 / 3997.
  • core is 2295 in both, which rules out a broken local environment producing a uniformly smaller surface.

The gap is refactor(qqbot): install plugin from Tencent package (#107295, 84c7d45f15c), which removed the bundled QQBot extension without regenerating this artifact. Counting entries in the generated baselines at that commit's parent gives 134 paths under channels.qqbot and 43 qqbot plugin paths. 3716 minus 134 is 3582; 4040 minus 43 is 3997, matching what current main regenerates exactly.

pnpm config:docs:check exits 1 on unmodified main today with Hash mismatch: docs/.generated/config-baseline.sha256.

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 3716 / 4040 here would mean committing numbers that no longer describe the schema, and the check would fail on this branch instead.

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.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

Follow-up on the baseline finding: it is resolved upstream, and this branch is rebased so the diff now reads correctly.

main has regenerated the config-docs baseline, so its committed counts are channel: 3582, plugin: 3997 and pnpm config:docs:check exits 0 on unmodified main again. That was the stale artifact left behind when #107295 removed the bundled QQBot extension, which I reported there with the bisect.

The practical effect here is that this PR's baseline diff no longer looks like a deletion. Rebased onto current main, it shows a small positive delta for the paths this change actually adds instead of the alarming ~130-entry drop that the earlier review read as erased coverage. Nothing about the change itself moved; only its base did.

Both generator --check gates exit 0 on the rebased head.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

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 src/config/bundled-channel-config-metadata.generated.ts. Main has touched that same generated file 17 times in the last 14 days, and every one of those touches conflicts all seven at once. Keeping them mergeable means a coordinated rebase roughly daily, and each rebase moves the head out from under whatever review already ran.

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.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

Rebased onto current main; the branch was 50 commits behind.

On the red Security High (channel-runtime-boundary): that check produced no findings. Querying its annotations returns an empty list, and the sibling failure on another PR carries the annotation "Debugging artifacts are unavailable since the 'init' Action failed before it could produce any", so the analysis aborted during init rather than reporting anything. The Security High suite runs seven checks per PR; six pass on every one of my open PRs, with the single failure landing on a different member each time. That pattern is an init flake, not a boundary violation.

The rebase re-runs it on a current base.

AI-assisted.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

Rebased onto current main. The red checks-node-compact-large-2 was one failure out of 3331, and it is not reachable from this branch.

The failing case is src/gateway/server-methods/agent.test.ts > gateway agent handler chat.abort integration > yields after the accepted ack before dispatching heavy agent work, asserting expected "vi.fn()" to not be called at all, but actually been called 1 times. That is an async ordering assertion: it requires the handler to yield after the ack and before dispatch, which is timing sensitive under parallel shard load.

This PR touches extensions/feishu, extensions/mattermost, the contract test, the generated config metadata, and one docs page. Zero files under src/gateway/, so it cannot change that ordering.

Ran it locally to be sure rather than asserting from the file list:

  • clean upstream/main: 282 passed
  • this PR head, three consecutive runs: 282 passed, 282 passed, 282 passed

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 --check gates are clean.

Separately, the earlier Security High (channel-runtime-boundary) red on this PR cleared on the previous rebase, consistent with the init-flake explanation I posted then.

AI-assisted.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

These red checks are a GitHub platform incident, not this branch. Evidence rather than assertion.

GitHub's own status API, checked while writing this:

$ curl -s https://www.githubstatus.com/api/v2/status.json
{"status":{"indicator":"major","description":"Partial System Outage"}}

My own API probes from the same session: GraphQL failing 2 of 6 calls, REST healthy. A gh pr list call returned HTTP 503: No server is currently available to service your request.

The failing checks match that shape:

  • The Security High (*) and Critical Quality (*) runs carry zero code annotations. Their only failure-level annotation is GitHub's own text: Encountered an error while trying to determine feature enablement: HttpError: No server is currently available to service your request, plus Debugging artifacts are unavailable since the 'init' Action failed before it could produce any. The CodeQL analysis never started.
  • label failed on the identical message inside its "Apply maintainer or trusted-contributor label" step. That job only calls the GitHub API and never reads a diff.
  • main itself is currently red on auto-response, label-issues and Authorize workflow actor, all API-only jobs.
  • The failing member differs per PR across my open set, which is an outage hitting whatever was in flight rather than a defect that would fail the same check every time.

One check I could not read: checks-node-compact-small-1 is a real test shard, so I tried to pull its log and got failed to get run log: stream error; CANCEL; received from peer, which is the same degradation. It ran 17:19:23Z to 17:21:44Z, inside the incident window, and lasted about two minutes, which is short for that shard.

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 upstream/main and merge-clean. Happy to re-run once GitHub is healthy, or sooner if you would rather I push anyway.

AI-assisted.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (46e44baf460). This branch had picked up the recurring conflict in the generated config baseline (docs/.generated/config-baseline.counts.json and config-baseline.sha256); it is now 0 commits behind and merge-clean.

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:

node --import tsx scripts/generate-config-doc-baseline.ts --check                  clean
node --import tsx scripts/generate-bundled-channel-config-metadata.ts --check      clean

Local proof at head dbccfc31b08:

src/plugins/contracts + src/config/schema.help.quality.test.ts   43 files, 1040 passed
src/cli/config-cli.test.ts                                      190 passed

On the red marks: check-lint, check-lint-core-5 and check-docs are failing here, and I do not believe any of them are this branch. All three die during pnpm install before their actual check step runs (::error::pnpm install failed, then Process completed with exit code 1), with no rule violations or docs drift reported. check-lint and check-lint-core-5 are also currently red on main itself (for example 44b41d5686d). This branch touches no package.json, pnpm-lock.yaml or pnpm-workspace.yaml.

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.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (bbf7454b17b). The earlier check-lint and check-lint-core-5 red on this PR was the oxfmt --check breakage on main, which has since been fixed by #125538, and those two lanes are green again here. Both generated-baseline gates pass and this head is 0 behind and merge-clean:

node --import tsx scripts/generate-config-doc-baseline.ts --check                  clean
node --import tsx scripts/generate-bundled-channel-config-metadata.ts --check      clean
node scripts/run-vitest.mjs src/plugins/contracts src/config/schema.help.quality.test.ts   43 files, 1040 passed
node scripts/run-vitest.mjs src/cli/config-cli.test.ts                                    190 passed

The remaining red is checks-node-compact-large-14, on two cases in src/agents/agent-bundle-mcp-runtime.test.ts:

× retires a reused MCP session that exits during catalog refresh        47ms
× retires timed-out shared MCP sessions before later catalog retries  3036ms
AssertionError: expected [] to have a length of 1 but got +0

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 extensions/feishu/src/config-schema.ts, four extensions/mattermost files, one contract test, one docs page and the generated baselines. It touches nothing under src/agents and nothing MCP related. The failing file passes here in isolation, five consecutive runs:

run1  94 passed (94)
run2  94 passed (94)
run3  94 passed (94)
run4  94 passed (94)
run5  94 passed (94)

main is also green on its recent commits, so this is not a standing break.

What I cannot show: the CI shard is agentic-agents-core-runtime-hosted-2, a grouped shard, and the failure may be order or shared-state dependent rather than isolated. I tried to reproduce in company by running the whole src/agents tree locally and the run died with a vitest worker emitUnexpectedExit after about nine minutes, which is my machine running out of headroom rather than a result. So I have not reproduced the shard's execution order, and I am not claiming the two cases are flaky, only that I cannot make them fail on this branch in isolation and there is no path from a Feishu or Mattermost config key to MCP session retirement.

If you would rather I keep digging on that shard specifically before this is considered, say so and I will. expected [] to have a length of 1 on a 47ms case does look like it could be genuinely order dependent, which would be worth its own look regardless of this PR.

AI-assisted.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (0 behind, merge-clean). Both generated-artifact gates pass, contracts 1040 and config-cli 190 green locally.

Two red shards, and neither reproduces here.

checks-node-compact-small-10 is the gateway harness timeout:

FAIL gateway-server src/gateway/server.chat.gateway-server-chat.test.ts
  > handles chat send and history flows
  > marks a running webchat session failed when restart drain overlaps dispatch rejection
AssertionError: expected +0 to be 1
::error file=src/gateway/test-helpers.server.ts,title=Unhandled error,line=673::Error: timeout

That is the WebSocket wait in test-helpers.server.ts with its fixed timeoutMs = 10_000. The shard ran that file in 32657ms; locally it is 55 passed (55) at about 21s of test time. The same failure hit my unrelated PR #119356 in the same window, which is what convinced me it is the harness bound rather than either diff. I wrote it up in more detail over there.

checks-node-compact-small-1 is a different file, src/cli/update-cli.test.ts, six cases including expected "vi.fn()" to be called once, but got 0 times and expected [] to deeply equal [ 'work' ]. That one has no timeout marker, so I checked it directly rather than assuming:

node scripts/run-vitest.mjs src/cli/update-cli.test.ts
  on clean upstream/main                     243 passed (243)
  on this head                               241 passed (241)

(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.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

Rebased onto current main, 0 behind and merge-clean. Contracts 1040 and config-cli 191 green locally, both generated-artifact gates clean.

The checks-node-compact-small-26 red is a killed process, not a test failure. The whole job log ends at:

##[error]Process completed with exit code 143.

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 agent-bundle-mcp-runtime failure I could not reproduce is still unexplained, and I said so at the time rather than calling it flaky.

AI-assisted.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

check-lint-core-1 never ran a lint rule. The job failed to clone the repository:

fatal: could not read Username for 'https://github.com': No such device or address
fatal: the remote end hung up unexpectedly
checkout attempt 5/5 failed
checkout failed after 5 attempts
##[error]Process completed with exit code 1.

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.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

Rebased onto current main.

Same note as the sibling branches: #129710 added historyLimit to MattermostAccountSchemaBase on the line this branch adds contextVisibility, so this rebase carried a real source conflict rather than the usual generated-artifact one. Both keys are kept, so the merged historyLimit is untouched:

contextVisibility: ContextVisibilityModeSchema.optional(),
historyLimit: z.number().int().min(0).optional(),

Local checks at the new head: src/plugins/contracts 1053/1053, mattermost lane 777/778, both generator gates clean. The single mattermost failure is model-picker.test.ts > resolves current and parent model overrides from targeted session entries, which reproduces on pristine upstream/main, so it is pre-existing.

@ayaangazali

Copy link
Copy Markdown
Contributor Author

checks-node-compact-small-42 is not from this diff, and I have not pushed a fix for it.

The failure is one tooling test: test/scripts/profile-extension-memory.test.ts > scripts/profile-extension-memory > cleans timeout descendants before resolving the case, with expected false to be true at line 323.

This PR changes the Feishu and Mattermost config schemas, the Mattermost account type, a docs line, and a contract test. It touches nothing under test/scripts, and that test file is byte identical to current main.

A/B locally, three runs each: pristine upstream/main 12/12, this PR's head 12/12. The assertion is about whether a spawned process tree was reaped before the case resolved, so an expected false to be true there is a cleanup race in the harness rather than anything a channel schema can reach.

I have rebased onto current main for a fresh run, since gh run rerun is not available to fork contributors. At the new head edd79c23e09 the contract lane is 1072/1072 and both generator gates are clean.

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.

@obviyus

obviyus commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Thanks @ayaangazali!

Proof: A fresh-state built CLI on current main rejected contextVisibility at both channel and account scope for Feishu and Mattermost. The repaired runtime returned all four configured values and config validate reported a valid config. Exact-head CI and the maintainer review gate passed.

  • Bug: Setting the documented policy made the full Feishu or Mattermost configuration invalid before startup.
  • Fix: Each plugin schema now accepts the existing shared enum at channel and account scope, and validation coverage protects the real plugin boundary.

Example

Before After
config validate rejects contextVisibility config get returns the configured policy and config validate succeeds

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: mattermost Channel integration: mattermost docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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.

3 participants