Skip to content

refactor(googlechat,zalouser): declare single-account config promotion keys - #112367

Closed
wangmiao0668000666 wants to merge 3 commits into
openclaw:mainfrom
wangmiao0668000666:pr-googlechat-zalouser-config-promotion
Closed

wangmiao0668000666 wants to merge 3 commits into
openclaw:mainfrom
wangmiao0668000666:pr-googlechat-zalouser-config-promotion

Conversation

@wangmiao0668000666

@wangmiao0668000666 wangmiao0668000666 commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Part 2 of #112238 follow-up. The googlechat and zalouser channel plugins were missed in #112293, which moved hardcoded single-account promotion keys into per-channel plugin declarations. Both plugins use createPatchedAccountSetupAdapter (the same pattern as other channels that were already migrated) but lacked singleAccountKeysToMove declarations and setupFeatures.configPromotion in their package manifests.

Why This Change Was Made

  • Declares singleAccountKeysToMove on the googlechat setup adapter (serviceAccount, serviceAccountFile, audienceType, audience, webhookPath, webhookUrl) and the zalouser setup adapter (empty array — opt-out from legacy key promotion).
  • Declares namedAccountPromotionKeys on the googlechat setup adapter (audienceType, audience, webhookPath, webhookUrl, dmPolicy, allowFrom, groupPolicy, groupAllowFrom). Google Chat service-account credentials are per-identity: mergeGoogleChatAccountConfig strips serviceAccount/serviceAccountFile from named accounts, so they must not be flattened into accounts.default once named accounts exist.
  • Adds setupFeatures.configPromotion: true to both package.json files so doctor can read the declarations from the lightweight bundled setup artifact.
  • Follows the same pattern as the channels migrated in refactor(channels): move single-account promotion keys to plugin declarations #112293 (slack, signal, irc, imessage, nextcloud-talk, tlon, whatsapp, zalo, telegram, matrix).

User Impact

Single-account migration for googlechat and zalouser channels now moves only the declared account-scoped keys into accounts.default. Named-account configs no longer risk flattening channel-root policy keys alongside account credentials, and googlechat credentials stay at the channel root where they are consumed. No runtime behavior, config shape, or credential handling changes.

Evidence

All proof below was re-run on the rebased head 8b621fed2d0f6f9b344f39d1dfda30c586cd2d26 (rebased onto origin/main 8cc90fe5d7457a, 2026-09-10). The promotion seam (src/channels/plugins/setup-promotion-{helpers,keys,discovery}.ts, src/commands/doctor/shared/legacy-config-core-normalizers.ts, extensions/{googlechat,zalouser}) is untouched by 8cc90fe5d74..origin/main movement since the rebase.

Packaged openclaw doctor --fix proof (exact head, 2026-09-10)

The exact head 8b621fed2d0f6f9b344f39d1dfda30c586cd2d26 was built into a packaged dist (build-external-plugin-local-dist.mts + plugins:assets:copy + runtime-postbuild, buildId 2026.9.3-8b621fed2d0f-2026-09-10T03-46-01.296Z); both bundled manifests in dist/extensions/{googlechat,zalouser}/package.json carry setupFeatures.configPromotion: true and setupEntry: ./setup-entry.js. The packaged CLI (dist/index.js) then ran doctor --fix --yes --no-color against a fully isolated state dir (OPENCLAW_STATE_DIR + OPENCLAW_WORKSPACE_DIR under /tmp) with a synthetic legacy config: root-level single-account keys plus one named work account and no default account for both channels. All values below are synthetic (fake user IDs, proof.invalid, /tmp paths); nothing operator-real was used.

Legacy input config:

