Skip to content

fix(channels): keep healthy accounts' message actions when one credential SecretRef fails - #110329

Merged
steipete merged 6 commits into
openclaw:mainfrom
wangmiao0668000666:fix/channels-secretref-enum-isolation
Jul 28, 2026
Merged

steipete merged 6 commits into
openclaw:mainfrom
wangmiao0668000666:fix/channels-secretref-enum-isolation

Conversation

@wangmiao0668000666

@wangmiao0668000666 wangmiao0668000666 commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

When one channel account has a configured SecretRef that is unavailable in the current runtime snapshot, strict account resolution can throw while the shared message tool is discovering channel actions. Core catches that plugin-level exception and drops the whole channel's action surface, including healthy sibling accounts.

This affects Google Chat, Slack, Zalo, and Mattermost multi-account configurations. It also affected Mattermost directory fan-in, where one unavailable account could abort discovery for healthy clients.

Why This Change Was Made

Read-only discovery now uses plugin-owned account inspection instead of weakening operational resolvers:

  • each account is inspected independently, so unavailable accounts are skipped and healthy accounts still contribute actions;
  • direct send, startup, monitor, and runtime resolution remain strict and still fail closed;
  • a configured-but-unavailable SecretRef remains authoritative and cannot fall through to a lower-precedence environment or file credential;
  • Google Chat's full plugin and lightweight message-tool artifact share one discovery helper;
  • Slack reuses its existing inspectSlackAccount boundary;
  • Zalo and Mattermost expose inspection snapshots with credential status, and Mattermost directory clients use the same inspection rule.

The maintainer rewrite rebases the contributor's intent onto current account-inspection and Plugin SDK contracts. It removes obsolete discovery exports instead of allowlisting dead compatibility surface.

The branch also repairs an unrelated current-main CI break that blocked this landing: the PR review fixture now supplies the required rg command surface when sourcing review.sh in minimal compact-shard images. Production preflight remains unchanged.

User Impact

A cold or stale channel account no longer hides the message actions of healthy sibling accounts. Selecting the unavailable account still exposes no actions, and attempting a direct operation through unresolved credentials still fails closed.

Evidence

  • Exact head: 9de212c3e3dd74b89965d734a01abd86e414ca73.
  • Blacksmith Testbox run 30329364500, lease tbx_01kykgayra49tpy7sraqv8kvsa: 206 focused tests passed across Google Chat, Slack, Zalo, Mattermost, and the PR review fixture.
  • The same run passed deadcode:dependencies and the complete check:changed extension/docs gate: production and test tsgo, lint, formatting, Plugin SDK/API and architecture guards, and import-cycle checks.
  • Baseline CI repair: Testbox run 30330410727, lease tbx_01kykhk858mtyy8xzp7105b8m7, passed test/scripts/pr-review-artifact-validation.test.ts 29/29 in the compact-CI-compatible fixture shape.
  • Exact-head CI run 30330583236, attempt 2: openclaw/ci-gate passed with every selected job green. The sole first-attempt failure was an unrelated 10-minute agentic shard timeout; that shard passed on current main and on the isolated retry without code changes.
  • Fresh Codex autoreview completed cleanly with no accepted or actionable findings (0.96 for the full branch; 0.99 for the baseline fixture fix).

Documentation

docs/gateway/secrets.md now states the per-account read-only discovery contract. Existing channel credential docs already describe configured_unavailable status and authoritative SecretRef precedence.

AI-assisted maintainer rewrite. The contributor's original diagnosis and test direction are preserved with co-authorship; the maintainer reviewed current callers, sibling inspection implementations, the shared SecretInput contract, docs, tests, current-main CI, and runtime behavior.

@openclaw-barnacle openclaw-barnacle Bot added channel: googlechat Channel integration: googlechat channel: mattermost Channel integration: mattermost channel: slack Channel integration: slack channel: zalo Channel integration: zalo size: M labels Jul 18, 2026
@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. P1 High-priority user-facing bug, regression, or broken workflow. labels Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 28, 2026, 1:11 AM ET / 05:11 UTC.

ClawSweeper review

What this changes

This PR changes Google Chat, Slack, Zalo, and Mattermost read-only account inspection so an unavailable configured SecretRef skips only that account instead of hiding message actions and Mattermost directory access for healthy siblings.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this PR open for maintainer merge review: its branch-level tests and hosted gates support the intended account-isolated discovery behavior, and the remaining decision is whether to accept the compatibility-sensitive change across four bundled channel plugins. Likely related people: steipete is the strongest routing candidate from the merged channel-account isolation work and the current rewrite (medium confidence).

