Commit 2cedcef
fix(messaging): bind OpenClaw WeChat credentials (#10601)
## Outcome
This PR repairs the remaining OpenClaw WeChat credential lifecycle for
the two iLink hosts currently authorized by repository policy. The
Tencent plugin account file now receives the exact revision-scoped
OpenShell placeholder, both authorized REST endpoints retain
endpointless provider binding, and channel removal clears durable
account state before policy or registry teardown.
Raw bot tokens remain outside sandbox files, arguments, and diagnostics.
## Reason
The WeChat seed hook writes its token outside `openclaw.json`, while the
generic startup refresh updated placeholders only inside
`openclaw.json`. OpenShell therefore could not match the canonical
account-file placeholder to the provider revision required by L7
credential binding.
### Related issues
Fixes #10079
## Changes
- Bind both currently authorized OpenClaw WeChat REST endpoints to
`{sandboxName}-wechat-bridge` and require the WeChat preset at sandbox
creation.
- Refresh enabled WeChat account files from the exact runtime
`WECHAT_BOT_TOKEN` placeholder through descriptor-relative, no-follow
operations.
- Fail closed on raw or malformed values, unsafe IDs, symlinks, hard
links, permissive modes, and concurrent file replacement.
- Clear `/sandbox/.openclaw/openclaw-weixin` account state before
removal mutates provider, policy, plan, or registry state; preserve
retryable state if cleanup fails.
- Execute the checked-in production refresh helper directly in
deterministic tests and register its Python path in the changed-test
trigger map.
- Extend the existing `messaging-providers` and `channels-stop-start`
contracts with redacted installed-runtime and cleanup evidence.
## Product scope boundary
Valid QR responses may return an `idc-N.weixin.qq.com` host, while
current OpenClaw and Hermes policies authorize only literal static iLink
hosts. That pre-existing network-policy inconsistency is tracked in
#10606 and is not introduced by this PR. #10606 is still `needs: triage`
and has no recorded `Accept` product decision, so the repository
product-scope gate prohibits widening or changing that supported network
surface here. This PR does not claim IDC-host support.
## Verification
Candidate head: `aeeae739a22e868853060f3ee2965c51cdd74531`
Trusted base: `ab118eb2d14727d411726e34a385f65ccfd1d180`
- Credential-registration boundary: 25/25 tests passed.
- Fake WeChat API and runtime proof support: 24/24 tests passed.
- CLI type-check, repository checks, Oxfmt, Oxlint, gitleaks,
source-shape budget, and commit/pre-push hooks passed.
- Codebase growth guardrails: 32/32 passed locally on the refreshed
base; exact-head GitHub run
[33302574932](https://github.com/NVIDIA/NemoClaw/actions/runs/33302574932)
passed without a budget change.
- The exact CLI/integration/E2E-support shard 11 selection passed the
credential-registration test and 3,336 tests overall locally. Three
unrelated local tests failed: one macOS shell lacks `BASHPID`, one
agent-command test timed out, and one warmup test did not create its
expected log.
- Exact-head CI
[33302575905](https://github.com/NVIDIA/NemoClaw/actions/runs/33302575905),
Review Advisor
[33302574922](https://github.com/NVIDIA/NemoClaw/actions/runs/33302574922),
security
[33302575862](https://github.com/NVIDIA/NemoClaw/actions/runs/33302575862),
managed images
[33302575896](https://github.com/NVIDIA/NemoClaw/actions/runs/33302575896),
rootless Podman
[33302575893](https://github.com/NVIDIA/NemoClaw/actions/runs/33302575893),
and self-hosted qualification
[33302576858](https://github.com/NVIDIA/NemoClaw/actions/runs/33302576858)
passed. The exact head has 70 passing checks, 6 expected skips, and no
failures.
- All nine exact-head Review Advisor summaries report no finding after
the documented best-effort synchronization result was clarified. No
review thread is unresolved.
### Live qualification boundary
Trusted manual run
[33298977079](https://github.com/NVIDIA/NemoClaw/actions/runs/33298977079)
used candidate `6db670ed0b954cc217b607bc830fec54a2b1c72d`, base/workflow
`d1f401eeac15cd4354c42578fecf34b9c7463c75`, and correlation
`2acb6c65-41bf-4f23-a088-fd9ab074f220`. The current head differs from
that candidate only by non-production changes: deleting a
source-shape-only routing assertion, moving the full onboarding import
outside the timed drift-guard assertion, merging the unrelated
voice-test-only upstream commit
`ab118eb2d14727d411726e34a385f65ccfd1d180`, and clarifying the
documented failure result of best-effort session policy synchronization.
- OpenClaw Telegram add/remove passed with 85 product-evidence files.
- OpenClaw and Hermes all-channel stop/start both stopped during initial
onboarding after the gateway registered Google Chat refresh and reported
mint status `error`; downstream lifecycle phases were skipped. This is a
validation-fixture gate, not passing evidence for the channel matrix.
- Both failed jobs completed cleanup with no failures: each destroyed
its sandbox, deleted every registered messaging provider, removed the
gateway, and stopped the heartbeat.
- The run did not send bot messages. Current bot-reply validation
remains unrun because no configured `_REAL` route target was proven
automation-only. Historical #10273 evidence records actual replies for
Slack, Discord, and Google Chat on both agents; it is not represented as
current-head proof.
## Review notes
This changes a credential-binding, startup file-mutation, and
durable-state cleanup boundary. Diagnostics name only the affected key
or state class, never credential values. The installed WeChat proof uses
a repository fake API and must not be described as a real bot reply.
---
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added WeChat messaging support, including account configuration,
credential handling, runtime validation, and message delivery.
* Added secure WeChat token placeholder refresh during startup.
* Added cleanup of WeChat account state when removing the channel.
* **Bug Fixes**
* Improved channel-state cleanup with validation, safer recovery, and
clearer remediation guidance.
* Prevented unsafe or invalid state paths from being processed.
* **Tests**
* Added comprehensive WeChat lifecycle, runtime, credential-redaction,
and cleanup coverage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com>
Signed-off-by: Senthil Ravichandran <senthilr@nvidia.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Senthil Ravichandran <senthilr@nvidia.com>1 parent 5708798 commit 2cedcef
41 files changed
Lines changed: 3179 additions & 400 deletions
File tree
- docs/manage-sandboxes
- scripts
- lib
- src/lib
- actions/sandbox
- messaging
- channels
- wechat
- policy
- runtime
- manifest
- onboard
- experimental
- sandbox
- test
- agents
- hermes
- openclaw/runtime
- channels
- e2e
- lib
- live
- support
- helpers
- mcp
- onboarding
- runtime/sandbox
- tools
- e2e
- mcp-tool-discovery-runtime/reviewed-runtime-bundle
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
580 | 580 | | |
581 | 581 | | |
582 | 582 | | |
| 583 | + | |
583 | 584 | | |
584 | 585 | | |
585 | 586 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
75 | 83 | | |
76 | 84 | | |
77 | 85 | | |
| |||
0 commit comments