{
  "channels": {
    "googlechat": {
      "enabled": true,
      "serviceAccount": { "source": "file", "provider": "proof-file", "id": "/channels/googlechat/serviceAccount" },
      "serviceAccountFile": "/tmp/oc112367/gsa.json",
      "audienceType": "project-number",
      "audience": "123456789012",
      "webhookPath": "/googlechat-webhook",
      "webhookUrl": "https://proof.invalid/googlechat",
      "dmPolicy": "allowlist",
      "allowFrom": ["users/1234567890"],
      "accounts": { "work": { "audienceType": "project-number", "audience": "999999999999" } }
    },
    "zalouser": {
      "enabled": true,
      "dmPolicy": "allowlist",
      "allowFrom": ["+84000000000"],
      "profile": "/tmp/oc112367/zalo-profile",
      "accounts": { "work": { "profile": "/tmp/oc112367/zalo-profile-work" } }
    }
  }
}

Control — main-line packaged dist (build stamp dfa8b7df9e6f; for the promotion surface its build sources match origin/main: the dfa8b7df9e6 googlechat/zalouser setup adapters contain no singleAccountKeysToMove/namedAccountPromotionKeys and no setupFeatures.configPromotion, their manifest deltas vs origin/main are version/formatting only, and the promotion resolver files are untouched by either range). Same input config, same command:

  • Doctor changes contains no channel promotion lines; instead main-line doctor reports the default-account-routing gap: channels.googlechat: accounts.default is missing and no valid account-scoped binding exists for configured accounts (work).
  • Persisted channels.googlechat keeps all 10 root keys (allowFrom, audience, audienceType, dmPolicy, enabled, serviceAccount, serviceAccountFile, webhookPath, webhookUrl) and no accounts.default; channels.zalouser keeps allowFrom, dmPolicy, profile at root with no accounts.default. Promotion defers because neither plugin advertises a promotion surface.

After — PR-head packaged dist. Same input config, same command. Doctor output contains:

Doctor changes
 - Moved channels.googlechat single-account top-level values into
   channels.googlechat.accounts.default.
 - Moved channels.zalouser single-account top-level values into
   channels.zalouser.accounts.default.
Updated config: $OPENCLAW_STATE_DIR/openclaw.json

Persisted config after the run:

{
  "channels": {
    "googlechat": {
      "enabled": true,
      "serviceAccount": { "source": "file", "provider": "proof-file", "id": "/channels/googlechat/serviceAccount" },
      "serviceAccountFile": "/tmp/oc112367/gsa.json",
      "accounts": {
        "work": {
          "audienceType": "project-number",
          "audience": "999999999999",
          "dmPolicy": "allowlist",
          "allowFrom": ["users/1234567890"]
        },
        "default": {
          "audienceType": "project-number",
          "audience": "123456789012",
          "webhookPath": "/googlechat-webhook",
          "webhookUrl": "https://proof.invalid/googlechat",
          "dmPolicy": "allowlist",
          "allowFrom": ["users/1234567890"]
        }
      }
    },
    "zalouser": {
      "enabled": true,
      "profile": "/tmp/oc112367/zalo-profile",
      "accounts": {
        "work": {
          "profile": "/tmp/oc112367/zalo-profile-work",
          "dmPolicy": "allowlist",
          "allowFrom": ["+84000000000"]
        },
        "default": {
          "dmPolicy": "allowlist",
          "allowFrom": ["+84000000000"]
        }
      }
    }
  }
}

This demonstrates both plugin contracts end-to-end through the packaged migration, including the named-account restriction this PR adds:

  • googlechat: once named accounts exist, only namedAccountPromotionKeys members move. audienceType, audience, webhookPath, webhookUrl (declared) plus dmPolicy, allowFrom (common policy) promoted into accounts.default; the pre-existing named work account kept its own values and only inherited the root dmPolicy/allowFrom policy keys. serviceAccount and serviceAccountFile stayed at the channel root because they are not in namedAccountPromotionKeys — Google Chat strips per-account credentials via mergeGoogleChatAccountConfig, so flattening them into accounts.default would fabricate a config the plugin then discards.
  • zalouser: the channel-specific profile key stays at root (explicit empty singleAccountKeysToMove = authoritative no-promotion policy for channel-specific keys), while common policy keys (dmPolicy, allowFrom) promoted into accounts.default instead of deadlocking the whole channel section behind a defer.