Priority: P1
Reviewed head: 9de212c3e3dd74b89965d734a01abd86e414ca73
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) This is a focused, well-tested compatibility-sensitive fix with no discrete patch defect found; it still needs the channel-area maintainer’s contract decision and completion of exact-head CI.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The PR supplies exact-head hosted focused validation across the four affected plugins and the repository’s real-behavior-proof check is successful; any future screenshots or logs should redact credentials and private endpoints.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR supplies exact-head hosted focused validation across the four affected plugins and the repository’s real-behavior-proof check is successful; any future screenshots or logs should redact credentials and private endpoints.
Evidence reviewed 5 items Exact-head implementation: The branch introduces per-account inspection for Google Chat, Slack, Zalo, and Mattermost discovery, filtering unavailable credentials while preserving strict operational resolvers.
Credential-precedence coverage: The branch adds focused cases asserting that an unavailable configured SecretRef does not fall through to a lower-precedence environment credential for Google Chat, Mattermost, Slack, and Zalo.
Related merged provenance: The prior merged channel-account isolation work handled Gateway activation, and the contributor discussion distinguishes this PR as the complementary read-only discovery path.
Findings None None.
Security None None.

How this fits together

Channel plugins provide account-specific capabilities to the shared message tool and, for Mattermost, directory lookup. Configuration and the active secret snapshot feed per-account inspection; only available accounts contribute discovery results, while actual sends and startup still use strict credential resolution.

flowchart LR
  Config[Channel account configuration] --> Snapshot[Active secret snapshot]
  Snapshot --> Inspect[Per-account read-only inspection]
  Inspect --> Filter[Available account filter]
  Filter --> Discovery[Message and directory discovery]
  Discovery --> Actions[Healthy account actions]
  Actions --> Operations[Strict send and startup resolution]
Loading

Decision needed

Question Recommendation
Should OpenClaw accept the account-inspection compatibility contract across Google Chat, Slack, Zalo, and Mattermost once exact-head CI completes? Accept the inspection contract: Merge after exact-head CI passes, retaining strict operational resolution and independent read-only discovery for all four plugins.

Why: The implementation intentionally changes discovery behavior for existing credential configurations across multiple bundled plugins; only the channel-area owner can confirm that this cross-plugin contract is the desired permanent behavior.

Before merge

  • Resolve merge risk (P1) - The change alters how existing SecretRef-backed accounts are classified during capability discovery; a mistake could suppress healthy send actions or expose actions for an account whose configured credential is unavailable.
  • Resolve merge risk (P1) - The PR is cleanly mergeable but behind current main, so the maintainer should merge only after the exact-head required CI completes or after a final rebase refresh confirms the same behavior.
Agent review details

Security

None.

PR surface

Source +72, Tests +268, Docs +1. Total +341 across 36 files.

View PR surface stats
Area Files Added Removed Net
Source 22 221 149 +72
Tests 13 307 39 +268
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 36 529 188 +341

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Merge after exact-head validation (recommended)
    Accept the shared inspection pattern after the outstanding exact-head checks finish successfully and the maintainer confirms its cross-plugin compatibility contract.
  2. Pause for a narrower contract
    Defer merge if the maintainers do not want unavailable SecretRefs to alter account configuration status and discovery behavior uniformly across these plugins.

Technical review

Best possible solution:

Land the common pattern only if each affected plugin continues to expose discovery actions solely for available credentials, retains configured SecretRef precedence over environment fallback, and preserves strict failure for actual sends and startup.

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

Yes, from source: configure one unavailable SecretRef-backed account and one healthy sibling, then call the plugin’s message-action discovery with and without the broken account selected. The branch adds this scenario for all affected plugins, but this read-only review did not execute it.

Is this the best way to solve the issue?

Yes, subject to maintainer acceptance of the shared contract: plugin-owned read-only inspection is narrower than weakening strict send or startup resolution, and the tests preserve configured SecretRef precedence over environment fallback.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 3ae29adffac5.

Labels

Label justifications:

  • P1: Healthy accounts can lose their user-facing message actions when one sibling SecretRef is unavailable.
  • merge-risk: 🚨 compatibility: The branch changes established account inspection and configuration-derived availability semantics across four bundled plugins.
  • merge-risk: 🚨 message-delivery: The action filters determine whether valid send actions remain available and whether unavailable accounts are excluded.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR supplies exact-head hosted focused validation across the four affected plugins and the repository’s real-behavior-proof check is successful; any future screenshots or logs should redact credentials and private endpoints.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies exact-head hosted focused validation across the four affected plugins and the repository’s real-behavior-proof check is successful; any future screenshots or logs should redact credentials and private endpoints.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the current channel-account discovery rewrite and the related merged channel credential isolation work, making this the strongest history-based routing candidate. (role: recent area contributor; confidence: medium; commits: a7df71c72502, 4ecd85e0b7b4, 3e74534a7069; files: extensions/googlechat/src/accounts.ts, extensions/mattermost/src/mattermost/accounts.ts, extensions/slack/src/account-inspect.ts)

