fix(zalo): accept string chat ids for outbound sends#93689
fix(zalo): accept string chat ids for outbound sends#93689goutamadwant wants to merge 2 commits into
Conversation
450c06d to
96397f4
Compare
|
Codex review: needs maintainer review before merge. Reviewed July 1, 2026, 2:13 AM ET / 06:13 UTC. Summary PR surface: Source +2, Tests +17. Total +19 across 2 files. Reproducibility: yes. Source inspection shows current main and v2026.6.11 use the numeric-only Zalo looksLikeId helper, and the shared resolver only accepts direct targets when that predicate returns true. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the Zalo-local opaque chat_id predicate after the prior review is cleared and current CI is green, while leaving shared outbound target heuristics unchanged. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main and v2026.6.11 use the numeric-only Zalo looksLikeId helper, and the shared resolver only accepts direct targets when that predicate returns true. Is this the best way to solve the issue? Yes, with maintainer acceptance of the wider delivery heuristic. A Zalo-local opaque string predicate is the right owner boundary; changing shared target heuristics or encoding a guessed hex grammar would be worse. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0c7bac34ae68. Label changesLabel justifications:
Evidence reviewedPR surface: Source +2, Tests +17. Total +19 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
Review history (1 earlier review cycle)
|
05d8f27 to
d3ded44
Compare
|
Clownfish 🐠 reef update Thanks for the contribution here. Clownfish gave this branch a little current boost so the original PR can stay the canonical swim lane instead of opening a replacement. Source PR: #93689 fish notes: model gpt-5.5, reasoning medium; reviewed against 824baed. |
d3ded44 to
824baed
Compare
824baed to
1955870
Compare
vincentkoc
left a comment
There was a problem hiding this comment.
P2: the new regex still rejects Zalo's documented string chat ID form. The official sendMessage docs define chat_id as String and use abc.xyz in the request example, but zaloChatIdPattern accepts only digits or a 12-plus-character hex string. Please avoid encoding an undocumented grammar here: treat the normalized nonblank Zalo chat ID as opaque, or prove the complete upstream format, and add abc.xyz plus a prefixed variant to the resolver test.
|
Thanks for the review @vincentkoc . I updated the branch/code to remove the undocumented Zalo I added resolver coverage for Local validation are good too. The remaining failed CI check appears to be runner infrastructure. |
c66c802 to
e90bdb9
Compare
|
Landed the same final two-file fix in #101548 as commit 6b76a30. Thank you, @goutamadwant. Your Verification on the landed patch included 34 focused tests, a real |
Summary
What problem does this PR solve?
chat_idstring values before delivery.chat_idas opaque, matching Zalo's documentedStringfield.Why does this matter now?
main.3becaa50ae12474c1e03and documented string examples likeabc.xyz, which blocks proactive notifications even though Zalo Bot API delivery can work with stringchat_idvalues.What is the intended outcome?
openclaw message send --channel zalo --target <chat_id>resolves any nonblank normalized Zalo target as a direct Zalochat_idinstead of failing withUnknown targetbecause OpenClaw cannot infer the upstream ID grammar.What is intentionally out of scope?
What does success look like?
zalo:, andzl:Zalo string chat IDs pass target resolution.What should reviewers focus on?
chat_idas opaque is the right boundary given Zalo documents it asString.Summary guidance
This PR description is the contributor's durable explanation of the change. Write it for human maintainers first; ClawSweeper and Barnacle use the same text to understand intent, proof, risk, and current review state.
Describe the intent and outcome in 2-5 bullets. Avoid restating the diff; reviewers and bots can read the changed files.
If this PR fixes a plugin beta-release blocker, title it
fix(<plugin-id>): beta blocker - <summary>and link the matchingBeta blocker: <plugin-name> - <summary>issue labeledbeta-blocker. Contributors cannot label PRs, so the title is the PR-side signal for maintainers and automation.Linked context
Which issue does this close?
Closes #57594
Which issues, PRs, or discussions are related?
Related #84599
Was this requested by a maintainer or owner?
The review on #93689 requested avoiding an undocumented regex grammar and adding coverage for Zalo's documented
abc.xyzstringchat_idexample.Linked context guidance
Link the issue, PR, discussion, maintainer request, or owner request that explains why this PR should exist. Maintainer context helps reviewers and automation distinguish intended work from drive-by churn.
Real behavior proof (required for external PRs)
chat_idstring values before send target resolution.openclaw message send --channel zalo --target abc.xyz --message test --dry-run --json{ "action": "send", "channel": "zalo", "dryRun": true, "handledBy": "core", "payload": { "channel": "zalo", "to": "abc.xyz", "via": "direct", "mediaUrl": null, "dryRun": true } }chat_idresolves to a direct outbound target instead of failing as an unknown target.origin/main,extensions/zalo/src/channel.tswiredtargetResolver.looksLikeIdtoisNumericTargetId; that helper only accepts/^\d{3,}$/, excluding reported hex-like IDs and documented dotted string IDs.Real behavior proof guidance
External contributors must show after-fix evidence from a real OpenClaw setup. Unit tests, mocks, lint, typechecks, snapshots, and CI are supplemental only.
Screenshots are encouraged even for CLI, console, text, or log changes. Terminal screenshots, copied live output, redacted runtime logs, recordings, and linked artifacts count.
If your environment cannot produce the ideal proof, explain that under
Proof limitations or environment constraintsso reviewers and ClawSweeper can direct the next step properly.Be mindful of private information like IP addresses, API keys, phone numbers, non-public endpoints, or other private details when providing evidence.
Tests and validation
Which commands did you run?
node scripts/run-vitest.mjs extensions/zalo/src/channel.directory.test.ts src/infra/outbound/target-normalization.test.ts src/infra/outbound/target-resolver.test.tsnode scripts/run-vitest.mjs extensions/zalo/src src/infra/outbound/outbound-session.test.ts./node_modules/.bin/oxfmt --check --threads=1 extensions/zalo/src/channel.ts extensions/zalo/src/channel.directory.test.ts./node_modules/.bin/oxlint extensions/zalo/src/channel.ts extensions/zalo/src/channel.directory.test.tsgit diff --checkOPENCLAW_BUILD_ALL_NO_PNPM=1 node scripts/build-all.mjs qaRuntimeWhat regression coverage was added or updated?
zalo:-prefixed, andzl:-prefixed chat IDs.What failed before this fix, if known?
mainusesisNumericTargetIdfor Zalo direct target detection, so reported Zalochat_idvalues like3becaa50ae12474c1e03and documented string examples likeabc.xyzdo not qualify as id-like targets.If no test was added, why not?
Testing guidance
List focused commands, not every incidental check. CI is useful support, but external PRs still need real behavior proof above when behavior changes.
Risk checklist
Did user-visible behavior change? (
Yes/No)Yes
Did config, environment, or migration behavior change? (
Yes/No)No
Did security, auth, secrets, network, or tool execution behavior change? (
Yes/No)No
What is the highest-risk area?
chat_id, so ordinary-looking strings can be sent directly instead of being rejected as unknown targets.How is that risk mitigated?
chat_idasStringand shows a dotted string example, so OpenClaw should not invent a narrower grammar.Risk guidance
Use this for author judgment that is not obvious from the diff. ClawSweeper can see touched files, but it cannot know which behavior you think is risky, why the risk is acceptable, or what mitigation reviewers should verify.
Current review state
What is the next action?
What is still waiting on author, maintainer, CI, or external proof?
Which bot or reviewer comments were addressed?
chat_idvalues as opaque strings, and addingabc.xyzplus prefixed variants to the resolver test.Review state guidance
Keep this as the durable state for review progress. If useful information appears in comments, fold the current next action or blocker back here so maintainers and ClawSweeper do not need to reconstruct state from comment history.