Real behavior proof (focused test execution on current head)

$ LANG=C node scripts/run-vitest.mjs extensions/googlechat/src/setup.test.ts
 Test Files  1 passed (1)
      Tests  32 passed (32)   # includes the new config-promotion declaration test

$ node scripts/run-vitest.mjs extensions/zalouser/src/channel.setup.test.ts
 Test Files  1 passed (1)
      Tests  2 passed (2)     # includes the new config-promotion declaration test

$ node scripts/run-vitest.mjs src/commands/doctor-legacy-config.migrations.test.ts
 Test Files  1 passed (1)
      Tests  91 passed (91)   # includes "restricts promotion to named-account keys when named accounts exist"

Locale note: under this machine's zh_CN.UTF-8 locale, the pre-existing main-lane test googlechat setup > configures service-account auth and webhook audience fails because main's wizard i18n translates the prompt to Service account JSON 路径 while the test matches the exact English string. The same file passes 32/32 under LANG=C. The failure is unrelated to this PR — the PR diff to setup.test.ts only adds the config-promotion declaration test.

Doctor migration seam semantics

The new migration test restricts promotion to named-account keys when named accounts exist (in src/commands/doctor-legacy-config.migrations.test.ts) uses a synthetic named-restricted-demo plugin registry whose adapter declares singleAccountKeysToMove: ["appToken", "streaming"] and namedAccountPromotionKeys: ["streaming"]. With a named account present, appToken stays at root and only streaming moves into accounts.default; without named accounts, both declared keys move. This pins the resolver contract this PR relies on: resolveSingleAccountPromotion filters keysToMove through namedAccountPromotionKeys when named accounts exist, and hasPromotionDeclarations keeps an undeclared custom root key from deferring the whole channel once declarations exist.

Declaration verification

// googlechatSetupAdapter.singleAccountKeysToMove:
["serviceAccount", "serviceAccountFile", "audienceType", "audience", "webhookPath", "webhookUrl"]

// googlechatSetupAdapter.namedAccountPromotionKeys:
["audienceType", "audience", "webhookPath", "webhookUrl", "dmPolicy", "allowFrom", "groupPolicy", "groupAllowFrom"]

// zalouserSetupAdapter.singleAccountKeysToMove:
[]   // opt-out: empty array declares no legacy keys

// googlechat package.json setupFeatures: { "configPromotion": true }
// zalouser package.json setupFeatures: { "configPromotion": true }

The doctor migration resolver reads these declarations from each channel's setup artifact surface during openclaw doctor --fix. Both manifests enable configPromotion so the doctor migration can discover the declarations through the lightweight bundled setup artifact.

  • Red proof: extensions/googlechat/src/setup.test.ts — the new config-promotion declaration test failed before the production change because googlechatSetupAdapter.singleAccountKeysToMove was undefined.
  • Green proof: extensions/googlechat/src/setup.test.ts — 32 passed (31 existed before, 1 new) with the fix.
  • Green proof: extensions/zalouser/src/channel.setup.test.ts — 2/2 passed including the new declaration test.
  • Green proof: src/commands/doctor-legacy-config.migrations.test.ts — 91/91 passed including the named-account restriction test.
  • oxfmt --check passed for all changed source files.

Scope

@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 22, 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: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@wangmiao0668000666
wangmiao0668000666 force-pushed the pr-googlechat-zalouser-config-promotion branch from dafe405 to 7023181 Compare July 25, 2026 16:42
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 25, 2026
@clawsweeper

clawsweeper Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 10, 2026, 12:16 AM ET / 04:16 UTC (Revision 26).

ClawSweeper review

What this changes

Adds Google Chat and Zalo User plugin declarations that tell Doctor which legacy settings to move into default-account configuration.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 6 items remain

This PR remains useful and is not implemented on main. The previous findings and proof-refresh request are addressed, but two Google Chat setup regressions remain outside the packaged Doctor scenario.