Rank-up moves

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

  • Wait for the in-progress exact-head required checks to complete before merging.
  • Confirm that the per-account inspection contract is the intended permanent behavior for all four bundled plugins.

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 (5 earlier review cycles)
  • reviewed 2026-07-18T02:40:03.446Z sha 6364c3af1635b90d6b43e192796e43131a541e27 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-18T02:51:48.080Z sha 565bcb866f0b6332a0340c7236ec1716aa7fa581 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-18T06:20:41.638Z sha 9dc95ba22a5aadba2d698c32a7e8d35004415a65 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-28T04:32:47.157Z sha 0c7d19e :: needs maintainer review before merge. :: none
  • reviewed 2026-07-28T04:59:27.112Z sha 5344149 :: needs maintainer review before merge. :: none

@wangmiao0668000666
wangmiao0668000666 force-pushed the fix/channels-secretref-enum-isolation branch from 565bcb8 to 9dc95ba Compare July 18, 2026 06:17
@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (723f5ba4fc) which now includes #110360 (credential-file failure isolation for core + googlechat/irc/line/nextcloud-talk/telegram).

Relationship to #110360: complementary, not overlapping. That PR handles credential file read failures (serviceAccountFile unreadable → tokenStatus: "configured_unavailable"); this PR handles SecretRef resolution failures during account enumeration (one account's unresolved ref previously threw out of describeMessageTool and hid every healthy account's message actions). After the rebase the two changes compose in extensions/googlechat/src/accounts.ts: mode: "inspect" degrades unresolved SecretRefs to source: "none", status: "missing", while file-read failures surface as configured_unavailable — and both filters apply in the message-action enumeration paths.

Conflict resolution: channel.ts / actions.ts kept both sides (inspect mode in the resolve call + tokenStatus !== "configured_unavailable" filter). One merge fix: the inspect early-return gained the now-required status: "missing" field.

Verified locally (Node 24.15.0): run-vitest.mjs on the four touched plugins — googlechat accounts+actions 15/15, mattermost/slack/zalo accounts 33/33 green. tsgo -p tsconfig.extensions.json reports zero errors in touched files (3 pre-existing errors in packages/net-policy/src/ip.ts from this worktree's stale ipaddr.js types; unrelated to this diff).

@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@wangmiao0668000666
wangmiao0668000666 force-pushed the fix/channels-secretref-enum-isolation branch from 9dc95ba to 2c29f49 Compare July 21, 2026 12:46
@clawsweeper

clawsweeper Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@steipete steipete self-assigned this Jul 28, 2026
@steipete
steipete force-pushed the fix/channels-secretref-enum-isolation branch from 2c29f49 to 0c7d19e Compare July 28, 2026 04:28
@steipete
steipete requested a review from a team as a code owner July 28, 2026 04:28
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: L and removed size: M labels Jul 28, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jul 28, 2026
@steipete

Copy link
Copy Markdown
Contributor

Maintainer decision: accept the permanent per-account inspection contract across Google Chat, Slack, Zalo, and Mattermost. Read-only discovery should omit configured-unavailable accounts independently, while direct operations remain strict and configured SecretRefs remain authoritative over lower-precedence credentials.

The remaining review moves are satisfied: exact-head CI run 30330583236 passed on attempt 2 with every selected job green. I also checked mainline drift from 01f6ad67d52a79ed71adb798ebbfc6bc6f9b8c21 through deeebed136c785bf8a8aa09eda9814c00fb7eb10; none of the intervening changes touches the affected plugins, SecretRef docs, PR fixture, review helper, or CI workflow, so another refresh would not change this landing surface.

@steipete
steipete merged commit 9dbfeb7 into openclaw:main Jul 28, 2026
185 of 187 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 28, 2026
…tial SecretRef fails (openclaw#110329)

* fix(channels): isolate unavailable account discovery

Co-authored-by: wangmiao0668000666 <[email protected]>

* refactor(channels): remove stale discovery exports

* test(pr): provide ripgrep fixture command

---------

Co-authored-by: Peter Steinberger <[email protected]>
@wangmiao0668000666
wangmiao0668000666 deleted the fix/channels-secretref-enum-isolation branch October 28, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: googlechat Channel integration: googlechat channel: mattermost Channel integration: mattermost channel: slack Channel integration: slack channel: zalo Channel integration: zalo docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. 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: L 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.

2 participants