Skip to content

Fix case-sensitive Weixin peer route matching - #233

Draft
kbestcar wants to merge 1 commit into
Tencent:mainfrom
kbestcar:agent/normalize-weixin-route-peer
Draft

Fix case-sensitive Weixin peer route matching#233
kbestcar wants to merge 1 commit into
Tencent:mainfrom
kbestcar:agent/normalize-weixin-route-peer

Conversation

@kbestcar

Copy link
Copy Markdown

What changed

  • Normalize the inbound Weixin peer ID to lowercase before resolving an OpenClaw agent route.
  • Reuse that canonical peer ID when recording lastRoute.to.
  • Preserve the original ctx.To for outbound delivery.

Why

Weixin may provide the same peer identifier with mixed-case characters while an OpenClaw binding stores its lowercase form. The exact route matcher then misses the intended binding and falls back to the default agent.

All identifiers used during validation were kept private; examples in the related issue are synthetic.

Fixes #232.

Validation

  • npm run typecheck
  • npm run build
  • OPENCLAW_STATE_DIR=<temporary directory> npx vitest run --coverage=false — 397/397 tests passed
  • Live local validation on plugin 2.4.6 confirmed that a mixed-case inbound peer matched the existing lowercase binding and did not affect the Telegram route.

The repository's coverage command executes all 397 tests successfully but currently reports global branch coverage of 89.13% against its configured 90% threshold; process-message.ts is excluded from coverage, so this patch does not change that metric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Normalize inbound Weixin peer IDs before exact agent-route matching

1 participant