Priority: P2
Reviewed head: 8b621fed2d0f6f9b344f39d1dfda30c586cd2d26

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful declarations and strong Doctor evidence are offset by two source-proven setup regressions and missing credential-replacement boundary proof.
Proof confidence 🦐 gold shrimp (3/6) Needs stronger real behavior proof before merge: Authority-chain proof required: the refreshed packaged Doctor transcript convincingly proves migration and resolves the previous proof request, but does not prove that a later credential replacement prevents the old identity from reaching Google API I/O. Add redacted production-path output showing the replacement identity selected and the replaced identity excluded; updating the PR body triggers review, with maintainer @clawsweeper re-review available if needed. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Authority-chain proof required: the refreshed packaged Doctor transcript convincingly proves migration and resolves the previous proof request, but does not prove that a later credential replacement prevents the old identity from reaching Google API I/O. Add redacted production-path output showing the replacement identity selected and the replaced identity excluded; updating the PR body triggers review, with maintainer @clawsweeper re-review available if needed. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 12 items Verified introduced change: The merge-base-to-head diff adds promotion declarations and manifest discovery flags, plus focused tests. The verified test merge records the supplied base first and exact PR head second; unrelated endpoint drift is not attributed to this PR.
Current-main necessity: Current main still exports Google Chat's adapter without promotion declarations. Zalo User likewise lacks its empty declaration. The inspected promotion implementation is unchanged between the pinned merge base and fetched main.
Latest-release comparison: The supplied latest release, v2026.9.3, also lacks Google Chat's declarations; inspection of the Zalo User adapter at that release found the same omission.
Findings 2 actionable findings [P1] [P1] Preserve the default account's audience during named setup
[P1] [P1] Retire promoted credentials when rotating the default account
Security Needs attention Promoted credentials survive an operator's identity replacement: The newly populated accounts.default credential outranks a later root credential write. The resolved old credential feeds the Google authentication client and outgoing API token, so replacing credentials does not reliably replace the acting identity.

How this fits together

Channel plugins declare migration rules consumed by both Doctor and interactive setup. Those flows write account configuration that subsequently controls webhook authentication and outbound Google Chat credentials.

flowchart TD
  A[Legacy channel settings] --> C[Promotion rules]
  B[Plugin setup declarations] --> C
  C --> D[Doctor migration]
  C --> E[Interactive setup]
  D --> F[Saved account configuration]
  E --> F
  F --> G[Webhook and API authentication]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Authority-chain proof required: the refreshed packaged Doctor transcript convincingly proves migration and resolves the previous proof request, but does not prove that a later credential replacement prevents the old identity from reaching Google API I/O. Add redacted production-path output showing the replacement identity selected and the replaced identity excluded; updating the PR body triggers review, with maintainer @clawsweeper re-review available if needed. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • [P1] Preserve the default account's audience during named setup (P1) - With root service-account credentials and audience settings plus only accounts.work, configuring work through the wizard calls the shared promotion helper with this contract. That helper selects work as the promotion target and deletes the newly eligible audienceType/audience from the root. Credentials remain at root, so the implicit default identity survives but no longer resolves an audience; its monitor refuses webhook registration. Before this patch those two fields were not eligible and remained available. Preserve the default/shared audience when direct setup selects a named target, and cover the real wizard-to-account-resolution path.
  • [P1] Retire promoted credentials when rotating the default account (P1) - These new keys make direct setup move a root-only Google Chat credential into accounts.default when adding the first named account. A subsequent default-account rotation still uses createPatchedAccountSetupAdapter, whose writer updates only the channel root. The account resolver overlays the old accounts.default credential over that replacement, so outbound authentication continues selecting the previous service account. This PR creates the automatic route into that stale state. Coordinate with fix(channels): retire the replaced credential source on setup rotation #132254 or narrowly repair the default writer before enabling promotion, with promotion → rotation → resolved-identity coverage.
  • Resolve security concern: Promoted credentials survive an operator's identity replacement - The newly populated accounts.default credential outranks a later root credential write. The resolved old credential feeds the Google authentication client and outgoing API token, so replacing credentials does not reliably replace the acting identity.
  • Resolve merge risk (P1) - The packaged Doctor transcript does not establish safe interactive setup or credential replacement after promotion; existing setups can lose webhook readiness or continue using a replaced identity.
  • Complete next step (P2) - Fix both Google Chat setup regressions and provide redacted production-path evidence that credential replacement excludes the previous identity before API I/O.

