fix(zalo): accept opaque string chat IDs#101548
Conversation
Co-authored-by: Goutam Adwant <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 680ec03230
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const target = normalizeZaloMessagingTarget(normalized ?? raw); | ||
| return Boolean(target); |
There was a problem hiding this comment.
Strip OpenClaw kind prefixes before accepting Zalo IDs
When a Zalo target is entered with OpenClaw's generic kind prefix, e.g. user:49270a5f8f1c66423f0d or group:..., this new predicate treats the whole prefixed string as an id-like Zalo chat id before directory/kind-prefix stripping can run. resolveMessagingTarget then returns the normalized value as the send target, and extensions/zalo/src/send.ts forwards it directly as chat_id, so the API receives user:<id>/group:<id> instead of the raw Zalo chat id. The Zalo session-route code already treats these prefixes as OpenClaw route markers, so the id detector should either reject them for the id-like fast path or strip them before returning true.
Useful? React with 👍 / 👎.
|
Land-ready verification:
Known gap: no new credentialed live Zalo send was made. Linked issue #57594 contains successful upstream API responses for the same nonnumeric IDs; this patch changes only OpenClaw's pre-send resolver gate. This replacement preserves @goutamadwant's code and |
|
Merged via squash.
|
Co-authored-by: Goutam Adwant <[email protected]>
Co-authored-by: Goutam Adwant <[email protected]>
What Problem This Solves
Zalo proactive sends reject valid nonnumeric Bot API
chat_idstrings before delivery because the channel uses the shared numeric-ID predicate. This closes #57594 and replaces #93689, whose contributor fork is too far behindmainto update without publishing thousands of unrelated upstream files.Why This Change Was Made
sendMessagecontract defineschat_idasStringand usesabc.xyzin its request example.chatIdas a string; only the pre-send resolver gate is wrong.Contributor credit is preserved from #93689 via
Co-authored-by: Goutam Adwant <[email protected]>.User Impact
openclaw message send --channel zalo --target <chat_id>now accepts valid string IDs such as the reported hex-like values and documented dotted values. Scheduled and scripted proactive Zalo notifications no longer fail withUnknown targetsolely because the upstream ID is nonnumeric.Evidence
mainand v2026.6.11 useisNumericTargetId;extensions/zalo/src/send.tsaccepts and forwards stringchat_idvalues.aws, leasecbx_c5397d05acbb, runrun_763782bdf491, reviewed source heade90bdb95bb69a53e419e8d8b60fc41fb07ec003d.extensions/zalo/src/channel.directory.test.ts,src/infra/outbound/target-normalization.test.ts, andsrc/infra/outbound/target-resolver.test.ts.pnpm openclaw message send --channel zalo --target abc.xyz --message test --dry-run --jsonreturnedhandledBy: "core",to: "abc.xyz", andvia: "direct".git diff --checkpassed.Live credentialed Zalo delivery was not repeated; #57594 includes successful upstream API responses for the same nonnumeric IDs. The changed surface is the local resolver gate before send.
Closes #57594
Supersedes #93689