Findings

  • [P1] [P1] Preserve the default account's audience during named setup — extensions/googlechat/src/setup-core.ts:70-72
  • [P1] [P1] Retire promoted credentials when rotating the default account — extensions/googlechat/src/setup-core.ts:56-58
  • [medium] Promoted credentials survive an operator's identity replacement — extensions/googlechat/src/setup-core.ts:57
Agent review details

Security

Needs attention: Credential promotion can leave a replaced Google Chat identity authoritative for later outbound authentication.

PR surface

Source +33, Tests +81, Config +6. Total +120 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 2 39 6 +33
Tests 3 81 0 +81
Docs 0 0 0 0
Config 2 6 0 +6
Generated 0 0 0 0
Other 0 0 0 0
Total 7 126 6 +120

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Repair both setup paths before landing (recommended)
    Preserve the implicit default account's audience and coordinate credential retirement with the open rotation repair, then demonstrate the selected replacement identity.
  2. Pause Google Chat promotion
    Keep this PR open until the shared setup and credential-rotation repairs can safely support Google Chat's declarations.

Technical review

Best possible solution:

Keep the plugin declarations while preserving the default identity's audience during setup and retiring promoted credentials atomically when that identity is replaced.

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

Yes, from source: configure an existing named Google Chat account beside root credentials and audience settings, or promote a root credential and then rotate the default account. The respective owners deterministically lose the default audience or select the old credential; these paths were not executed in this review.

Is this the best way to solve the issue?

No, not yet: the declarations fit the existing SDK, but both Doctor and interactive setup consume them, and the latter's destination and credential-write semantics need to preserve existing identities.

Full review comments:

  • [P1] [P1] Preserve the default account's audience during named setup — extensions/googlechat/src/setup-core.ts:70-72
    With root service-account credentials and audience settings plus only accounts.work, configuring work through the wizard calls the shared promotion helper with this contract. That helper selects work as the promotion target and deletes the newly eligible audienceType/audience from the root. Credentials remain at root, so the implicit default identity survives but no longer resolves an audience; its monitor refuses webhook registration. Before this patch those two fields were not eligible and remained available. Preserve the default/shared audience when direct setup selects a named target, and cover the real wizard-to-account-resolution path.
    Confidence: 0.97
  • [P1] [P1] Retire promoted credentials when rotating the default account — extensions/googlechat/src/setup-core.ts:56-58
    These new keys make direct setup move a root-only Google Chat credential into accounts.default when adding the first named account. A subsequent default-account rotation still uses createPatchedAccountSetupAdapter, whose writer updates only the channel root. The account resolver overlays the old accounts.default credential over that replacement, so outbound authentication continues selecting the previous service account. This PR creates the automatic route into that stale state. Coordinate with fix(channels): retire the replaced credential source on setup rotation #132254 or narrowly repair the default writer before enabling promotion, with promotion → rotation → resolved-identity coverage.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 421245a6068d.

Labels

Label changes:

  • add P2: This is a bounded channel-configuration migration improvement without evidence of an urgent current deployment incident.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: the refreshed packaged Doctor transcript convincingly proves migration and resolves the previous proof request, but does not prove that a later credential replacement prevents the old identity from reaching Google API I/O. Add redacted production-path output showing the replacement identity selected and the replaced identity excluded; updating the PR body triggers review, with maintainer @clawsweeper re-review available if needed. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • remove proof: sufficient: Current real behavior proof status is insufficient, not sufficient.
  • remove P1: Current review triage priority is P2, so this older priority label is no longer current.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: 📣 needs proof.

Label justifications:

  • P2: This is a bounded channel-configuration migration improvement without evidence of an urgent current deployment incident.
  • merge-risk: 🚨 compatibility: Newly eligible audience fields can be removed from an existing implicit default account during interactive setup.
  • merge-risk: 🚨 auth-provider: Automatically promoted service-account credentials can override a later default-account credential replacement.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Authority-chain proof required: the refreshed packaged Doctor transcript convincingly proves migration and resolves the previous proof request, but does not prove that a later credential replacement prevents the old identity from reaching Google API I/O. Add redacted production-path output showing the replacement identity selected and the replaced identity excluded; updating the PR body triggers review, with maintainer @clawsweeper re-review available if needed. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Security concerns:

  • [medium] Promoted credentials survive an operator's identity replacement — extensions/googlechat/src/setup-core.ts:57
    The newly populated accounts.default credential outranks a later root credential write. The resolved old credential feeds the Google authentication client and outgoing API token, so replacing credentials does not reliably replace the acting identity.
    Confidence: 0.97

What I checked:

  • Verified introduced change: The merge-base-to-head diff adds promotion declarations and manifest discovery flags, plus focused tests. The verified test merge records the supplied base first and exact PR head second; unrelated endpoint drift is not attributed to this PR. (extensions/googlechat/src/setup-core.ts:54, 8b621fed2d0f)
  • Current-main necessity: Current main still exports Google Chat's adapter without promotion declarations. Zalo User likewise lacks its empty declaration. The inspected promotion implementation is unchanged between the pinned merge base and fetched main. (extensions/googlechat/src/setup-core.ts:18, 421245a6068d)
  • Latest-release comparison: The supplied latest release, v2026.9.3, also lacks Google Chat's declarations; inspection of the Zalo User adapter at that release found the same omission. (extensions/googlechat/src/setup-core.ts:18, 1391f7cd2d40)
  • Existing supported extension contract: The documented setup contract already supports extra promotion keys, named-account restrictions, and a plugin-selected promotion target. Empty declarations suppress legacy plugin-specific keys but not common fields; no new SDK API is needed. Public docs: docs/plugins/sdk-setup.md. (docs/plugins/sdk-setup.md:436, 8b621fed2d0f)
  • Direct setup can select the wrong promotion destination: Interactive setup passes the published plugin contract into promotion. With exactly one named account and no explicit default, the helper selects that named account, copies eligible root fields only if absent, and deletes them from the root. Unlike Doctor, this path does not invariably create accounts.default. (src/channels/plugins/setup-helpers.ts:328, 8b621fed2d0f)
  • Missing audience blocks the surviving default identity: Root service-account credentials keep the implicit default account listed. Its resolver does not inherit configuration from accounts.work, and the monitor refuses webhook registration when audienceType or audience is missing. (extensions/googlechat/src/monitor.ts:526, 8b621fed2d0f)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • wangmiao0668000666: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Preserve the implicit default account's audience when configuring a named Google Chat account.
  • Repair promoted-credential retirement, coordinating with the existing rotation PR.
  • Add redacted final-effect proof that replacement credentials are used and the replaced identity cannot supply the outbound API token.

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 (25 earlier review cycles; latest 8 shown)
  • reviewed August 6, 2026, 7:44 AM ET / 11:44 UTC sha unknown :: needs maintainer review before merge. :: none
  • reviewed 2026-08-15T12:53:27.517Z sha a85af6694893a4fd72b72bdbc890e0248c8f4dbd :: needs changes before merge. :: [P1] Assert the published Zalo User setup contract
  • reviewed 2026-08-16T01:21:37.600Z sha b7ea94a187e4a97efdf9704afb8169c0a5a086a7 :: needs changes before merge. :: [P1] Preserve inherited Google Chat credentials
  • reviewed 2026-08-16T03:51:38.605Z sha 9edb78e3b8366a1d3a562373b9a0a9bed41fd344 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-16T04:31:13.226Z sha a89a62f77b3d84d7aa4d188343796aa2f0e11bde :: needs maintainer review before merge. :: none
  • reviewed August 18, 2026, 8:11 PM ET / August 19, 2026, 00:11 UTC sha unknown :: needs maintainer review before merge. :: none
  • reviewed 2026-08-25T01:21:06.728Z sha a89a62f77b3d84d7aa4d188343796aa2f0e11bde :: needs maintainer review before merge. :: none
  • reviewed 2026-09-01T20:30:49.284Z sha a89a62f77b3d84d7aa4d188343796aa2f0e11bde :: needs maintainer review before merge. :: none

@wangmiao0668000666
wangmiao0668000666 force-pushed the pr-googlechat-zalouser-config-promotion branch from 7023181 to 06ccabb Compare July 27, 2026 01:43
@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

Added real behavior proof: focused test execution showing the config-promotion declarations are accessible to the doctor migration path, plus declaration and manifest verification. Rebased onto latest origin/main.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 27, 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: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@wangmiao0668000666
wangmiao0668000666 force-pushed the pr-googlechat-zalouser-config-promotion branch from 06ccabb to 03e60d4 Compare July 29, 2026 16:14
@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

  • Rebased onto latest origin/main.
  • Added real doctor-migration proof: ran the actual resolveSingleAccountPromotion resolver from src/channels/plugins/setup-promotion-helpers.ts with the real bundled googlechatSetupAdapter and zalouserSetupAdapter plus representative legacy configs.
  • Output confirms Google Chat promotes the 6 declared account-scoped keys to accounts.default without deferral, and Zalo User's explicit empty declaration prevents both promotion and deferral.
  • Updated PR body with the migration transcript.

Head: 03e60d40d4.

@clawsweeper

clawsweeper Bot commented Jul 29, 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: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jul 29, 2026
@wangmiao0668000666
wangmiao0668000666 force-pushed the pr-googlechat-zalouser-config-promotion branch from 03e60d4 to 08c3cbe Compare July 29, 2026 16:56
@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 30, 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: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@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. 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. labels Jul 30, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. P1 High-priority user-facing bug, regression, or broken workflow. labels Aug 16, 2026
@openclaw-barnacle openclaw-barnacle Bot added the commands Command implementations label Aug 16, 2026
@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The named-account credential P1 is fixed on 9edb78e3b83 (fast-forward on the reviewed b7ea94a; no rebase).

Root cause confirmed: mergeGoogleChatAccountConfig (extensions/googlechat/src/accounts.ts:75-81) strips serviceAccount/serviceAccountFile when merging accounts.default into a named account, so promoting those keys would strand named accounts that inherit the root credential today.

Fix (reviewer-recommended shape): googlechatSetupAdapter now declares namedAccountPromotionKeys limited to exactly the fields the resolver shares from accounts.default: audienceType, audience, webhookPath, webhookUrl, plus the flat access-policy keys (dmPolicy, allowFrom, groupPolicy, groupAllowFrom). Credentials are excluded, so with named accounts present they stay at root and inheritance is preserved. zalouser is untouched (its declared-empty singleAccountKeysToMove remains an authoritative opt-out; no credential issue there).

Coverage:

  • extensions/googlechat/src/setup.test.ts pins both declaration lists (32/32 green).
  • src/commands/doctor-legacy-config.migrations.test.ts gains a normalizer-level test with a stub surface shaped like this declaration: credentials stay at root, allowlisted keys move, named account never receives the root credential (78/78 green). The unit environment cannot see real bundled surfaces, so the real composition is proven by the packaged run below.
  • Fresh autoreview (Claude claude-fable-5): clean, no accepted/actionable findings.

Packaged Doctor proof rerun on this head (full build-all.mts dist; built artifact verified to carry both declaration lists). New scenario — root credentials + shared keys + a named work account with no credential of its own:

Persisted after doctor --fix:

  • root keeps serviceAccount + serviceAccountFile → named accounts keep resolving the inherited credential;
  • accounts.default receives exactly the allowlisted shared fields (audienceType/audience/webhookPath/webhookUrl/dmPolicy/allowFrom);
  • work keeps its own audience, gains only inherited policy keys.

One boundary note: the doctor promotion path only engages when an accounts map already exists (legacy-config-core-normalizers.ts:140-147); a root-only single-account config without any accounts map is skipped on current main as well, so this PR changes nothing there.

@clawsweeper

clawsweeper Bot commented Aug 16, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. and removed 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. labels Aug 16, 2026
@wangmiao0668000666
wangmiao0668000666 force-pushed the pr-googlechat-zalouser-config-promotion branch from 9edb78e to a89a62f Compare August 16, 2026 04:24
wangmiao0668000666 and others added 3 commits September 10, 2026 10:41
…n keys

Declare singleAccountKeysToMove on both channel setup adapters and add
configPromotion setupFeature to their package manifests, completing the
per-channel migration started in openclaw#112293.

Co-Authored-By: Claude <[email protected]>
@wangmiao0668000666
wangmiao0668000666 force-pushed the pr-googlechat-zalouser-config-promotion branch from a89a62f to 8b621fe Compare September 10, 2026 04:06
@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Rebased onto current main (8cc90fe5d745) as 8b621fed2d0 — conflict-free, identical scope (7 files, +126/−6).

The previous review's proof still holds, with one behavioral refinement now documented in the updated PR body: the packaged doctor --fix proof was re-run on the new head (2026-09-10) with a fresh main-line control dist. With named accounts present, googlechat now promotes only namedAccountPromotionKeys members into accounts.default — serviceAccount/serviceAccountFile stay at the channel root (mergeGoogleChatAccountConfig strips per-account credentials), while audienceType/audience/webhookPath/webhookUrl plus common dmPolicy/allowFrom move. zalouser's declared-empty opt-out keeps profile at root and promotes common policy keys. Main-line control: no promotion, doctor reports the default-account-routing gap instead.

Focused suites on the new head: googlechat setup 32/32 (LANG=C), zalouser channel.setup 2/2, doctor legacy-config migrations 91/91 (includes the new named-account restriction test). Promotion-seam files are untouched by main movement since the rebase base.

@clawsweeper

clawsweeper Bot commented Sep 10, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. P1 High-priority user-facing bug, regression, or broken workflow. 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. labels Sep 10, 2026
@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

Splitting this PR: the zalouser half landed as #143860 (singleAccountKeysToMove: [] opt-out declaration + setupFeatures.configPromotion manifest flag, rebased onto current origin/main with fresh test/lint proof).

The googlechat half is closed here rather than reworked. ClawSweeper's latest review of 8b621fed2d0 (Revision 26) identified two P1 setup-path regressions specific to the googlechat declarations:

  1. Named setup removes the implicit default identity's audience — with root service-account credentials + audience settings and exactly one named account, configuring that account through the wizard promotes audienceType/audience to the named account and deletes them from the root, leaving the surviving implicit default identity (credentials still at root) unable to resolve an audience; its monitor refuses webhook registration.
  2. Promoted default-account credentials outrank a later credential replacement — once serviceAccount is promoted into accounts.default, a subsequent default-account rotation writes to the channel root only, and the account resolver overlays the old accounts.default credential over that replacement, so outbound authentication keeps selecting the previous service account.

Both findings were verified against source (src/channels/plugins/setup-helpers.ts, src/channels/plugins/account-config-mutation.ts, extensions/googlechat/src/monitor.ts) and are real, but they concern the interactive setup path and credential-rotation semantics, not the packaged doctor migration this PR's evidence covered. Fixing them properly needs the credential-retirement repair in #132254 plus coverage of the wizard-to-account-resolution and promotion→rotation→resolved-identity paths — a separate, larger change.

The zalouser opt-out declaration has no promotion surface for either finding (empty singleAccountKeysToMove, credentials and profile stay at root), so it is unaffected and proceeds independently in #143860.

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: zalouser Channel integration: zalouser commands Command implementations merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant